[R-sig-ME] p-value for fixed factor in lmer
Henrik Singmann
henrik.singmann at psychologie.uni-freiburg.de
Thu May 16 13:56:15 CEST 2013
Alternatives to the options mentioned:
- function mixed() in package afex (disclaimer: I am the author of said package)
modelA <- mixed(percentV ~ tempo + (1|speaker) + (1|sentence),data=bt.data)
- anova(..., test = "F") in package car (author is John Fox):
modelA <- lmer(percentV ~ tempo + (1|speaker) + (1|sentence),data=bt.data)
anova(modelA, test = "F")
Both use KRmodcomp from pbkrtest to obtain p-values (which was mentioned by Tom Philippi) and should return the exact same values.
Benefit over pvals.fnc is that the random effects can include random slopes!
Cheers,
Henrik
Am 16/05/2013 00:03, schrieb Volker Dellwo:
> Dear Mixed Model users,
>
> below is an lmer function for which I calculated p-values with pvals.fnc. In the output I receive five p-values for the fixed factor 'tempo', one for each level. What I would want, however, is a p-value for the entire factor which I can't manage....
>
> Many thanks for any suggestions!
>
> Best wishes,
> Volker
>
>
> MODEL:
>> modelA <- lmer(percentV ~ tempo + (1|speaker) + (1|sentence),data=bt.data)
> > print(pvals.fnc(modelA))
>
> OUTPUT:
>
> $fixed
> Estimate MCMCmean HPD95lower HPD95upper pMCMC Pr(>|t|)
> (Intercept) 42.7346 42.7392 40.2256 45.1771 0.0001 0.0000
> tempo2 -0.1815 -0.1822 -1.0326 0.7087 0.6728 0.6737
> tempo3 0.7979 0.8023 -0.0953 1.6719 0.0768 0.0645
> tempo4 1.1526 1.1504 0.2812 2.0028 0.0088 0.0077
> tempo5 1.2742 1.2740 0.4183 2.1488 0.0042 0.0032
>
> $random
> Groups Name Std.Dev. MCMCmedian MCMCmean HPD95lower HPD95upper
> 1 speaker (Intercept) 3.4334 2.3338 2.3684 1.7773 3.0468
> 2 sentence (Intercept) 3.6911 2.5546 2.6462 1.6115 3.7921
> 3 Residual 3.1209 3.1974 3.2010 3.0061 3.4117
>
--
Dipl. Psych. Henrik Singmann
PhD Student
Albert-Ludwigs-Universität Freiburg, Germany
http://www.psychologie.uni-freiburg.de/Members/singmann
More information about the R-sig-mixed-models
mailing list