2
$\begingroup$

I have a data frame with variables that are counts, nominal (two groups) and continuous. Two of the continuous variable follow a normal distribution; the counts variables do not follow a normal distribution. The samples are independent.

Can I use a Kruskal-Wallis test to check the difference in the means of the two groups? I am lost regarding if non-parametric tests can be used for discrete data (specifically, counts). Moreover, there are a lot of ties in the data (it's an activity data frame, where the entrances and exits of birds in nests were counted periodically).

$\endgroup$

1 Answer 1

0
$\begingroup$

Yes you can use the KW test with discrete values, and I think that's typically the case for most (all?) tests. There's nothing special about discrete values in data ... because what typically matters is the precision of your value rather than whether its a real or an integer, and real life measurements don't have infinite precision so data is never really "continuous". It'd be different if you were fitting distributions since some distributions exist especially for count data ... but even then modelling discrete data that looks Gaussian as Gaussian even though it can't possibly be is pretty common. On the KW topic, more precisely (from Wikipedia):

If the researcher can make the assumptions of an identically shaped and scaled distribution for all groups, except for any difference in medians, then the null hypothesis is that the medians of all groups are equal, and the alternative hypothesis is that at least one population median of one group is different from the population median of at least one other group.

So you can use it to compare medians under the assumption that both samples come from the same distribution. @dave points out that IF the distributions are the same, comparing medians and means would be the same BUT if the distributions are not the same than comparing medians and means may NOT be the same. Therefore, one cannot assume that this test is a comparison of means because it is a valid comparison of medians.

$\endgroup$
12
  • 4
    $\begingroup$ There actually is something quite special about discrete data: the possibility of ties. Many rank-based nonparametric procedures, like the KW, will fall apart unless ties are properly accounted for and corrected. Extreme numbers of ties can render them powerless. $\endgroup$
    – whuber
    Commented Nov 23, 2020 at 21:44
  • $\begingroup$ On the assumption that continuous values are less likely to produce ties? That's about precision and range. Measuring height in $\mu m$ is discrete but less likely to produce ties than measuring heigh in metres to two decimal places. $\endgroup$
    – emiru
    Commented Nov 23, 2020 at 21:48
  • $\begingroup$ If the distributions have identical shapes and scales, then the null hypothesis that the medians are equal is equivalent to a null that the means are equal. // Continuous distributions produce ties with probability $0$. $\endgroup$
    – Dave
    Commented Nov 23, 2020 at 21:53
  • $\begingroup$ There are a lot of ties in my data. Would a Wilcoxon test be better then? And I updated the questions to clarify a few things. $\endgroup$ Commented Nov 23, 2020 at 22:01
  • 1
    $\begingroup$ @IsaBragantini Much like a t-test is ANOVA with two groups, Wilcoxon (Mann-Whitney U) is KW with two groups. $\endgroup$
    – Dave
    Commented Nov 23, 2020 at 22:10

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.