# Model for full data set
data(qol)
mod.fulldata <- nlme::gls(QoL~(Weeks-1)+(Weeks-1):Treat, data=qol,
correlation=nlme::corSymm(form=~1|Subject),
weights=nlme::varIdent(form =~1|Weeks), method="ML")
summary(mod.fulldata)
# Use data available at day 150
data.interim1 <- qol[qol$Day<=150,]
mod.interim1 <- nlme::gls(QoL~(Weeks-1)+(Weeks-1):Treat, data=data.interim1,
correlation=nlme::corSymm(form=~1|Subject),
weights=nlme::varIdent(form=~1|Weeks), method="ML")
summary(mod.interim1)
# Use glsFit
gsearlyFit(qol, datanames=c("Subject","Weeks","STime","Treat","QoL"))
# vbeta
vcov(mod.fulldata)[6,6]
# beta
coef(mod.fulldata)[6]
Run the code above in your browser using DataLab