This function generates four datasets (external, local, validation, and test)
for discrete-time competing risks models. The data are simulated based on
user-specified correlation level beta_cor
between the local and external
regression coefficients.
Usage
simulate_CPFT(
beta_cor = 0.9,
N_ext = 5000,
N_loc = 2000,
N_val = 200,
N_test = 5000,
p = 4,
Tmax = 10,
nCause = 2,
mu = 1,
sigma = 0.05,
seed = 123
)
Arguments
- beta_cor
Numeric correlation level between external and local models. Must be one of
1.0, 0.9, 0.5, 0.1, 0
.- N_ext
Sample size for external data (default: 5000).
- N_loc
Sample size for local data (default: 2000).
- N_val
Sample size for validation data (default: 200).
- N_test
Sample size for test data (default: 5000).
- p
Number of covariates (default: 4).
- Tmax
Maximum follow-up time (discrete intervals) (default: 10).
- nCause
Number of competing causes (default: 2).
- mu
Mean of covariates (default: 1).
- sigma
Standard deviation of covariates (default: 0.05).
- seed
Random seed for reproducibility (default: 123).
Value
A list containing:
- external
List with simulated external data:
X
,Z
,y
- local
List with simulated local data:
X
,Z
,y
- validation
List with simulated validation data:
X
,Z
,y
- test
List with simulated test data:
X
,Z
,y
- Betat_l
Baseline time coefficients for local model
- Betav_l
Covariate coefficients for local model
- Betat_p
Baseline time coefficients for external model
- Betav_p
Covariate coefficients for external model