0

Here is my data frame:

rearing.temp<-c("15", "15", "15", "15", "15", "15", "15", "15", "19", "19", "19", "19", "19", "19", "19", "19")
source<-c("field", "field", "woods", "woods", "field", "field", "woods", "woods", "field", "field", "woods", "woods", "field", "field", "woods", "woods")
runway.temp<-c("40","20","40","20","40","20","40","20","40","20","40","20","40","20","40","20")
velocity<-c("2.3", "2.1", "1.9", "1.9", "2.3", "2.2", "2.3", "2.0", "1.1", "1.3", "3.2", "2.0", "2.0", "2.4", "2.2", "3.0")
snail<-data.frame(rearing.temp, source, runway.temp, velocity)

Here is my model:

mod <- lm(velocity ~ runway.temp*source*rearing.temp, data=snail)

When I do an emmeans contrast:

emmeans(mod, pairwise~runway.temp*source*rearing.temp)

I get 28 different comparisons, but I am only interested in looking at the difference between the velocity of field snails reared at 15° tested at the 40° runway temperature compared to woods snails reared at 15° tested at the 40° runway temperature. I just want to do one comparison between the snails that are both reared at the same temp, are tested at the same temp, but are sourced from different habitats. Plus, when I do all 28 comparisons it's robbing statistical power and almost everything non-signficant. How can I do a specific pairwise comparison without subsetting?

Thank you,

Ricardo

  • *" it's robbing statistical power and almost everything non-signficant"* No, no, no! ;-) Manually choosing only one comparison and ignoring all the others is what's statistically unsound (and is what's often referred to as "p-value" fishing, the garden of forking paths, etc.). You don't get to pick and choose the one comparison. You need to do all comparisons (and correct for multiple hypothesis testing, which is what `emmeans` already does)! – Maurits Evers Jan 17 '21 at 22:25
  • I think this is more of a statistics than a coding question. You're fitting a linear model with a three-way interaction term to a very small data set. The reason why "almost everything [is] non-significant" is because there is just not enough data to obtain meaningful estimates. You can see that when you look at the coefficient estimates and their standard errors which are all larger than the estimates themselves (the only exception being the intercept). – Maurits Evers Jan 17 '21 at 22:42
  • By the way, your title says "nested factor levels" but you're not actually fitting a nested model; you're fitting a simple linear model with a three-way interaction. – Maurits Evers Jan 17 '21 at 22:45
  • I just noticed that you asked the *exact same question* in December. Please don't double-post. Instead improve the quality of your original question by editing the post. This will also "bump" the question. Closing this question as a dupe. – Maurits Evers Jan 17 '21 at 22:53

0 Answers0