r - lsmeans and difflsmeans return no output for lmer object -
i'm trying calculate confidence intervals fixed effects in lmer mixed model, , difflsmeans , lsmeans return empty table. i've tried lme() having trouble model convergence (hence using lmer).
the data (where bout dependent level 1 variable , twaverage independent level 2 variable of interest , sex, location , ra further nesting levels):
id bout twaverage sex location ra 1 17 3.748333333 1 big society 1337 1 59 3.748333333 1 big society 1337 1 14 3.748333333 1 big society 1337 1 9 3.748333333 1 big society 1337 1 9 3.748333333 1 big society 1337 1 14 3.748333333 1 big society 1337 1 21 3.748333333 1 big society 1337 2 40 3.055833333 0 big society 1337 2 63 3.055833333 0 big society 1337 2 7 3.055833333 0 big society 1337 2 75 3.055833333 0 big society 1337 2 13 3.055833333 0 big society 1337 2 3 3.055833333 0 big society 1337 2 16 3.055833333 0 big society 1337 3 103 3.696666667 1 big society 1337 3 14 3.696666667 1 big society 1337 3 2 3.696666667 1 big society 1337 3 32 3.696666667 1 big society 1337
my model specification looks this:
groupsizerandom = lmer(bout ~ twaverage + (twaverage|id), data, reml = f)
i'm calling lsmeans (which understand should give me confidence intervals fixed effects in model):
lsmeans(groupsizerandom,test.effs = null)
however, returns empty table (with no values):
least squares means table: estimate standard error df t-value lower ci upper ci p-value
anyone know why? or how calculate cis model i've specified above?
there few issues here.
- if want confidence intervals of fixed-effect parameters, can likelihood profile cis via
confint(groupsizerandom)
or wald cis viaconfint(groupsizerandom,method="wald")
(see?confint.mermod
). - as pointed out in comments, there 2
lsmeans
functionslmertest::lsmeans
report lsmeansfactor
variables. pointed out in comments, "factor" has specific meaning in r - means categorical predictor (independent) variable.twaverage
continuous predictor, in r terms it's not "factor".lsmeans::lsmeans
give ask if uselsmeans(groupsizerandom,spec="twaverage")
...
Comments
Post a Comment