From e18ff08d4aa0ea863b7c68269e62ae9dc3d8f1ef Mon Sep 17 00:00:00 2001 From: egillax Date: Tue, 22 Oct 2024 11:45:06 +0200 Subject: [PATCH] Add net benefit plot and tests --- man/PatientLevelPrediction.Rd | 4 ++-- man/getNetBenefit.Rd | 20 +++++++++++++++++++ man/plotNetBenefit.Rd | 37 +++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 man/getNetBenefit.Rd create mode 100644 man/plotNetBenefit.Rd diff --git a/man/PatientLevelPrediction.Rd b/man/PatientLevelPrediction.Rd index 8bc15fc71..4946949d9 100644 --- a/man/PatientLevelPrediction.Rd +++ b/man/PatientLevelPrediction.Rd @@ -18,15 +18,15 @@ Useful links: } \author{ -\strong{Maintainer}: Jenna Reps \email{jreps@its.jnj.com} +\strong{Maintainer}: Egill Fridgeirsson \email{e.fridgeirsson@erasmusmc.nl} Authors: \itemize{ + \item Jenna Reps \email{jreps@its.jnj.com} \item Martijn Schuemie \item Marc Suchard \item Patrick Ryan \item Peter Rijnbeek - \item Egill Fridgeirsson } } diff --git a/man/getNetBenefit.Rd b/man/getNetBenefit.Rd new file mode 100644 index 000000000..af758fa79 --- /dev/null +++ b/man/getNetBenefit.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/Plotting.R +\name{getNetBenefit} +\alias{getNetBenefit} +\title{Calculate net benefit in an efficient way} +\usage{ +getNetBenefit(plpResult, evalType) +} +\arguments{ +\item{plpResult}{A plp result object as generated using the \code{\link{runPlp}} function.} + +\item{evalType}{The evaluation type column} +} +\value{ +A data frame with the net benefit, treat all and treat none values +} +\description{ +Calculate net benefit in an efficient way +} +\keyword{internal} diff --git a/man/plotNetBenefit.Rd b/man/plotNetBenefit.Rd new file mode 100644 index 000000000..35722350b --- /dev/null +++ b/man/plotNetBenefit.Rd @@ -0,0 +1,37 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/Plotting.R +\name{plotNetBenefit} +\alias{plotNetBenefit} +\title{Plot the net benefit} +\usage{ +plotNetBenefit( + plpResult, + typeColumn = "evaluation", + saveLocation = NULL, + fileName = "netBenefit.png", + evalType = NULL, + ylim = NULL, + xlim = NULL +) +} +\arguments{ +\item{plpResult}{A plp result object as generated using the \code{\link{runPlp}} function.} + +\item{typeColumn}{The name of the column specifying the evaluation type} + +\item{saveLocation}{Directory to save plot (if NULL plot is not saved)} + +\item{fileName}{Name of the file to save to plot, for example 'plot.png'. See the function \code{ggsave} in the ggplot2 package for supported file formats.} + +\item{evalType}{Which evaluation type to plot for. For example `Test`, `Train`. If NULL everything is plotted} + +\item{ylim}{The y limits for the plot, if NULL the limits are calculated from the data} + +\item{xlim}{The x limits for the plot, if NULL the limits are calculated from the data} +} +\value{ +A list of ggplot objects +} +\description{ +Plot the net benefit +}