3
$\begingroup$

I'm using lmer to analyse my data, building nested models and using anova() to compare them against each other in an incremental way. Now, I know enough to only test a single term at a time (i.e. only one term changes between model 1 and model 2, so that when I compare them with anova I know what question I am answering), my question rather relates to the order in which you should test your terms of interest.

Is there a preference or a rule that states whether you should fit your fixed effect terms before your random effect terms? If so, what is the reason?

Thanks all very much

$\endgroup$
2
  • 3
    $\begingroup$ If you introduce a random effect I would think it would be a variable that you would automatically be include or else why make it random? I also don't see why you would not have any variables that you are sure you need to include. $\endgroup$ Jul 9, 2012 at 9:38
  • $\begingroup$ @ Michael - Yes this is a good point. It makes sense to begin building your model with the terms you are certain you want to include. So, if i'm certain I'll want to include Subject as a random term, I should fit this term first? $\endgroup$
    – quekles
    Jul 10, 2012 at 3:05

2 Answers 2

1
$\begingroup$

I found Field et al. 'Discovering statistics using R' had a helpful, simple walkthrough for running Multilevel Model (MLM) analyses in R.

1) Run a model with dv and just the intercept e.g. dv~1 (you can use gls for this). 2) Run a model as above including Subject as the random factor (using lme or lmer). 3) Compare the intercept only model with the model with 'Subject' as the random factor (you can use anova() for this) - this will tell you if there is a need to conduct MLM, that is if there is a benefit of including 'Subject' as a random factor. If so, MLM might be worthwhile and so you can proceed, if not just do a plain regression/ ANOVA. 4) Start adding predictors to the model one by one (keeping 'Subject' as a random factor) and comparing the model with each addition.

Not sure whether this answers your question as I am relatively new to Multilevel modelling, but thought I would post anyway. Hope this helps a little.

$\endgroup$
1
  • $\begingroup$ That does help, thank you. Your outline is essentially the protocol I've been following - however Zuur et al. 'Mixed Effects Models and Extensions in Ecology with R' (2009) seem to recommend fitting all fixed effects first, so that you avoid a scenario where "part of the information that we want to have in the fixed effects ended up in the random effects". This has me puzzling... $\endgroup$
    – quekles
    Jul 10, 2012 at 22:39
1
$\begingroup$

There is a paper by Prof Judith Singer which describes by example using a similar approach. She uses SAS instead of R but the output is the same and you will be able to get a feel for how she built a model up, sequentially including random effects and then fixed effects. If I recall correctly, some of the random effects at the higher level became less important after including group level covariates in her model.

http://www.biostat.jhsph.edu/~fdominic/teaching/ML/sasprocmixed.pdf

$\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.