prediction (with standard error) from lme

By Samiha Sarwat posted 11-07-2012 23:43

  
I would like to use R to get a prediction (with standard error) from a mixed model .

I fit the model as below
fit.drug <- lme(yprime ~ -1 + X.drug , 
             random = list (Id=pdIdent(~Z.drug-1)),control=lmeControl(opt="optim"))
      

fitted(fit.drug) only gives the fitted value for population and subject level.

now how to get fitted value and their SE or CI for Y-hat (any specific value, say median of Y) from mixed model as above?

1 comment
84 views

Permalink

Comments

02-18-2022 04:02

Hey Samiha,

I am not an expert, but i would think you should be able to calculate the variance of Y_hat (you can find formulas in the textbooks), and from that - get the SE. I think there is an easy solution to your question.

Also, check out the website CrossValidated. There are many discussions of this  kind and often, someone already asked the same questions as yours before.

Good luck!