datacold {cold}R Documentation

Data

Description

This example is an artificial data.

Usage

data(datacold)

Format

A data frame with 390 observations on the following 4 variables.

Subject

identifies de number of the individual profile. This vector contains observations of 30 individual profiles.

Treatment

a factor with levels 0 and 1.

Time

a numeric vector that identifies the number of the time points observed.

z

a numeric vector representing the response variable.

Examples

data(datacold)

mod0<- cold(z~Time*Treatment, data=datacold, time="Time", 
id="Subject", aggregate=Treatment, dependence="ind")
summary (mod0)

modI<- cold(z~Time*Treatment, data=datacold, time="Time", 
id="Subject", aggregate=Treatment, dependence="AR1")
summary (modI)

anova(mod0,modI)

plot(modI,which=1,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", aggregate=Treatment, dependence="indR")
summary(mod0R)

### independent with random intercept (dependence="indR") 
### using cubature (integration = "cubature")

mod0R.C<- cold(z~Time*Treatment, random=~1,data=datacold, time="Time", 
id="Subject", aggregate=Treatment, dependence="indR",
integration = "cubature")
summary(mod0R.C)

randeff(mod0R.C)




### dependence="indR2" 
## It takes a long time to run
 
## Using Monte Carlo method (integration="MC")
mod0R2MC<-cold(z~Time*Treatment, random = ~ 1 + Time, data=datacold, 
time="Time", id="Subject", dependence="indR2", integration="MC", 
M=8000, trace=TRUE)

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", 
trace=TRUE)
summary (mod0R2C)



[Package cold version 2.0-0 Index]