[R] (lme4) p-values for single terms in mixed models involved in sig interactions
Ben Bolker
bbolker at gmail.com
Mon Jul 8 06:19:02 CEST 2013
sarah hoffmann <s.hoffmann85 <at> outlook.com> writes:
> I am using lme4 to fit a mixed effects model to my data. I have a
> significant interaction between two variables. My question is what
> is the correct way to get p-values for single terms involved in that
> interaction. I have been using stepwise backwards deletion and
> model comparisons to get p-values,and refitting the model using a
> REML approach to get estimates.However, presumably to get the p
> values for single terms, I also have to remove the interaction as
> well, and therefore inaccurate. I have confused myself with this
> now, as to whether in this case you should compare a model with the
> interaction and the single term of interest removed to the minimum
> adequate model (in which case the p values are over inflated for the
> single terms), or whether to remove the interaction from the minimum
> adequate model, and then compare this to an updated model, with the
> single term removed.
> This is an example of what the model would look like:
> library(lme4)
> minadequatemodel<-lmer(sq_rate~(day+temp+
> brood_size+weight+weight:brood_size+(1|ident),data=prov,REML=FALSE)
>
> ##to get p values for e.g. temp
> pvalmodtemp<-update(minadequatemodel,~.+temp)
> anova(modelfin,modeltemp)
>
> ###but what's the correct way to get p value for brood_size or weight?
>
> Your help would be greatly appreciated...thanks!
There are a variety of issues involved here, and most of them are
not lme4-related. In fact, you'll have an even bigger problem with
lme4 since by default it doesn't give p-values at all (see
http://glmm.wikidot.com/faq for a description of why not, and some
things you can do about that).
* stepwards backwards deletion is almost always a bad idea
(see e.g. Harrell _Regression Modeling Strategies_ 2001, or google
'"stepwise regression" problems')
* violating marginality (i.e. testing the significance of main effects
in the presence of an interaction containing the main effect) is
almost always a bad idea: e.g. google "Venables exegesis". There are
_very_ occasionally reasons you would want to consider a model with
an interaction term but with one of the main effects missing/removed (e.g.
if you know based on an experimental design that all the treatments
in an experiment start at the same time, you might want to set the
intercepts the same, which would give you (time + treatment:time).
It's hard to specify this case for two categorical variables; you
pretty much have to construct the dummy variables yourself.
Ben Bolker
More information about the R-help
mailing list