S News List –
I am aware of how to extract the coefficients by group for a
linear mixed effects model (e.g., coef (lme.model),
but I can’t quite figure out how to get the sample size for each group.
Any suggestions?
To give an example, suppose you have a dataset with 1000
individuals belonging to one of 10 groups. You create a lme model.
# create data
x <- rnorm(1000)
y <- .5*x+rnorm(1000)
g <- rep(1:10,100)
data <- cbind(x,y,g)
data <- data.frame(data)
#create a linear mixed effects model
tmod <- lme(y~x,random=~1|g,data="">
# extracts coefficients for each group
coef(tmod)
# How do you get the sample size per group? In this example,
the sample size is balanced by design, but what about real data where the group
sizes are not balanced?
Thanks
Tom
-------------------------------------------------
University of Missouri - St.
Louis
-------------------------------------------------