'Standard error of estimated marginal means with unequal variance assumption

I've run a repeated measure anova and got at the point where I have to calculate the estimated marginal means. I have two versions of the same dataset but for this purpose I'm using the long format one. Here is my code:

df <- data.frame(Time = c(rep("E1", 20), rep("E2", 20), rep("E3", 20), rep("E4", 20)),
           Extension = c(60, 52, 56, 52, 68, 80, 84, 64, 72, 56, 52, 64, 68, 64, 60, 76, 80, 76, 68, 64, 68, 60, 64, 60, 68, 80, 88, 68, 76, 60, 60, 72, 76, 72, 60, 80, 80, 80, 80, 68, 68, 68, 72, 72, 72, 80, 88, 72, 88, 68, 68, 76, 84, 80, 68, 84, 84, 80, 80, 68, 68, 76, 73, 85, 74, 82, 86, 71, 86, 71, 69, 78, 88, 85, 79, 86, 87, 85, 80, 81),
           Extension_fct = as.factor(c(rep("E1", 20), rep("E2", 20), rep("E3", 20), rep("E4", 20))))

mod <- lm(Extension ~ Extension_fct, data = df)
emmeans::emmeans(mod, pairwise ~ Extension_fct)

The problem is that the model I'm using assume the equal variance, and therefore all the standard errors across the four levels are the same. Is it possible to adjust it in order to get separated standard errors? If not, how can I calculate them by hand?

r


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source