2

I am investigating a significant 3-way interaction and I am not sure I am using emmeans correctly. When I pass the model to emmeans with type =response it says it is back-transformed but when I then pass that to pairs it says it is still on the log scale.

fit <- nlme::lme(log(Abundance) ~ Time * Group * Drug, random = ~ 1 | Sample.ID, method = "REML", data = data)

emm <- emmeans(fit, ~ Time * Group * Drug, type='response') ... Degrees-of-freedom method: containment Confidence level used: 0.95 Intervals are back-transformed from the log scale

pairwise_comparisons <- pairs(emm, adjust ="Tukey") ... Degrees-of-freedom method: containment P value adjustment: tukey method for comparing a family of 8 estimates Tests are performed on the log scale

Edit: formating

DS14
  • 95
  • You'll notice it says tests are performed in the log scale, which is appropriate - that's where you assumed the normally distributed error on the response in your model. – PBulls Feb 23 '24 at 20:38

1 Answers1

1

Everything is correct! It just lets you know that the significance tests were performed on the log scale as it should be.

As a side note: you maybe also want to look into a generalized linear mixed effects models, and instead of log-transforming your response variable, you log- transform the expected value or mean response via a link function (see here: Linear model with log-transformed response vs. generalized linear model with log link).

I am guessing abundance is positive continuous and right-skweded which is why you chose a log transformation?

Stefan
  • 6,431