Haifeng (Kevin) Xie
2003-Oct-23 16:15 UTC
[R] Variance-covariance matrix for beta hat and b hat from lme
Dear all, Given a LME model (following the notation of Pinheiro and Bates 2000) y_i = X_i*beta + Z_i*b_i + e_i, is it possible to extract the variance-covariance matrix for the estimated beta_i hat and b_i hat from the lme fitted object? The reason for needing this is because I want to have interval prediction on the predicted values (at level = 0:1). The "predict.lme" seems to provide point estimates only. The predicted value for new observation of the i_th subject, with E_i and F_i as regressor matrices for fixed- and random-effects respectively, is y_i hat = E_i * beta hat + F_i * b_i hat which can also be written as y_i hat = [ E_i, F_i ] * [ beta hat ', b_i hat' ]' , where prime denotes transpose. Therefore, the variance of y_i hat is Var(y_i hat) = [ E_i, F_i ] * var( [ beta hat ', b_i hat' ]' ) * [ E_i, F_i ]' , I'm not entire sure if this is the correct way to do, any suggestions will be particularly welcome. Many thanks. Kevin Xie Research Student University of Westminster London, UK
Douglas Bates
2003-Oct-23 16:50 UTC
[R] Variance-covariance matrix for beta hat and b hat from lme
"Haifeng \(Kevin\) Xie" <H.F.Xie at westminster.ac.uk> writes:> Given a LME model (following the notation of Pinheiro and Bates 2000) y_i > = X_i*beta + Z_i*b_i + e_i, is it possible to extract the > variance-covariance matrix for the estimated beta_i hat and b_i hat from the > lme fitted object?Not easily. The pieces that you need are in the condensed linear model structure and you may be able to extract them in R code but I have not written any code to do that. I am revising the internal representation of lme objects using S4 classes. Saikat DebRoy and I have one representation in the lme4 package but will probably revise that. Some recent work on computational methods http://www.stat.wisc.edu/~bates/reports/MixedComp.pdf has me convinced that even this representation should be reorganized and simplified. If you really want to delve into the old structures I can give you some pointers (pun unintended) on where to look but beware that it's a quagmire. (Oops - not supposed to use that word in e-mail originating in the U.S.A. My regards to the NSA.) -- Douglas Bates bates at stat.wisc.edu Statistics Department 608/262-2598 University of Wisconsin - Madison http://www.stat.wisc.edu/~bates/