Convenience wrapper that mirrors the original Part II data
preparation workflow for weighted restricted mean analyses. The function now
delegates to prep_data_weighted_cif2 to provide consistent checks
and support for arbitrary ordinal state definitions.
prep_data_weighted_cif(
data_main,
data_long,
wID_main = "USUBJID",
wTimeToRecovery_main = "TTRECOV",
wTimeToDeath_main = "TTDEATH",
wRecov_Censoring_main = "RECCNSR",
wDeath_Censoring_main = "DTHCNSR",
wBaselineScore_main = "ordscr_bs",
wTreatment_main = "trt",
wID_long = "USUBJID",
wADY_long = "ADYC",
wScore_long = "ORDSCOR",
wStates_death = c(4, 5, 6, 7),
wWeights_death = c(2, 1.5, 1, 0.5),
wStates_discharge = c(4, 5, 6, 7),
wWeights_discharge = c(0.5, 1, 1.5, 2)
)See prep_data_weighted_cif2.
A data.frame with ID, TTR, TTD, RECCNSR, DTHCNSR, baseline score, trt, etc.
A data.frame with repeated clinical scores over time (e.g. ADYC, ORDSCOR).
Name of the patient ID column in the main dataset (default "USUBJID").
Name of the time-to-recovery column (default "TTRECOV").
Name of the time-to-death column (default "TTDEATH").
Name of the recovery-censor column (default "RECCNSR").
Name of the death-censor column (default "DTHCNSR").
Name of the baseline ordinal column (default "ordscr_bs").
Name of the treatment indicator column (0=control,1=treatment). Default "trt".
Name of the patient ID column in the long dataset (default "USUBJID").
Name of the day-since-treatment column in the long dataset (default "ADYC").
Name of the ordinal score column in the long dataset (default "ORDSCOR").
Vector of ordinal states for death weighting (default c(4,5,6,7)).
Numeric weights, same length as wStates_death (default c(2,1.5,1,0.5)).
Vector of states for discharge weighting (default c(4,5,6,7)).
Numeric weights, same length as wStates_discharge (default c(0.5,1,1.5,2)).