Learn R Programming

gppm (version 0.3.0)

plot.GPPMPred: Plotting predictions

Description

Plots person-specific predictions

Usage

# S3 method for GPPMPred
plot(x, plotId, ...)

Value

A plot visualizing the predictive distribution. The bold line describes the mean and the shaded area the 95\

Arguments

x

object of class GPPMPred as obtained by predict.GPPM

plotId

character string or integer. ID of the person for which the predictions should be plotted

...

additional arguments (currently not used).

Examples

Run this code
# \donttest{
data("demoLGCM")
# remove all measurements from person 1 and the first form person 2
predIdx <- c(which(demoLGCM$ID == 1), which(demoLGCM$ID == 2)[1])
fitDemoLGCM <- demoLGCM[setdiff(1:nrow(demoLGCM), predIdx), ]

lgcm <- gppm(
  "muI+muS*t", "varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma",
  fitDemoLGCM, "ID", "y"
)
lgcm <- fit(lgcm)
predRes <- predict(lgcm, demoLGCM[predIdx, ])
plot(predRes, 1)
# }

Run the code above in your browser using DataLab