'Cox regression and predictions with mgcv
I'm doing Cox regression using the mgcv package, and I'm not completely sure how to interpret the results of the model and the predictions
library(survival)
library(mgcv)
data <- survival::veteran
data$trt <- as.factor(data$trt)
data$celltype <- as.factor(data$celltype)
gam.model <- gam(time ~ celltype + trt + s(karno) + s(age),
data=data, family="cox.ph", weights=status)
plot(gam.model)
What is the y-axis on these plots? log hazard rate?
By looking at the predictions I get using the code below, it seems that the predictions are survival rates, is that correct?
data$pred <- predict(gam.model, newdata=data, type="response")
If I wanted to "re-do" the experiment conducted from the veteran dataset (I would go and get exact replicas of the old participants and say "Ok, guys, we are going to run experiment for 60 days for all of you" and then predict expected lifetime for each participant beforehand, would the following be correct?
new_data <- data
new_data$time <- 60
new_data$exp_lifetime <- predict(gam.model, newdata=new_data, type="response") * 60
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

