Good afternoon,
I would like to have point estimates of 5-, 10-, and 15-year survival based on the model estimated from the stpm2 command.
Example for 5 year survival:
xi: stpm2 i.sex i.age i.decade i.var_x , scale(hazard) df(3) eform
gen t5=5
predict surv_t5 , surv timevar(t5) at(variable_x 1) ci
slist surv_* in 1/1
The issue is that I would like to hold all the other variables at a population average -- i.e., not at baseline values, which is what would happen when using the zeros option (if I understand this correctly). Ideally, I would like to use the margins command, implementing something like:
margins var_x, predict(surv)
When I try this though, I get the error message "prediction is a function of possibly stochastic quantities other than e(b)"
Any help with this would be greatly appreciated!
Post script: I know that my username does not reflect my real name. I have sent a message to get this fixed.
Jonviea Camberlain
I would like to have point estimates of 5-, 10-, and 15-year survival based on the model estimated from the stpm2 command.
Example for 5 year survival:
xi: stpm2 i.sex i.age i.decade i.var_x , scale(hazard) df(3) eform
gen t5=5
predict surv_t5 , surv timevar(t5) at(variable_x 1) ci
slist surv_* in 1/1
The issue is that I would like to hold all the other variables at a population average -- i.e., not at baseline values, which is what would happen when using the zeros option (if I understand this correctly). Ideally, I would like to use the margins command, implementing something like:
margins var_x, predict(surv)
When I try this though, I get the error message "prediction is a function of possibly stochastic quantities other than e(b)"
Any help with this would be greatly appreciated!
Post script: I know that my username does not reflect my real name. I have sent a message to get this fixed.
Jonviea Camberlain
Comment