predictGlm {PatientLevelPrediction} | R Documentation |
predict using a logistic regression model
Description
Predict risk with a given plpModel containing a generalized linear model.
Usage
predictGlm(plpModel, data, cohort)
Arguments
plpModel |
An object of type |
data |
An object of type |
cohort |
The population dataframe created using
|
Value
A dataframe containing the prediction for each person in the population
Examples
coefficients <- data.frame(
covariateId = c(1002),
coefficient = c(0.05))
model <- createGlmModel(coefficients, intercept = -2.5)
data("simulationProfile")
plpData <- simulatePlpData(simulationProfile, n=50)
prediction <- predictGlm(model, plpData, plpData$cohorts)
# see the predicted risk values
head(prediction)
[Package PatientLevelPrediction version 6.4.1 Index]