Compare two staging systems using Groome criteria (Groome et al., 2001). Calculates four key metrics: hazard consistency, hazard discrimination, sample balance, and outcome prediction. Provides overall rank to determine which staging system performs better. Includes C-index comparison, radar charts, and side-by-side Kaplan-Meier curves.
Usage
groomecompare(
data,
time,
event,
stage1,
stage2,
eventValue = "1",
stage1name = "Staging System 1",
stage2name = "Staging System 2",
radarplot = TRUE,
barplot = FALSE,
kmplots = TRUE,
detailedmetrics = TRUE,
hazardratios = TRUE,
samplesize = TRUE,
cindexcompare = TRUE,
bootstrap = FALSE,
nboot = 1000,
seed = 12345
)Arguments
- data
.
- time
a (non-negative valued) vector of survival times
- event
the status indicator (0=censored, 1=event)
- stage1
first staging system to compare (e.g., ypTNM stage)
- stage2
second staging system to compare (e.g., RPA stage)
- eventValue
the value representing an event
- stage1name
descriptive name for first staging system
- stage2name
descriptive name for second staging system
- radarplot
.
- barplot
.
- kmplots
.
- detailedmetrics
.
- hazardratios
.
- samplesize
.
- cindexcompare
.
- bootstrap
.
- nboot
.
- seed
.
Value
A results object containing:
results$instructions | a html | ||||
results$summary | a table | ||||
results$detailedmetrics$consistency | a table | ||||
results$detailedmetrics$discrimination | a table | ||||
results$hazardratios$hrs1 | a table | ||||
results$hazardratios$hrs2 | a table | ||||
results$samplesize | a table | ||||
results$cindexcompare | a table | ||||
results$radarplot | an image | ||||
results$barplot | an image | ||||
results$kmplot1 | an image | ||||
results$kmplot2 | an image | ||||
results$bootstrap | a table | ||||
results$notices | a html |
Tables can be converted to data frames with asDF or as.data.frame. For example:
results$summary$asDF
as.data.frame(results$summary)
Examples
# Example: Compare ypTNM vs RPA staging systems
# Generate sample survival data with two staging systems
set.seed(12345)
n <- 150
survData <- data.frame(
time = rexp(n, 0.05),
event = rbinom(n, 1, 0.6),
ypTNM = factor(sample(c("Stage I", "Stage II", "Stage III", "Stage IV"),
n, replace = TRUE, prob = c(0.3, 0.3, 0.25, 0.15))),
RPA = factor(sample(c("Low Risk", "Intermediate", "High Risk"),
n, replace = TRUE, prob = c(0.4, 0.35, 0.25)))
)
# Compare staging systems using Groome criteria
groomecompare(
data = survData,
time = "time",
event = "event",
stage1 = "ypTNM",
stage2 = "RPA",
stage1name = "ypTNM Staging",
stage2name = "RPA Classification",
eventValue = "1",
radarplot = TRUE,
kmplots = TRUE,
detailedmetrics = TRUE,
cindexcompare = TRUE,
bootstrap = FALSE
)
#>
#> GROOME STAGING SYSTEM COMPARISON
#>
#> <div style="font-family: Arial; padding: 15px; background-color:
#> #f8f9fa; border-radius: 5px; margin: 10px 0;">
#> <h3 style="color: #0066cc; margin-top: 0;">Groome Staging System
#> Comparison
#>
#> Purpose: Compare two staging systems using well-accepted criteria
#> (Groome et al., 2001).
#>
#> Criteria Explained:
#>
#>
#> Hazard Consistency: max|log(HR_i/HR_j)| for adjacent stages. Smaller =
#> more consistent hazard progression.
#> Hazard Discrimination: Range of log(HR) across stages. Larger = better
#> separation of risk groups.
#> Sample Balance: max(n_i/n_j) across stages. Smaller = more balanced
#> stage distribution.
#> Outcome Prediction: Weighted combination of above metrics.
#> Overall Rank: Sum of 4 scores. <span style="color: red; font-weight:
#> bold;">Smaller is better.
#>
#>
#>
#> Interpretation: The system with lower overall rank has superior
#> prognostic performance.
#>
#> Reference: Groome PA, et al. Head Neck. 2001;23:613-24.
#>
#> Application: Compare ypTNM vs. RPA staging (Liu et al., Br J Cancer
#> 2026).
#>
#>
#>
#> Comparison Summary
#> ───────────────────────────────────────────────────────────────────────────────
#> Criterion (stage1name) (stage2name) Better System
#> ───────────────────────────────────────────────────────────────────────────────
#> Hazard Consistency 0.2903593 0.3768379 ypTNM Staging
#> Hazard Discrimination 0.4694388 0.3881000 ypTNM Staging
#> Sample Balance 2.3500000 1.6388889 RPA Classification
#> Outcome Prediction 4.7705625 4.5923825 RPA Classification
#> Overall Rank 9.5411251 9.1847650 RPA Classification
#> ───────────────────────────────────────────────────────────────────────────────
#>
#>
#> DETAILED METRICS
#>
#> Hazard Consistency Details
#> ───────────────────────────────────────────────────────────────────────────────────────
#> System Adjacent Stages HR (lower) HR (upper) |log(HR1/HR2)|
#> ───────────────────────────────────────────────────────────────────────────────────────
#> ypTNM Staging Stage 1 vs 2 1.0000000 1.3369077 0.2903593
#> ypTNM Staging Stage 2 vs 3 1.3369077 1.5990965 0.1790795
#> ypTNM Staging Stage 3 vs 4 1.5990965 1.3309032 0.1835809
#> RPA Classification Stage 1 vs 2 1.0000000 1.4576680 0.3768379
#> RPA Classification Stage 2 vs 3 1.4576680 1.4741771 0.0112621
#> ───────────────────────────────────────────────────────────────────────────────────────
#>
#>
#> Hazard Discrimination Details
#> ───────────────────────────────────────────────────────────
#> System Stage HR log(HR)
#> ───────────────────────────────────────────────────────────
#> ypTNM Staging Stage 1 1.0000000 0.0000000
#> ypTNM Staging Stage 2 1.3369077 0.2903593
#> ypTNM Staging Stage 3 1.5990965 0.4694388
#> ypTNM Staging Stage 4 1.3309032 0.2858578
#> RPA Classification Stage 1 1.0000000 0.0000000
#> RPA Classification Stage 2 1.4576680 0.3768379
#> RPA Classification Stage 3 1.4741771 0.3881000
#> ───────────────────────────────────────────────────────────
#>
#>
#> HAZARD RATIOS BY STAGE
#>
#> ypTNM Staging
#> ──────────────────────────────────────────────────────────────────────
#> Stage N Events HR 95% CI p
#> ──────────────────────────────────────────────────────────────────────
#> Stage I 38 19 1.0000000 Reference
#> Stage II 47 27 1.3369077 (0.74-2.41) 0.3352510
#> Stage III 45 26 1.5990965 (0.88-2.91) 0.1237700
#> Stage IV 20 12 1.3309032 (0.64-2.75) 0.4394386
#> ──────────────────────────────────────────────────────────────────────
#>
#>
#> RPA Classification
#> ─────────────────────────────────────────────────────────────────────────
#> Stage N Events HR 95% CI p
#> ─────────────────────────────────────────────────────────────────────────
#> High Risk 36 20 1.0000000 Reference
#> Intermediate 55 30 1.4576680 (0.82-2.58) 0.1951703
#> Low Risk 59 34 1.4741771 (0.84-2.57) 0.1723215
#> ─────────────────────────────────────────────────────────────────────────
#>
#>
#> Sample Size Distribution
#> ───────────────────────────────────────────────────────────────────────────
#> System Stage N % Max/Min Ratio
#> ───────────────────────────────────────────────────────────────────────────
#> ypTNM Staging Stage I 38 25.3000000 2.3500000
#> ypTNM Staging Stage II 47 31.3000000 2.3500000
#> ypTNM Staging Stage III 45 30.0000000 2.3500000
#> ypTNM Staging Stage IV 20 13.3000000 2.3500000
#> RPA Classification High Risk 36 24.0000000 1.6388889
#> RPA Classification Intermediate 55 36.7000000 1.6388889
#> RPA Classification Low Risk 59 39.3000000 1.6388889
#> ───────────────────────────────────────────────────────────────────────────
#>
#>
#> C-Index Comparison
#> ─────────────────────────────────────────────────────────────────
#> System C-Index SE 95% CI
#> ─────────────────────────────────────────────────────────────────
#> ypTNM Staging 0.4584866 0.0347070 (0.39-0.527)
#> RPA Classification 0.4509678 0.0327646 (0.387-0.515)
#> ─────────────────────────────────────────────────────────────────
#>
#>
#> <div style="font-family: Arial, sans-serif; margin: 10px;"><div
#> style="margin: 8px 0; padding: 10px; background-color: #5bc0de22;
#> border-left: 4px solid #5bc0de; border-radius: 3px;"><strong
#> style="color: #5bc0de;">ℹ Winner: RPA Classification<br/><span
#> style="color: #333;">RPA Classification demonstrates superior
#> performance (3.7% better overall rank).<div style="margin: 8px 0;
#> padding: 10px; background-color: #5bc0de22; border-left: 4px solid
#> #5bc0de; border-radius: 3px;"><strong style="color: #5bc0de;">ℹ
#> Comparison Complete<br/><span style="color: #333;">Compared ypTNM
#> Staging (4 stages) vs. RPA Classification (3 stages). Winner: RPA
#> Classification. Review Groome metrics and plots for interpretation.
# With bootstrap validation (smaller nboot for speed)
groomecompare(
data = survData,
time = "time",
event = "event",
stage1 = "ypTNM",
stage2 = "RPA",
stage1name = "ypTNM Staging",
stage2name = "RPA Classification",
bootstrap = TRUE,
nboot = 100,
seed = 12345
)
#>
#> GROOME STAGING SYSTEM COMPARISON
#>
#> <div style="font-family: Arial; padding: 15px; background-color:
#> #f8f9fa; border-radius: 5px; margin: 10px 0;">
#> <h3 style="color: #0066cc; margin-top: 0;">Groome Staging System
#> Comparison
#>
#> Purpose: Compare two staging systems using well-accepted criteria
#> (Groome et al., 2001).
#>
#> Criteria Explained:
#>
#>
#> Hazard Consistency: max|log(HR_i/HR_j)| for adjacent stages. Smaller =
#> more consistent hazard progression.
#> Hazard Discrimination: Range of log(HR) across stages. Larger = better
#> separation of risk groups.
#> Sample Balance: max(n_i/n_j) across stages. Smaller = more balanced
#> stage distribution.
#> Outcome Prediction: Weighted combination of above metrics.
#> Overall Rank: Sum of 4 scores. <span style="color: red; font-weight:
#> bold;">Smaller is better.
#>
#>
#>
#> Interpretation: The system with lower overall rank has superior
#> prognostic performance.
#>
#> Reference: Groome PA, et al. Head Neck. 2001;23:613-24.
#>
#> Application: Compare ypTNM vs. RPA staging (Liu et al., Br J Cancer
#> 2026).
#>
#>
#>
#> Comparison Summary
#> ───────────────────────────────────────────────────────────────────────────────
#> Criterion (stage1name) (stage2name) Better System
#> ───────────────────────────────────────────────────────────────────────────────
#> Hazard Consistency 0.2903593 0.3768379 ypTNM Staging
#> Hazard Discrimination 0.4694388 0.3881000 ypTNM Staging
#> Sample Balance 2.3500000 1.6388889 RPA Classification
#> Outcome Prediction 4.7705625 4.5923825 RPA Classification
#> Overall Rank 9.5411251 9.1847650 RPA Classification
#> ───────────────────────────────────────────────────────────────────────────────
#>
#>
#> DETAILED METRICS
#>
#> Hazard Consistency Details
#> ───────────────────────────────────────────────────────────────────────────────────────
#> System Adjacent Stages HR (lower) HR (upper) |log(HR1/HR2)|
#> ───────────────────────────────────────────────────────────────────────────────────────
#> ypTNM Staging Stage 1 vs 2 1.0000000 1.3369077 0.2903593
#> ypTNM Staging Stage 2 vs 3 1.3369077 1.5990965 0.1790795
#> ypTNM Staging Stage 3 vs 4 1.5990965 1.3309032 0.1835809
#> RPA Classification Stage 1 vs 2 1.0000000 1.4576680 0.3768379
#> RPA Classification Stage 2 vs 3 1.4576680 1.4741771 0.0112621
#> ───────────────────────────────────────────────────────────────────────────────────────
#>
#>
#> Hazard Discrimination Details
#> ───────────────────────────────────────────────────────────
#> System Stage HR log(HR)
#> ───────────────────────────────────────────────────────────
#> ypTNM Staging Stage 1 1.0000000 0.0000000
#> ypTNM Staging Stage 2 1.3369077 0.2903593
#> ypTNM Staging Stage 3 1.5990965 0.4694388
#> ypTNM Staging Stage 4 1.3309032 0.2858578
#> RPA Classification Stage 1 1.0000000 0.0000000
#> RPA Classification Stage 2 1.4576680 0.3768379
#> RPA Classification Stage 3 1.4741771 0.3881000
#> ───────────────────────────────────────────────────────────
#>
#>
#> HAZARD RATIOS BY STAGE
#>
#> ypTNM Staging
#> ──────────────────────────────────────────────────────────────────────
#> Stage N Events HR 95% CI p
#> ──────────────────────────────────────────────────────────────────────
#> Stage I 38 19 1.0000000 Reference
#> Stage II 47 27 1.3369077 (0.74-2.41) 0.3352510
#> Stage III 45 26 1.5990965 (0.88-2.91) 0.1237700
#> Stage IV 20 12 1.3309032 (0.64-2.75) 0.4394386
#> ──────────────────────────────────────────────────────────────────────
#>
#>
#> RPA Classification
#> ─────────────────────────────────────────────────────────────────────────
#> Stage N Events HR 95% CI p
#> ─────────────────────────────────────────────────────────────────────────
#> High Risk 36 20 1.0000000 Reference
#> Intermediate 55 30 1.4576680 (0.82-2.58) 0.1951703
#> Low Risk 59 34 1.4741771 (0.84-2.57) 0.1723215
#> ─────────────────────────────────────────────────────────────────────────
#>
#>
#> Sample Size Distribution
#> ───────────────────────────────────────────────────────────────────────────
#> System Stage N % Max/Min Ratio
#> ───────────────────────────────────────────────────────────────────────────
#> ypTNM Staging Stage I 38 25.3000000 2.3500000
#> ypTNM Staging Stage II 47 31.3000000 2.3500000
#> ypTNM Staging Stage III 45 30.0000000 2.3500000
#> ypTNM Staging Stage IV 20 13.3000000 2.3500000
#> RPA Classification High Risk 36 24.0000000 1.6388889
#> RPA Classification Intermediate 55 36.7000000 1.6388889
#> RPA Classification Low Risk 59 39.3000000 1.6388889
#> ───────────────────────────────────────────────────────────────────────────
#>
#>
#> C-Index Comparison
#> ─────────────────────────────────────────────────────────────────
#> System C-Index SE 95% CI
#> ─────────────────────────────────────────────────────────────────
#> ypTNM Staging 0.4584866 0.0347070 (0.39-0.527)
#> RPA Classification 0.4509678 0.0327646 (0.387-0.515)
#> ─────────────────────────────────────────────────────────────────
#>
#>
#> Bootstrap Validation
#> ─────────────────────────────────────────────────────────────────────────────────────────────────
#> System Metric Apparent Bootstrap Mean Optimism Corrected
#> ─────────────────────────────────────────────────────────────────────────────────────────────────
#> ypTNM Staging Consistency 0.2903593 0.5130634 0.2227042 0.0676551
#> ypTNM Staging Discrimination 0.4694388 0.6624285 0.1929897 0.2764491
#> ypTNM Staging Balance 2.3500000 2.5966946 0.2466946 2.1033054
#> ypTNM Staging Overall Rank 9.5411251 9.7861428 0.2450177 9.2961073
#> RPA Classification Consistency 0.3768379 0.4559890 0.0791511 0.2976868
#> RPA Classification Discrimination 0.3881000 0.5142998 0.1261998 0.2619001
#> RPA Classification Balance 1.6388889 1.7427171 0.1038282 1.5350606
#> RPA Classification Overall Rank 9.1847650 9.9316737 0.7469086 8.4378564
#> ─────────────────────────────────────────────────────────────────────────────────────────────────
#>
#>
#> <div style="font-family: Arial, sans-serif; margin: 10px;"><div
#> style="margin: 8px 0; padding: 10px; background-color: #5bc0de22;
#> border-left: 4px solid #5bc0de; border-radius: 3px;"><strong
#> style="color: #5bc0de;">ℹ Winner: RPA Classification<br/><span
#> style="color: #333;">RPA Classification demonstrates superior
#> performance (3.7% better overall rank).<div style="margin: 8px 0;
#> padding: 10px; background-color: #5bc0de22; border-left: 4px solid
#> #5bc0de; border-radius: 3px;"><strong style="color: #5bc0de;">ℹ
#> Comparison Complete<br/><span style="color: #333;">Compared ypTNM
#> Staging (4 stages) vs. RPA Classification (3 stages). Winner: RPA
#> Classification. Review Groome metrics and plots for interpretation.