Learn R Programming

PatientLevelPrediction (version 6.4.1)

predictCyclops: Create predictive probabilities

Description

Create predictive probabilities

Usage

predictCyclops(plpModel, data, cohort)

Value

The value column in the result data.frame is: logistic: probabilities of the outcome, poisson: Poisson rate (per day) of the outome, survival: hazard rate (per day) of the outcome.

Arguments

plpModel

An object of type predictiveModel as generated using fitPlp.

data

The new plpData containing the covariateData for the new population

cohort

The cohort to calculate the prediction for

Details

Generates predictions for the population specified in plpData given the model.

Examples

Run this code
  # takes too long 
data("simulationProfile")
plpData <- simulatePlpData(simulationProfile, n = 1000)
population <- createStudyPopulation(plpData, outcomeId = 3)
data <- splitData(plpData, population)
plpModel <- fitPlp(data$Train, modelSettings = setLassoLogisticRegression(),
                   analysisId = "test", analysisPath = NULL)
prediction <- predictCyclops(plpModel, data$Test, data$Test$labels)
# view prediction dataframe
head(prediction)

Run the code above in your browser using DataLab