View source: R/Recalibration.R
recalibratePlpRefit | R Documentation |
Recalibrating a model by refitting it
recalibratePlpRefit(plpModel, newPopulation, newData, returnModel = FALSE)
plpModel |
The trained plpModel (runPlp$model) |
newPopulation |
The population created using createStudyPopulation() who will have their risks predicted |
newData |
An object of type |
returnModel |
Logical: return the refitted model |
An prediction dataframe with the predictions of the recalibrated model added
data("simulationProfile")
plpData <- simulatePlpData(simulationProfile, n = 1000)
saveLoc <- file.path(tempdir(), "recalibratePlpRefit")
plpResults <- runPlp(plpData, outcomeId = 3, saveDirectory = saveLoc)
newData <- simulatePlpData(simulationProfile, n = 1000)
newPopulation <- createStudyPopulation(newData, outcomeId = 3)
predictions <- recalibratePlpRefit(plpModel = plpResults$model,
newPopulation = newPopulation,
newData = newData)
# clean up
unlink(saveLoc, recursive = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.