I installed the model using nlme() from package nlme .
Now I want to model some prediction intervals, taking into account the uncertainty of the parameter.
To this end, I need to extract the variance matrix for fixed effects.
As far as I know, there are two ways to do this:
vcov(fit)
and
summary(fit)$varFix
These two give the same matrix.
However, if I check
diag(vcov(fit))^.5
this does NOT match the reported std error in summary(fit)
Am I really mistaken that these two are the same?
Edit: Here is sample code
require(nlme) f=expression(exp(-a*t)) a=c(.5,1.5) pts=seq(0,4,by=.1) sim1=function(t) eval(f,list(a=a[1],t))+rnorm(1)*.1 y1=sapply(pts,sim1) sim2=function(t) eval(f,list(a=a[2],t))+rnorm(1)*.1 y2=sapply(pts,sim2) y=c(y1,y2) t=c(pts,pts) batch=factor(rep(1:2,82)) d=data.frame(t,y,batch) nlmeFit=nlme(y~exp(-a*t), fixed=a~1, random=a~1|batch, start=c(a=1), data=d ) vcov(nlmeFit) summary(nlmeFit)$varFix vcov(nlmeFit)^.5 summary(nlmeFit)
source share