# NOT RUN {
data(datacold)
mod0<- cold(z~Time*Treatment, data=datacold, time="Time",
id="Subject", dependence="ind")
summary (mod0)
modI<- cold(z~Time*Treatment, data=datacold, time="Time",
id="Subject", dependence="AR1")
summary (modI)
anova(mod0,modI)
plot(modI,which=1,factor=Treatment,xlab="Time (weeks)",
ylab="Count", main="Model AR1")
### independent with random intercept
mod0R <- cold(z ~ Time * Treatment, random = ~ 1, data = datacold,
time = "Time", id = "Subject", dependence = "indR")
summary(mod0R)
### independent with random intercept (dependence="indR")
### using cubature (integration = "cubature")
# }
# NOT RUN {
mod0R.C <- cold(z ~ Time * Treatment, random = ~ 1, data = datacold,
time = "Time", id = "Subject", dependence = "indR", integration = "cubature")
summary(mod0R.C)
randeff(mod0R.C)
# }
# NOT RUN {
### dependence="indR2"
## It takes a long time to run
# }
# NOT RUN {
## Using Monte Carlo method (integration = "MC")
mod0R2MC <- cold(z ~ Time * Treatment, ~ 1 + Time, datacold, time = "Time",
id = "Subject", dependence = "indR2", integration = "MC")
summary (mod0R2MC)
randeff(mod0R2MC)
## Using cubature (integration = "cubature")
mod0R2C<-cold(z ~ Time * Treatment, random = ~ 1 + Time, data = datacold,
time = "Time", id = "Subject", dependence = "indR2", integration = "cubature")
summary (mod0R2C)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab