Stan for survival models


I can’t tell what they really did, but I’m glad to see them include the Bayesian analysis, and it’s probably a good start.

Above all else we need to have it easy to use the standard Poisson trick as with BUGS/JAGS to get the Cox model. In terms of the partial likelihood I do like Efron for handling ties.


Couldn’t we enforce effectively the same with the reject statement, see section 5.10. of the manual. However I’m not sure what this will do to the posterior…


You mean the “zeros trick”?

You can just increment the log density directly in Stan using target +=.

No. Just last week I rewrote this section of the manual for the next release (2.18) to indicate that it is not good for sampling or optimization if reject is used to try to enforce constraints. At best, the sampler will be reduced to a random walk.


It would be great to get a case study on survival analysis for Stan. Maybe I missed one in one of the StanCon submissions.

Or a chapter for the manual. It doesn’t contain any survival model examples at all.


I’d be happy to contribute, so what’s the best way I can do it? Chapter or case study. I did quite some work on Stan and survival models the last months. I also will be in Helsinki.

I could write one on the piecewise exponential hazard model as Poisson regression or using i-splines for the log cumulative hazard function, following Royston & Parmar. Maybe both together with some model diagnosis…


They’re not exclusive.

The user’s guide part of the manual is mainly examples of how to program models in Stan. So if there are widely used survival models, it makes sense to put them in the manual, especially if there’s some subtlety to coding them.

For more involved things involving statistical methodology, real data, plots, etc., it should be a case study.


Thanks a lot! I’ve been traveling outside the US, and sorry for my delay in responding to your suggestions and/or comments.