datacold {cold} R Documentation

## Data

### Description

This example is an artificial data.

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", 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")

mod0R.C <- cold(z ~ Time * Treatment, random = ~ 1, data = datacold,
time = "Time", id = "Subject", 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, ~ 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)

[Package cold version 2.0-3 Index]