Dear all,
I am new to R and would like to seek your advice on a project I am
doing.
I am analyzing some administrative data to learn about how each county
in IL stand with each other in the number of children placed in public
foster care in a year. For each county, we have the children placed in
foster care (fp), its total child population (childn), and a bunch of
county-level attributes from the census data.
I decided to adopt the poisson model under the lme4 package in R to run
a mixed effect poisson model. Here is the syntax I use:
fit2=lmer(fp~1+offset(log(childn))+(1|county),family=poisson,data=ildata,reml=TRUE)
Here are the results:
fit2
Generalized linear mixed model fit by the Laplace approximation
Formula: fp ~ offset(log(childn)) + (1 | county)
Data: ildata
AIC BIC logLik deviance
334.1 339.3 -165 330.1
Random effects:
Groups Name Variance Std.Dev.
county (Intercept) 0.53857 0.73388
Number of obs: 101, groups: county, 101
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -6.25386 0.07988 -78.29 <2e-16 ***
--- Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1
To get the predicted result for each county, I need to get the random
effect (residuals) for each county as well as their variances. However,
the ranef command only produce the random effect without giving the
confidence interval / variance. I would be glad if you can let me know
how to produce the confidence interval of these random effects so I can
calculate their confidence intervals.
ranef(fit2)
$county
(Intercept)
4001 0.612613842
4003 0.066916182
4005 1.293875058
My last question is whether the random residuals generated in R are
empirically bayesian estimates, as in HLM.
Thanks a lot ,
Lijun
Lijun Chen
Senior Research Specialist
Chapin Hall at the University of Chicago
1313 E. 60th St., Chicago, IL 60637
V: 773-256-5140 F: 773-256-5340
http://www.chapinhall.org