plotGeneralizability | R Documentation |
Plot the train/test generalizability diagnostic
plotGeneralizability(
covariateSummary,
saveLocation = NULL,
fileName = "Generalizability.png"
)
covariateSummary |
A prediction object as generated using the
|
saveLocation |
Directory to save plot (if NULL plot is not saved) |
fileName |
Name of the file to save to plot, for example
'plot.png'. See the function |
Create a plot showing the train/test generalizability diagnostic #'
A ggplot object. Use the ggsave
function to save to file in a different
format.
data("simulationProfile")
plpData <- simulatePlpData(simulationProfile, n=1000)
population <- createStudyPopulation(plpData, outcomeId = 3)
data <- splitData(plpData, population = population)
strata <- data.frame(
rowId = c(data$Train$labels$rowId, data$Test$labels$rowId),
strataName = c(rep("Train", nrow(data$Train$labels)),
rep("Test", nrow(data$Test$labels))))
covariateSummary <- covariateSummary(plpData$covariateData,
cohort = dplyr::select(population, "rowId"),
strata = strata, labels = population)
plotGeneralizability(covariateSummary)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.