Kruskal Wallis Test with Random Effect? I am trying to analyse the effect of season (autumn or summer) on frog sperm cell concentration (continuous, expressed as cells/ml). Because I don't know if there is an effect of male variation I want to run a model with a random effect. My data is not normally distributed, and the residuals are not random.



I think I need to run a Kruskal Wallis Test with a random effect, but cannot find the solution anywhere. Please help.
We originally had:
m1 <- lmer(cellsml ~ Season + (1 | male), data=data2, na.action=na.omit)
Can run:
kruskal.test(cellsml~Season, data=data2)
but cannot run:
kruskal.test(cellsml~Season + (1|male), data=data2)
Any ideas??? Thank you in advance!

For these particular data, the structure isn't clear to me. I suspect that there are multiple observations over time within each frog in each season.  That may require addressing this structure in the model.
Depending on the structure, aligned ranks transformation anova may be an appropriate nonparametric test.  In good implementations, it can handle random effects, and has methods for post-hoc tests.
It also may be the case a simple transformation of the dependent variable or an appropriate generalized linear model would be appropriate.
