Learn R Programming

PatientLevelPrediction (version 6.4.1)

predictPlp: predictPlp

Description

Predict the risk of the outcome using the input plpModel for the input plpData

Usage

predictPlp(plpModel, plpData, population, timepoint)

Value

A data frame containing the predicted risk values

Arguments

plpModel

An object of type plpModel - a patient level prediction model

plpData

An object of type plpData - the patient level prediction data extracted from the CDM.

population

The population created using createStudyPopulation() who will have their risks predicted or a cohort without the outcome known

timepoint

The timepoint to predict risk (survival models only)

Details

The function applied the trained model on the plpData to make predictions

Examples

Run this code
coefficients <- data.frame(
  covariateId = c(1002),
  coefficient = c(0.05)
)
model <- createGlmModel(coefficients, intercept = -2.5)
data("simulationProfile")
plpData <- simulatePlpData(simulationProfile, n = 50)
prediction <- predictPlp(model, plpData, plpData$cohorts)
# see the predicted risk values
head(prediction)

Run the code above in your browser using DataLab