Reputation: 11
I am modeling the risk of cancer-specific mortality in a Fine-Gray model with three variables: the TNM-stage, age at diagnosis (ie, Age_wins) and Cancer subtype (ie, Disease). The competing risk is dying of other causes. A non-linear term with restricted cubic splines for Age_wins, and an interaction term for Age_wins and Disease is included in the model.
Two issues:
I want to plot the logHR output on the y-axis and show the non-linear association of age at diagnosis with the outcome (dead due to cancer), preferably for the two cancer subtypes separately, but I am not sure which function to use for that (in the rms package for a standard Cox model, the Predict() function is the equivalent basically)
I struggle to predict the 10-year risk with the cmprsk package, as I might not fully understand the predict() function from this particular package, and the output. Basically, I want the 10-year absolute risks for the two cancer types, per TNM stage and across the full range of age, if that makes sense.
I have the following example data and syntax so far:
#generate example dataset
set.seed(100)
data1 <- data.frame(Age_wins = runif(1000, min=18, max=80),
Disease=sample(c(0,1), 1000, replace=TRUE, prob=c(0.7, 0.3)),
TNM=factor(sample(1:4, 1000, replace=TRUE)),
Outcome=sample(c(0, 1, 2), 1000, replace=TRUE, prob=c(0.7, 0.1, 0.2)),
Followup=runif(1000, min=1, max=240)
)
#Outcome consists of 3 levels, 0=censored, 1=dead due to cancer, 2=dead due to other causes, and Followup is in months.
#run fine-gray model
library(cmprsk)
attach(data1)
cov1 <- model.matrix(~rcs(Age_wins,3)*Disease+TNM)[,-1] # add the interaction term and non-linear term here
crr1 <- crr(ftime=Followup, fstatus=Outcome, cov1=cov1, failcode=1, cencode=0)
summary(crr1)
z.p <- predict(crr1, cov1)
So from here, I am unsure. Am I correct that selecting the row with a failure time around 120 months gives me the 10-year risk for each individual patient? And is there a way to plot the logHR output of my FG model to show the non-linear term of Age_wins?
I hope my example and question are clear enough, thanks a lot!
Upvotes: 1
Views: 27