I’ve estimated confidence intervals for intercepts for each group in a dataset like this:
d <- data.frame(
g=sample(letters[1:5], 100, replace=TRUE),
y=runif(100)
)
library(lme4)
fm <- lmList(y ~ 1 | g, data=d)
ci.fm <- confint(fm)
ci.fm
# An object of class "lmList.confint"
# , , (Intercept)
#
# 2.5 % 97.5 %
# a 0.4253236 0.6668585
# b 0.4860047 0.6794625
# c 0.4071186 0.6822713
# d 0.2785848 0.5992378
# e 0.4110070 0.6890399
There must be a way to then index each of the columns separately, but I can’t figure it out. I’ve tried looking at str(ci.fm) and attributes(ci.fm) and attempted things like attr(ci.fm, dimnames[[2]]$"2.5 %") among other similar things, all of which didn’t work. I’d be grateful for a pointer in the right direction. Thanks.
It is an S4 object: you can have the list of “slots” with
slotNames,and access them with
@(instead of$).In this case, the only slot is
.Data, with a leading dot,so
ci.fm@.Datacontains the actual data.