> On 3 Mar 2017, at 20:55, Dan Mirman <d...@danmirman.org
> <mailto:d...@danmirman.org>> wrote:
>
> I think "lsmeans" package can also do this,
And will give virtually identical results (here, with adjusted covariance
calculations disabled):
library(lmeans)
library(effects)
library(languageR)
> m <- lmer(RTlexdec ~ WordCategory*AgeSubject + (1|Word), english)
> as.data.frame(effect("WordCategory:AgeSubject", m))
WordCategory AgeSubject fit se lower upper
1 N old 6.664176 0.002820814 6.658646 6.669706
2 V old 6.656649 0.003619112 6.649554 6.663744
3 N young 6.443781 0.002820814 6.438251 6.449311
4 V young 6.432612 0.003619112 6.425517 6.439708
> eng.lsm <- lsmeans(m, "WordCategory", by="AgeSubject")
> eng.lsm
AgeSubject = old:
WordCategory lsmean SE df asymp.LCL asymp.UCL
N 6.664176 0.002820814 NA 6.658647 6.669704
V 6.656649 0.003619112 NA 6.649556 6.663742
AgeSubject = young:
WordCategory lsmean SE df asymp.LCL asymp.UCL
N 6.443781 0.002820814 NA 6.438252 6.449310
V 6.432612 0.003619112 NA 6.425519 6.439706
Confidence level used: 0.95
Behind the scenes, lsmeans relies the PBmodcomp function from the pbkrtest
package, which uses parametric bootstrap. cf. Jan’s roll-your-own method:
> cells
AgeSubject WordCategory Prediction LoCI HiCI
1 old N 6.664176 6.659008 6.669882
2 young N 6.443781 6.438246 6.449022
3 old V 6.656649 6.649747 6.663679
4 young V 6.432612 6.425705 6.439766
James
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.