Learn R Programming

jointCompRisk (version 0.1.1)

prep_data_weighted_cif: Prepare Data for Weighted CIF (Legacy Wrapper)

Description

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.

Usage

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)
)

Value

See prep_data_weighted_cif2.

Arguments

data_main

A data.frame with ID, TTR, TTD, RECCNSR, DTHCNSR, baseline score, trt, etc.

data_long

A data.frame with repeated clinical scores over time (e.g. ADYC, ORDSCOR).

wID_main

Name of the patient ID column in the main dataset (default "USUBJID").

wTimeToRecovery_main

Name of the time-to-recovery column (default "TTRECOV").

wTimeToDeath_main

Name of the time-to-death column (default "TTDEATH").

wRecov_Censoring_main

Name of the recovery-censor column (default "RECCNSR").

wDeath_Censoring_main

Name of the death-censor column (default "DTHCNSR").

wBaselineScore_main

Name of the baseline ordinal column (default "ordscr_bs").

wTreatment_main

Name of the treatment indicator column (0=control,1=treatment). Default "trt".

wID_long

Name of the patient ID column in the long dataset (default "USUBJID").

wADY_long

Name of the day-since-treatment column in the long dataset (default "ADYC").

wScore_long

Name of the ordinal score column in the long dataset (default "ORDSCOR").

wStates_death

Vector of ordinal states for death weighting (default c(4,5,6,7)).

wWeights_death

Numeric weights, same length as wStates_death (default c(2,1.5,1,0.5)).

wStates_discharge

Vector of states for discharge weighting (default c(4,5,6,7)).

wWeights_discharge

Numeric weights, same length as wStates_discharge (default c(0.5,1,1.5,2)).