Tell me more ×
Cross Validated is a question and answer site for statisticians, data analysts, data miners and data visualization experts. It's 100% free, no registration required.

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

share|improve this question
2  
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. – Michael Chernick Jul 9 '12 at 9:38
@ 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? – quekles Jul 10 '12 at 3:05

2 Answers

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.

share|improve this answer
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... – quekles Jul 10 '12 at 22:39

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.