1
$\begingroup$

I am trying to understand a density plot. It has narrow peaks and means are far away from the peaks. What would be the reason for such behavior? Should I be doing a different plot to understand this data other than a density plot?

Description of data: It's user performance and different colors represent different groups. You can think performance as step count and I have logged the performance.

ggplot(dt, aes(x=log(step_count), fill=groups)) + geom_density(alpha=.3) + 
  geom_vline(data=mean.steps, aes(xintercept=mean.val, color=groups), linetype="dashed", size=.5)

enter image description here

$\endgroup$
5
  • $\begingroup$ Is sounds like your question is more about the behavior of statistical methods/plots rather than a specific programming question. As such it probably belongs on Cross Validated instead. $\endgroup$
    – MrFlick
    Commented Oct 23, 2014 at 3:47
  • $\begingroup$ Mean assumes the data comes from a normal distribution (which is why this statistic is appropriate only for such data). Peak and mean will align only when you distribution is (~perfectly) normal. $\endgroup$ Commented Oct 23, 2014 at 7:29
  • 2
    $\begingroup$ @RomanLuštrik Sorry, but that's misleading advice. For one, peak (meaning, position of peak, or mode) and mean should align for any unimodal symmetric distribution, and for two, that's possible otherwise. 0, 0, 1, 1, 1, 1, 3 has mean, median and mode all 1 but is not symmetric. Many asymmetric binomial distributions have mean equal to mode. Please see also my comment on the answer by mcastillon. $\endgroup$
    – Nick Cox
    Commented Oct 23, 2014 at 9:00
  • $\begingroup$ @NickCox I agree, but if one is interested in going backwards (from mean, this about distribution), it's less assumptions to assume a symmetric distribution because asymmetric distribution can be left-right skewed for starters. Hence, my advice to have a meaningful mean for symmetric distributions only. E.g. mean income per country means diddly squat (if you don't know the distribution) and assuming normality will give an erroneous perception at the very least. $\endgroup$ Commented Oct 23, 2014 at 11:53
  • $\begingroup$ We don't really disagree, I expect; nevertheless you are making stronger statements here than are needed or possible. For example, means can be pertinent for anything additive through their link to totals, regardless of skewness. Also, the mean has a definite meaning; if the issue is how much use it is, the answer is indeed sometimes little or none. More generally, if one were given the mean and nothing else, then there is indeed a question of what are the weakest extra assumptions that can be made, but that is a quite different problem from the problem in this thread. $\endgroup$
    – Nick Cox
    Commented Oct 23, 2014 at 12:22

2 Answers 2

2
$\begingroup$

One thing to note is that the means are far from the peaks for each of the groups except the blue one. All of your non-blue groups are skewed right (and thus not normally distributed) meaning the median performance of each group is less than the mean performance. What this means in the context of your data is that most users' performances are on the lower end while a few users have higher performances.

I'd say you have the right choice of visualization.

$\endgroup$
1
  • 3
    $\begingroup$ Skewness should be contrasted with symmetry, rather than normality. Advice received earlier to the effect that means only apply when data are normally distributed is quite unsound. Statistical people routinely apply means not only to symmetrical distributions other than the normal but also to skewed distributions such as the Poisson, gamma or exponential. It's just that the mean is necessarily pulled towards high values when right skewness is present (and to low values when left skewness is present) and can sometimes be misleading if there are outliers. So, plot the data, as here. $\endgroup$
    – Nick Cox
    Commented Oct 23, 2014 at 8:32
0
$\begingroup$

I think your data are skewed right strongly but because you use log you can't see that, so mean being righter than peak is obviously unsurprising.

$\endgroup$
1
  • 2
    $\begingroup$ Seeing skewness when a log scale is used shows that the skewness is strong; skewness isn't thereby hidden unless the reader doesn't understand log scales. If by "normal" you mean "distributed following a normal (Gaussian) distribution", then the second part of your statement is contradictory or confused; if you mean something else, then your meaning isn't clear. Perhaps you just mean something like unsurprising. $\endgroup$
    – Nick Cox
    Commented Oct 23, 2014 at 12:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.