| forestPlot,ModelComparison-method {PDATK} | R Documentation |
validationStats slot of a PCOSP model object.Render a forest plot from the validationStats slot of a PCOSP model object.
## S4 method for signature 'ModelComparison' forestPlot( object, stat, groupBy = "cohort", colourBy = "model", vline, ..., xlab, ylab, transform, colours, title )
object |
A |
stat |
A |
groupBy |
A |
colourBy |
A |
vline |
An |
... |
Force subsequent parameters to be named, not used. |
xlab |
A |
ylab |
A |
transform |
The name of a numeric function to transform the statistic before making the forest plot. |
colours |
A |
title |
A |
A ggplot2 object.
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')