[R] lme - Confidence interval for predicted values

Urs Wiedemann wiedemann at fmp-berlin.de
Tue Apr 27 08:43:53 CEST 2004


After having fit (using lme) a mixed effects model with a single
random effect, I like to estimate the confidence interval for the
predicted mean expectations.
To my knowledge this is usually done (for fixed effects models) by
calculating:

cibandwidth <- sqrt(diag(Xnew %*% solve(t(X) %*% X) t(Xnew))) *
qt((1-level)/2, DF)

The CI is then the predicted value +/- cibandwidth. This is what
predict.lm provides with ci.fit if I am not wrong.

So for lme there is a very nice post on the S-news list:
http://www.biostat.wustl.edu/archives/html/s-news/2003-09/msg00021.html

Hopefully I quote the message correctly:
>var(y.hat) = X2 %*% inverse(t(X)%*%inverse(Sig)%*%X) %*% t(X2)
>
>The hard part for lme is deciding what goes in X and what is Sig:
>If you want a confidence interval on y for a particular subject
>included in X, then that subject is part of X; otherwise,
>it must be included in Sig.

My question is now where to obtain "Sig" from lme. Probably this is
obvious and I simply overlooked it.
Thus, I would be very grateful if anyone could help me in this matter.

Thanks Urs
______________________________________________________________________

Urs Wiedemann
Forschungsinstitut fuer Molekulare Pharmakologie (FMP)
Abteilung NMR-unterstuetzte Strukturforschung
Campus Berlin-Buch
Robert-Roessle-Str. 10
D-13125 Berlin

Tel.  +49 (30) 94 793-278
Fax   +49 (30) 94 793-169
email wiedemann at fmp-berlin.de
www   www.fmp-berlin.de




More information about the R-help mailing list