0
$\begingroup$

I have read this paper about fitting ANOVA models as multilevel models:

https://projecteuclid.org/euclid.aos/1112967698

After reading it, I was trying to figure out how I could fit a basic ANOVA model with only 1 predictor as a multilevel model in R. However, I couldn't seem to get the same results. Here's a an example I tried to reproduce:

https://www.r-bloggers.com/one-way-analysis-of-variance-anova/

First, prep the data:

#Data
plant.df = PlantGrowth
# Factor
plant.df$group = factor(plant.df$group,
                    labels = c("Control", "Treatment 1", "Treatment 2")) 

Second, fit ANOVA models in two different ways to make sure I get the same results:

# Method 1 -----------------------------------
# Make mod
plant.mod1 = lm(weight ~ group, data = plant.df)
# Anova of mod
anova(plant.mod1) # p ~ .02

# Method 2 -----------------------------------
# Make mod
plant.mod2 = lm(weight ~ 1, data = plant.df)
# Anova of mod
anova(plant.mod1,plant.mod2) # p ~ .02

Now fit a multilevel model in R and test if significant random effect (i.e., difference across group means):

 # Method 3 -----------------------------------
 # load lme4
 require(lme4)
 require(lmerTest)
 # Make mod
 plant.mod3 = lmer(weight ~ (1|group), data = plant.df,REML=F)
 rand(plant.mod3) # p ~ .06

For some reason I'm not getting the same p-values. However, my understanding was that multilevel models should yield the same results. Is there same way to get the identical p-values from the third method as I found with the first two methods?

UPDATE: Perhaps the larger p-values occurs in Method 3 because of shrinkage?

$\endgroup$
  • 1
    $\begingroup$ I think the issue is that these data are not multilevel (e.g., there is no clustering or repeated measurement). This is a simple fixed effects model. You could estimate it with ANOVA or simple OLS regression and get the same results. Also, I'm not sure why you are doing Method 2 above. It is simply reproducing the p-value for the single main effect of model 1. $\endgroup$ – dbwilson Feb 24 '18 at 13:59
  • $\begingroup$ I don't think that's the issue - the examples in the paper aren't "multilevel" per se (unless the paper is not correct). Method 3 just allows there to be group specific means (which is basically the idea of ANOVA, no?). I did Method 2 just to prove to myself that I could get the same results in different ways. $\endgroup$ – user166625 Feb 24 '18 at 14:05
  • 1
    $\begingroup$ But in model 1 there is no random effect. If you specify the fixed effect of group (model 1) as a random effect, it will not agree with model 1 because you are estimating something different. Your second link is simply a fixed-effects one-way ANOVA. $\endgroup$ – dbwilson Feb 24 '18 at 15:09
  • $\begingroup$ You might be more successful working from a repeated measures ANOVA model with a fixed treatment effect (e.g., two or three measurement time points with two groups, treatment and control). These can be estimated via both ANOVA and mixed effects regression modeling. $\endgroup$ – dbwilson Feb 24 '18 at 15:10
  • 1
    $\begingroup$ The larger p-value in method 3 is because it is a random effect whereas in method 1 it is a fixed effect. $\endgroup$ – dbwilson Feb 25 '18 at 17:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.