3
$\begingroup$

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. enter image description here enter image description here enter image description here

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)

We can run this function:

kruskal.test(cellsml~Season, data=data2)

But we cannot run this function:

kruskal.test(cellsml~Season + (1|male), data=data2)

Any ideas? Thank you in advance!

$\endgroup$
1
  • 3
    $\begingroup$ Observations seem to be a time series with dependence between adjacent observations. This means that assumptions of neither a standard model with random effect nor Kruskal-Wallis are fulfilled. I suggest you have a look at time series models and handling of outliers in time series. $\endgroup$ Commented Jun 1, 2022 at 9:09

2 Answers 2

3
$\begingroup$

Apart from what Christian said in the comments:

  • In a linear mixed model, you have 2 errors, the residual error and the random effect. In lme4, you can extract the residual error via residuals(model), and the RE via ranef(model).

  • In principle, both should be normally distributed. If you are not happy with a visual assessment, the normal way would be to use a Shapiro-Wilk test, not a Kruskal-Wallis test.

$\endgroup$
1
$\begingroup$

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.

$\endgroup$

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.