# What test to use when the dependent variable is an integer but independent variable is categorical? (Data non-normal, unequal variances)

My independent variable is species (categorical).

My dependent variable is the total mass of what each species ate (in grams, numerical).

I want to test the difference in mass values between species.

My data are non-normal, so I initially thought I should run a Kruskal-Wallis test. However, after reading about Kruskal-Wallis tests here, I realized that I shouldn't because I have unequal variances. The above link suggests a Welch's t-test when you don't have equal variances, but I have categorical data for my independent variable so I can't do that.

I have four species, with sample sizes of 20, 20, 30 and 30.

Any suggestions would be appreciated.

• Welch's ANOVA would work on your data, but it also assumes normality. Please edit your post to include the variances for each species, and histograms for each species – Robert Long Feb 1 at 8:51
• You don't require identical spread in the data for a Kruskal-Wallis (many books say so, but its not necessary). You require identical spread under the null (for exchangeability), but the alternative can be considerably more general without harming the behavior of the test. Consider, for example, if you had data from a collection of lognormal distributions with common shape parameter ($\sigma$), but potentially differing scales. Then the Kruskal-Wallis statistic is the same whether you work on the original scale or on the log-scale (now with constant spread across the groups, ... ctd – Glen_b -Reinstate Monica Feb 1 at 23:53
• ctd ... but potentially differing location) It would work as well for any other strictly monotonic increasing transformation (leaving the pattern of ranks unaltered). There are somewhat more general choices (than a class of alternatives which possess some monotonic transformation to constant spreads) which make sense with the test. You can choose to impose a stronger assumption such as a pure-location-shift alternative (for example, if you want to start estimating between-group location differences) but it's not inherently part of the test. – Glen_b -Reinstate Monica Feb 1 at 23:57
• In this case, "mass of food eaten" may tend to have spread that increases with increasing mean, but the assumption of identical distributions (including equal spread) under the null may be perfectly tenable (you can't assess it from the data, since you don't know that the null is true). – Glen_b -Reinstate Monica Feb 2 at 0:00