﻿Rscript.exe : Warning messages:
At line:1 char:482
+ ... | Out-Null; & Rscript gate8_finegray_crosscheck.R "results\gate7\tte_ ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Warning messages::String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
1: package 'cmprsk' was built under R version 4.5.3 
2: package 'survival' was built under R version 4.5.3 
=== 1. Study data: primary cohort ===
n = 1831, events = 196, competing = 7

cmprsk::crr subdistribution hazard ratios (lactate terms):
  lac2.1-3.0             sHR = 1.1585  (95% CI 0.794-1.690)  p = 0.4400
  lac3.8-5.9             sHR = 1.4787  (95% CI 1.036-2.111)  p = 0.0310
  lac8.6 capped          sHR = 2.1155  (95% CI 1.192-3.755)  p = 0.0100

Gray's k-sample test on the four cumulative incidence functions:
     stat      pv df
1 8.44647 0.03763  3
2 4.26026 0.23470  3

=== 2. Simulated data with heavy competing risk ===
With many competing events, cause-specific and subdistribution models
diverge, so agreement here is an informative test of the implementation.
n = 4000, cause-1 events = 1084, competing events = 2084, censored = 832

cmprsk::crr on simulated data:
  x1     sHR = 1.8355  se = 0.0297
  x2     sHR = 0.7127  se = 0.0633

cause-specific Cox on the same simulated data (should differ):
    x1     x2 
1.4833 0.7767 

Written: results\gate8\finegray_reference.csv
