# Which test should be performed if variance is 0?

Hello I have 100 students who answered the question, time spent sitting and I divided it into three groups: Group 1: (6-9) hours Group 2: (10-13) hours Group 3: (14-17) hours

Also the students answered the Boston questionnaire for symptom severity scale Which is 11 questions, and each question has scores from 1 to 5.

Below shows Boston score divided into groups of time spent sitting.

(6-9 hours) group 1 11 14 12 23 16 and there is 78 more numbers in this group.

(10-13 hours) group 2 There is 15 numbers.

(14-17 hours) group 3 There is two numbers 17 17

So I want to compare the mean of these three groups, because I have unequal sample size which is very different between my groups I used welch ANOVA test. But balecause in group 3 the variance is 0 the welch test cannot be performed, how should I solve this problem?

I hope I explained it clearly, sorry for my English. Thank you

• Please say more about the nature of the values whose means you are trying to compare. Please do that by editing the question, as comments are easy to overlook and can be deleted. Depending on the nature of your data, it might be possible to do either a standard linear model related to ANOVA or a non-parametric test. With only 2 cases in one group, however, you are unlikely to find it significantly different from other groups in any event. Consider why you think it's important to evaluate that group at all.
– EdM
Mar 14 at 17:57
• Obviously you don't have enough observations to estimate the variance in group 3. One option to get around this is to assume all variances equal (as standard one-way ANOVA does). Is there any reason why you can't do that? In case the variances in group 1 and 2 don't look strongly different, it's probably sensible. Mar 14 at 18:05
• Because I don't have equal sample size that's why I think I can't use the regular anova Mar 14 at 21:02

This is probably the main source of your problem:

The students answered in hours the time that they spent sitting and I divided it into the following three groups...

Breaking a continuous predictor into groups is not a good idea. If you keep the hours sitting as a continuous predictor you could use standard regression techniques to examine the relationship between your symptom severity score and hours sitting. You are otherwise making assumptions, for example, that there's a big difference between sitting for 9 hours versus 10 hours but no difference between 10 and 11 hours.

If you have additional predictors to evaluate, perform multiple regression rather than separate regressions. Otherwise you run a risk of omitted variable bias that could affect all of your estimates of associations with outcome.

If for some reason you are forced to use some form of ANOVA for these data, despite its far-from-ideal applicability, you have a few choices:

You could just do a standard ANOVA, without the Welch modification, assuming equal underlying variances around group means. That's what Christian Hennig suggested in a comment on the question. You could then use standard techniques like normal qq plots to check that assumption with the residuals.

You could use the non-parametric Kruskal-Wallis test, which addresses similar analysis as ANOVA but makes no assumptions about error distributions. With only 2 cases in one of your groups, however, I don't suspect that will be helpful.

Instead of discarding the 2 cases in group 3, you could add them into group 2. The you could do a t-test between the groups (6-9 hours; 10+ hours). If you are concerned about equal variance between the 2 groups you can used the Welch modification.

I'm very reluctant to recommend discarding data unless you have strong evidence that there was something wrong in the way it was collected.

• @kareenkk just use the reported values on the scale of 6 hours, 7 hours,...16 hours, 17 hours of sitting as the predictors in a regression model rather than breaking them up into groups to use ANOVA.
– EdM
Mar 14 at 19:02
• @kareenkk it's much better not to break observations down into groups, even if some other researchers did that. If you nevertheless are forced to break down into groups and the cutoffs between groups can't be changed to make groups of more comparable sizes, you could still try to model with ANOVA. You assume a constant within-group variance to start, do the ANOVA, and then evaluate that assumption by examining the distribution of residuals about the group means, for example with plots called "normal q-q plots."
– EdM
Mar 14 at 19:35
• What kind of proposal prevents you from doing it better? Mar 14 at 19:46
• @kareenkk it's good practice to use improved methods over what you have originally proposed, if that allows you to answer the underlying scientific question more precisely. You might want to check with those who approved and accepted your research proposal to be sure, but it's hard to imagine that there would be any objection to your using an improved statistical analysis method that you have now learned about.
– EdM
Mar 14 at 20:00
• @kareenkk my suggestion is to use the actual hours spent sitting as a scale-variable predictor in a regression model. For each individual, use the sitting hours as a predictor and the symptom score as the outcome. If the data on actual hours spent sitting aren't still available for the individuals, then your assignment of 1/2/3 values to the groups as in your last comment will respect the ordering from less time to more time in a way that a standard ANOVA wouldn't. Hard to say if that will be better; there might be a peak in symptoms at intermediate sitting times.
– EdM
Mar 14 at 22:03