Hi All,
My post is inspired by this post on SO:
https://stackoverflow.com/questions/24576515/relative-frequencies-proportions-with-dplyr
My question is why do relative frequencies in all these examples not add up to 100% (if we multiply by 100) or value 1 ?
mtcars %>%
group_by(am, gear) %>%
summarise(n = n()) %>%
mutate(freq = n / sum(n))
# am gear n freq
# 1 0 3 15 0.7894737
# 2 0 4 4 0.2105263
# 3 1 4 8 0.6153846
# 4 1 5 5 0.3846154
Here they say it should:
https://www.quora.com/Why-is-the-sum-of-relative-frequency-always-one
Am I misunderstanding something ?