Skip to contents

Builds clinical integer-point scoring systems from regression models using three published methods (Sullivan/D'Agostino, Schneeweiss, Beta10). Supports logistic and Cox regression with automatic variable categorization, calibration, discrimination, nomogram generation, and TRIPOD compliance.

Usage

clinicalscore(
  data,
  modelType = "logistic",
  outcome,
  outcomeLevel,
  elapsedtime = NULL,
  explanatory,
  autoCategorize = TRUE,
  categorizeMethod = "median",
  customBreaks = "",
  scoringMethod = "schneeweiss",
  maxPoints = 10,
  bootstrapValidation = FALSE,
  bootstrapN = 200,
  scoreLookup = TRUE,
  showNomogram = TRUE,
  showCalibration = TRUE,
  calibrationGroups = 4,
  showDiscrimination = TRUE,
  showDecisionCurve = FALSE,
  showTRIPOD = FALSE,
  suitabilityCheck = TRUE,
  showSummary = FALSE,
  showExplanations = FALSE,
  random_seed = 42
)

Arguments

data

.

modelType

.

outcome

.

outcomeLevel

.

elapsedtime

.

explanatory

.

autoCategorize

Automatically convert continuous predictors into categories for integer-point assignment. If disabled, continuous predictors contribute points based on above/below median.

categorizeMethod

.

customBreaks

Comma-separated cutpoints for manual categorization. Example: "3,10,20" for Ki-67 would create G1/G2a/G2b/G3.

scoringMethod

.

maxPoints

.

bootstrapValidation

.

bootstrapN

.

scoreLookup

.

showNomogram

.

showCalibration

.

calibrationGroups

.

showDiscrimination

.

showDecisionCurve

.

showTRIPOD

.

suitabilityCheck

.

showSummary

.

showExplanations

.

random_seed

.

Value

A results object containing:

results$todoa html
results$suitabilityReporta html
results$modelSummarya table
results$coefficientsa table
results$scoringTablea table
results$methodComparisona table
results$scoringPerformancea table
results$lookupTablea table
results$discriminationTablea table
results$validationTablea table
results$calibrationPlotan image
results$nomogramPlotan image
results$scoreDistPlotan image
results$decisionCurveTablea table
results$decisionCurvePlotan image
results$tripodChecklista html
results$summaryTexta html
results$explanationsa html

Tables can be converted to data frames with asDF or as.data.frame. For example:

results$modelSummary$asDF

as.data.frame(results$modelSummary)

Examples

# \donttest{
clinicalscore(data = data, outcome = "diagnosis",
    outcomeLevel = "malignant", explanatory = vars(age, grade, ki67),
    modelType = "logistic", scoringMethod = "compare")
#> Error: Argument 'data' must be a data frame
# }