forestPlot,ModelComparison-method {PDATK}R Documentation

Render a forest plot from the validationStats slot of a PCOSP model object.

Description

Render a forest plot from the validationStats slot of a PCOSP model object.

Usage

## S4 method for signature 'ModelComparison'
forestPlot(
  object,
  stat,
  groupBy = "cohort",
  colourBy = "model",
  vline,
  ...,
  xlab,
  ylab,
  transform,
  colours,
  title
)

Arguments

object

A ModelComparison object to forest plot.

stat

A character vector specifying a statistic to plot.

groupBy

A character vector with one or more columns in validationStats to group by. These will be the facets in your forestplot.

colourBy

A character vector specifying the columns in validationStats to colour by.

vline

An integer value on the x-axis to place a dotted vertical line.

...

Force subsequent parameters to be named, not used.

xlab

A character vector specifying the desired x label. Automatically guesses based on the stat argument.

ylab

A character vector specifying the desired y label. Defaults to 'Cohort (P-value)'.

transform

The name of a numeric function to transform the statistic before making the forest plot.

colours

A character vector of colours to pass into ggplot2::scale_fill_manual, which modify the colourBy argument.

title

A character vector with a title to add to the plot.

Value

A ggplot2 object.

Examples

data(sampleValPCOSPmodel)
data(sampleClinicalModel)
data(sampleCohortList)

# Set parallelization settings
BiocParallel::register(BiocParallel::SerialParam())

# Train the models
trainedClinicalModel <- trainModel(sampleClinicalModel)

# Predict risk/risk-class
ClinicalPredCohortL <- predictClasses(sampleCohortList[c('PCSI', 'TCGA')],
  model=trainedClinicalModel)

# Validate the models
validatedClinicalModel <- validateModel(trainedClinicalModel,
  valData=ClinicalPredCohortL)

# Compare the models
modelComp <- compareModels(sampleValPCOSPmodel, validatedClinicalModel)

# Make the forest plot
modelComp <- modelComp[modelComp$isSummary == TRUE, ]
modelCindexCompForestPlot <- forestPlot(modelComp, stat='concordance_index')


[Package PDATK version 1.1.3 Index]