Dear Community,
I would be really happy if you could help me with this:
I have built a "Fine & Grey"(crr) - model and I would like to double check if it makes sense since I found only one example online.
I have the variables sex (female/male), age(continuous variable), site (site a, site b, site c), stage(1,2,3,4) and expr (continuous variable).
In order to take care of the categorical variables I am creating dummy variables via [,-1] [from ?cmprsk::crr the model.matrix function can be used to generate suitable matrices of covariates from factors, eg model.matrix(~factor1+factor2)[,-1] will generate the variables for the factor coding of the factors factor1 and factor2. The final [,-1] removes the constant term from the output of model.matrix] https://stats.stackexchange.com/questions/212312/add-categorical-variable-in-crr-of-package-cmprsk ].
crr(
ftime = pheno$survalltime,
fstatus = pheno$event_status,
cov1 = model.matrix(~ factor(sex) + age +factor(Site) + factor(stage) + expr , data = pheno)[, -1],
failcode =1, cencode = 0)
Thank you for any feedback!!