Learn R Programming

lcmm (version 2.2.2)

predictCor: Prediction of the Brownian motion or the autoregressive correlation

Description

The function computes the predicted values of the BM or AR correlation given observed data provided in input.

Usage

predictCor(model, newdata, predtimes)

Value

a matrix containing the predicted correlation in each latent class

Arguments

model

an object inheriting from class hlme, lcmm, Jointlcmm or multlcmm representing a general latent class mixed model.

newdata

data frame containing the data from which predictions are to be computed. The data frame should include at least all the covariates listed in model$Xnames2, and the marker(s) values. Names should match exactly the names of the variables in the model.

predtimes

numeric vector containing the prediction times

Author

Viviane Philipps, Cecile Proust-Lima

Examples

Run this code
if (FALSE) {
 m <- hlme(fixed = Y ~ Time, mixture = ~1, random = ~1, subject = "ID",
  ng = 2, cor = BM(Time), data = data_hlme, B = c(0,20,30,-1,5,2,0.1))
 predictCor(m, newdata = data_hlme[1:3, ], predtimes = seq(0, 5, 0.5))
}

Run the code above in your browser using DataLab