Dear all,

On the FAQ page of http://glmm.wikidot.com/faq, Ben Bolker gives a nice 
example of how to get predictions and/or confidence (or prediction) 
intervals on predictions from the following model for lme:
fm1 <- lme(distance ~ age*Sex, random = ~ 1 + age | Subject, data = 
Orthodont)
and for lmer
fm1 = lmer(formula = distance ~ age*Sex + (age|Subject), data = Orthodont,)|

|In this example, to calculate the predictions and confidence intervals, 
the variable age is sort of considered as categorical, 
age=c(8,10,12,14), and therefore the coefficients reported are the means 
with their SE.
However, the fixef(fm1) output of the model shows that age is a 
continuous variable and therefore the output
(Intercept)         age     SexMale age:SexMale
     17.3727      0.4795     -1.0321      0.3048
reports the intercept of Female (Intercept), the slope of Female (age), 
the difference in the intercept for Male (SexMale) and the difference in 
slope for Male (age:SexMale). The intercept and slope for Male have to 
be calculated, the intercept is then 17.3727+(-1.0321)=16.3406 and the 
slope is then 0.4795+0.3048=0.7843.

Here is my question. In the same fashion as the means are calculated 
with the model.matrix
newdat <- expand.grid(age=c(8,10,12,14),Sex=c("Male","Female"),distance = 0)
mm = model.matrix(terms(fm1),newdat)
newdat$distance = mm %*% fixef(fm1)
Is it possible to directly calculate the slopes and intercepts from this 
model? I am of course talking about the estimates of each of the slope 
and intercept for each gender (male and female). So with the calculation 
from the fixef(lm1) output.

Thanks in advance,
Yann

	[[alternative HTML version deleted]]

