plotPredictionDistribution: Plot the side-by-side boxplots of prediction distribution, by...

View source: R/Plotting.R

plotPredictionDistributionR Documentation

Plot the side-by-side boxplots of prediction distribution, by class

Description

Plot the side-by-side boxplots of prediction distribution, by class

Usage

plotPredictionDistribution(
  plpResult,
  typeColumn = "evaluation",
  saveLocation = NULL,
  fileName = "PredictionDistribution.png"
)

Arguments

plpResult

A plp result object as generated using the runPlp function.

typeColumn

The name of the column specifying the evaluation type

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 ggsave in the ggplot2 package for supported file formats.

Details

Create a plot showing the side-by-side boxplots of prediction distribution, by class #'

Value

A ggplot object. Use the ggsave function to save to file in a different format.

Examples


 
data("simulationProfile")
plpData <- simulatePlpData(simulationProfile, n=1000)
saveLoc <- file.path(tempdir(), "plotPredictionDistribution")
results <- runPlp(plpData, outcomeId = 3, saveDirectory = saveLoc)
plotPredictionDistribution(results)
# clean up
unlink(saveLoc, recursive = TRUE)



OHDSI/PatientLevelPrediction documentation built on Feb. 14, 2025, 9:44 a.m.