[R-sig-ME] Obtaining parameter error in a multilevel model
Jarrett Byrnes
jebyrnes at ucdavis.edu
Fri Apr 25 00:48:32 CEST 2008
(sorry for the repost, but I just realized the old version was
scrubbed due to some html when I copied and pasted from my code editor
- apologies!)
Hello, all. I have a question about combining fixed effects with
their random effects in a multilevel model in order to look at the
effects of a treatment at multiple levels. Note, I'm particularly
interested in this so that I can later make comparisons between
different groups. But, let's use the sleep study as an example.
Using lme4 and Gelman's arm library, I can obtain both the fixed
effects and deviations due to their different grouping variables. I
can also obtain the error around my estimate of both the fixed and
random effect. E.g.,
library(arm)
fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy)
#gets fixed effect and the error in it's estimate
fixef(fm1)
se.fixef(fm1)
#gets deviation from fixed effect means and the error in that estimate
ranef(fm1)
se.ranef(fm1)
However, what if I wish to look at, say, the error of the intercept
for each subject? Or the estimate of error around the effect of Days
for each subject? One does not merely add se.fixed and se.ranef to
get an estimate of error around those parameters, right? While this
may not be as big a problem for the sleepstudy data, it becomes more
important for unbalanced data.
It seems like mcmcsamp could be a great solution to that, but,
mcmcsamp does not give estimates of each individual parameter.
Rather, it again also gives estimates of the random effects using
saveb=T. I must admit, however, I am unclear one which random effect
goes with which fixed effect (they're all b.1, b2, etc in the output
of mcmcsamp - can I get some clarification?)
Although, hrm, could one merely add the fixed effect estimates to the
random effect estimates from mcmcsamp to obtain the values for each
parameter value?
Note, I'm trying to use the method presented below for multiple
comparisons with lmer. Any other thoughts would be appreciated.
http://www.stat.columbia.edu/~cook/movabletype/archives/2008/03/why_i_dont_usua_1.html
-Jarrett
----------------------------------------
Jarrett Byrnes
Population Biology Graduate Group, UC Davis
Bodega Marine Lab
707-875-1969
http://www-eve.ucdavis.edu/stachowicz/byrnes.shtml
More information about the R-sig-mixed-models
mailing list