predict.GPPM: GPPM predictions

Description Usage Arguments Value Examples

Description

Obtain person-specific predictions.

Usage

1
2
## S3 method for class 'GPPM'
predict(object, newData, ...)

Arguments

object

object of class GPPM. Must be fitted, that is, a result from fit.GPPM.

newData

a data frame with the same column names as the data frame used for generating gpModel with gppm. May only contain new data, that is, data that was not used for fitting.

...

additional arguments (currently not used).

Value

Predictions of the dependent variable for all rows in newData. Conditional predictions for all persons in newData that are also present in the data used for fitting gpModel; unconditional predictions for others persons. See examples for format.

Examples

1
2
3
4
5
6
7
8
9
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,])

karchjd/gppmr documentation built on May 14, 2019, 8:05 a.m.