# One group has only zero values, should I use parametric or non-parametric test?

I have 3 groups (n=5 per group) from biological data. I have checked the normality of my groups using the Shapiro-Wilk test and two of my groups are normally distributed. However, the 3rd group values are all zero, thus there is no variability in that group. The data I have is discrete and it can never be negative value as I am measuring number of worms in my experiments. Should I use a parametric test (ANOVA) or a non-parametric test (Kruskal-Wallis) test to compare the 3 groups?

Other research groups with similar data have done an ANOVA but I am not 100% sure why they consider the group with all zeros to be normally distributed. Here is an example: https://www.ncbi.nlm.nih.gov/pubmed/29540816 Figure 2a - "sub-group 3" has values all equal to zero and is compared with one-way ANOVA to "sham" group

Here is an example of how my data looks like: Group A (negative control): 110, 94 , 85, 67, 89 Group B (experimental group tested by other researches too): 0, 0, 0, 0, 0 Group C (experimental group): 24, 56, 67, 34, 26

All my subjects were infected and the groups represent different drug treatments. My measurement is number of worms - so if the treatment works then there will be fewer worms than the negative control or even no worms at all.

Disclaimer : I am not great with stats but all help is appreciated!

• Having zero variability in one of the groups is your issue, and it is not worth debating whether to use an ANOVA F-test or KW until you remedy that (probably by collecting more data). Or do you know that the group always is zero? – Dave Nov 23 '19 at 2:54
• Hi Dave, that group will always be zero. In my biological context, the infection has been cleared 100% in all my subjects and results are pretty robust so I will alway have zero variability in that group. Thank you for your input! – Caroline Nov 23 '19 at 13:08
• I'm going to make an assumption about your problem and say that what you're measuring is something like presence of infection, which cannot be negative. With that in mind, you have your answer with $p=0$ (not $p\approx 0$ but $p=0$), since you have observed positive quantities in the other groups and have no way of getting negative values to offset the positive observations and get a mean of zero. Therefore, there is no chance that the three groups have the same mean. – Dave Nov 23 '19 at 13:15
• It would be very helpful to us if you posted some of the work by other groups (what you're citing) so we can look at their statistical methods and see exactly what they did. You can edit your question to put references at the end. – Dave Nov 23 '19 at 13:19
• With the added example: I'm not sure I would have used anova with either analysis in Figure 2. Seems like a pretty obvious violation of the assumption of equal variances among groups (or homoscedasticity). – Sal Mangiafico Nov 23 '19 at 23:07

First, let me try to summarize:

• You have 3 groups, N = 5 in each
• You have a count of infections for each subject
• In one group, the counts are all 0 and will always be 0. This is not about the sample, but about the population.
• Your main interest is whether one of the groups with non-zero data is different from the group with all 0 data

Given the last question, your answer seems to be an automatic "yes". The question is only whether that difference is "significant". But, since there is no variation in the other group, you are, essentially, testing whether the counts are significantly different from 0.

Given your actual data (110, 94 , 85, 67, 89) I would be strongly tempted to avoid any significance testing at all and just say "Look! It's not 0!". If someone objected, you could just say "well, I can gather more observations and since some of the values will be different from 0, if I gather enough data, it will be significant". (Because the other group is all 0). As so often, significance doesn't seem to be the real issue here.

However, if you really wanted to do a significance test, I would probably first define exactly what you are looking for (mean? median? something else?) and then do a permutation test.

• With revisions to the question, it sounds like the values in the 0 group were actually measured, so not necessarily always zero. – Sal Mangiafico Nov 25 '19 at 15:04
• @SalMangiafico Then I am confused. – Peter Flom Nov 26 '19 at 0:20

Edit, based on subsequent edits to question and discussion

Given that you have three groups of measured values, a one-sample test comparing a group to zero doesn't make much sense. Given that the variance among these groups are probably markedly different, a traditional anova is probably not applicable. One classic and simple test that may be reasonable is the Kruskal-Wallis followed by a Dunn (1964) post hoc test. Be sure to use an implementation that takes ties into account, and be sure to understand the hypothesis being tested by this test. (Hint: it's not a test of medians.) There may be other tests that may be applicable depending on what hypothesis you want to test. Perhaps a permutation anova, or a (multi-sample) Mood's median test. I might be tempted to present these data as the mean (or another measure of central tendency) for each group with a 95% confidence interval. That may tell the story in a simple and convincing way, without too much bother about the zero-variance in the one group.

As a first comment, assessing normality by a statistical test is generally not very useful to determine if data meet model assumptions. In this case, looking at individual groups of n=5, a test of normality is probably particularly not helpful. The following is a little example in R, whose data I wouldn't necessarily trust to be normally distributed.

Example = c(0.59, 0.68, 0.98, 2.39, 2.88)
hist(Example)
shapiro.test(Example)

### Shapiro-Wilk normality test
###
### W = 0.83792, p-value = 0.1593


I'm going to make the assumption that your measured variable is continuous or something similar. I can imagine a case where, say, you are measuring something in some samples where this measurement would necessarily be 0 in control samples. Maybe you are measuring virus concentration in the blood. This concentration varies among infected patients, but is necessarily 0 in uninfected people.

In this case, you might be interested in three separate questions / hypotheses. Is (the mean, median, ranks of) sample A different from 0? Is sample B different than 0? Is sample A different from sample B?

Depending on the data, the answers to the first two questions may be obvious. But testing them may be useful for pro forma reasons.

A potential example in R follows.

A = c(0,2,2,3,3,3,4,4,6)
B = c(2,4,4,5,5,5,6,6,8)

boxplot(A, B)

### Test means in three hypotheses

t.test(A, mu=0)
t.test(B, mu=0)
t.test(A,B)

### Test ranks in three hypotheses

wilcox.test(A, mu=0)
wilcox.test(B, mu=0)
wilcox.test(A,B)

### Test medians in three hypotheses

library(DescTools)

SignTest(A, mu = 0)
SignTest(B, mu = 0)

library(coin)

Y     = c(A, B)
Group = factor(c(rep("A", length(A)), rep("B", length(B))))

median_test(Y ~ Group)

• The question I am really interested in is whether (the response to a drug of) group A is different to that of group B. Since the mean of one of groups is 0 (and has no variability), do you think I could then do a one-sample t-test or Wilcoxoc test and compare it to zero? So essentially ask if the if group A is different from 0? – Caroline Nov 25 '19 at 10:16
• If you are comparing one measurement group to the zero group, then yes, a one-sample test would be appropriate. Considering that you have a type of count data, a t test may or may not be appropriate; you'll have to assess if these data approximately meet the assumptions of that test. A one-sample Wilcoxon test may be appropriate; be sure to understand the hypothesis being tested in this test; online information can be squirrelly. There are other one-sample tests that might be of interest, such as a one-sample sign test of the median. – Sal Mangiafico Nov 25 '19 at 11:46
• Re-reading your comment, it sounds like your zero group is actually the treatment group ("response to a drug"), not inherently zero-valued (as you stated in the comments to your original question). If this is the case, then a one-sample test doesn't really make sense... My honest advice: when asking a question on a forum like this, or to a person helping you, be clear as to what you are measuring, which groups are treatments, and provide sample data. Otherwise the advice you get is useless... At this point, given the information I have, I don't know if most of my advice is worthless... – Sal Mangiafico Nov 25 '19 at 11:57
• I have edited the post with an example of how my data looks like and clarified which group is what - hope this clarifies things – Caroline Nov 25 '19 at 12:36
• Okay. I have updated my answer based on these. – Sal Mangiafico Nov 25 '19 at 13:48