I have successfully fitted a competing risks model using Fine and Gray model (Melanoma data) but now the challenge is how to check for non-linear effects of continuous covariates(such as age) using Restricted cubic spline function in R
an R code on how to go about
I have tried using the following code by it is not working.
FGR(Hist(time,status)~Sex+ulcer+rcs(Melanoma$age, df=3),Melanoma)