# \#survival

**URL:** https://discourse.mc-stan.org/tag/survival/180.md

[Latest](https://discourse.mc-stan.org/latest.md) · [Categories](https://discourse.mc-stan.org/categories.md) · [Tags](https://discourse.mc-stan.org/tags.md)

---

## [Understanding the Likelihood Model for the Cox Family in brms](https://discourse.mc-stan.org/t/understanding-the-likelihood-model-for-the-cox-family-in-brms/40622)

<div class="topic-metadata">

**Author:** [@kaybenleroll](https://discourse.mc-stan.org/u/kaybenleroll)\
**Replies:** 5\
**Last updated:** [June 16, 2026, 8:50pm UTC](https://discourse.mc-stan.org/t/understanding-the-likelihood-model-for-the-cox-family-in-brms/40622 "2026-06-16T20:50:28Z")

</div>

I am trying to understand the basic approach of the cox() family in brms. My understanding was that the idea is to model the baseline rate as a spline using the spline2 package, and then the covariates are proportional h…

---

## [Proposal for moving stan\_surv() to a separate package](https://discourse.mc-stan.org/t/proposal-for-moving-stan-surv-to-a-separate-package/41020)

<div class="topic-metadata">

**Author:** [@ericnovik](https://discourse.mc-stan.org/u/ericnovik)\
**Replies:** 7\
**Last updated:** [April 12, 2026, 11:17pm UTC](https://discourse.mc-stan.org/t/proposal-for-moving-stan-surv-to-a-separate-package/41020 "2026-04-12T23:17:00Z")

</div>

Hello All, I would like to propose moving stan\_surv() (Survival functionality) from rstanarm to a separate package, say SurvivalStan. The reasons are as follows: At this point, it seems unlikely that the survival br…

---

## [Simulating time to event data with a lagged treatment effect](https://discourse.mc-stan.org/t/simulating-time-to-event-data-with-a-lagged-treatment-effect/40940)

<div class="topic-metadata">

**Author:** [@dkbishop](https://discourse.mc-stan.org/u/dkbishop)\
**Replies:** 2\
**Last updated:** [March 10, 2026, 9:35am UTC](https://discourse.mc-stan.org/t/simulating-time-to-event-data-with-a-lagged-treatment-effect/40940 "2026-03-10T09:35:07Z")

</div>

Hi all, My post is more of a preamble to before I need to use Stan. I’m currently trying to simulate some time to event data from a Weibull distribution. The trick is that I want to simulate the data when the treatment …

---

## [Using {projpred} latent projection with {brms} Weibull family models](https://discourse.mc-stan.org/t/using-projpred-latent-projection-with-brms-weibull-family-models/39275)

<div class="topic-metadata">

**Author:** [@rtnliqry](https://discourse.mc-stan.org/u/rtnliqry)\
**Replies:** 31\
**Last updated:** [November 26, 2025, 10:29pm UTC](https://discourse.mc-stan.org/t/using-projpred-latent-projection-with-brms-weibull-family-models/39275 "2025-11-26T22:29:56Z")

</div>

Hi Stan Forum! I am currently trying to implement the use of the excellent projpred package (thanks @fweber144 and colleagues!) for variable selection with brms parametric survival models that use a Weibull response dis…

---

## [\`surv\_jm\` estimates do not match those in \`simjm\`](https://discourse.mc-stan.org/t/surv-jm-estimates-do-not-match-those-in-simjm/40419)

<div class="topic-metadata">

**Author:** [@mattwilliamson13](https://discourse.mc-stan.org/u/mattwilliamson13)\
**Replies:** 2\
**Last updated:** [September 26, 2025, 8:22pm UTC](https://discourse.mc-stan.org/t/surv-jm-estimates-do-not-match-those-in-simjm/40419 "2025-09-26T20:22:49Z")

</div>

Hi All, I’ve been fitting joint longitudinal models with stan\_jm, but wanted to make sure that my model was well-calibrated. I’ve been using simjm (thanks @sambrilleman!) to generate data with known parameter estimate…

---

## [Mixture, survival and ordinal models courses start in two weeks](https://discourse.mc-stan.org/t/mixture-survival-and-ordinal-models-courses-start-in-two-weeks/40056)

<div class="topic-metadata">

**Author:** [@lizzieinvancouver](https://discourse.mc-stan.org/u/lizzieinvancouver)\
**Replies:** 0\
**Last updated:** [August 3, 2025, 8:28pm UTC](https://discourse.mc-stan.org/t/mixture-survival-and-ordinal-models-courses-start-in-two-weeks/40056 "2025-08-03T20:28:43Z")

</div>

Hi all and happy post lammas day, Friendly (and probably final) reminder about upcoming online courses on mixture, survival and ordinal models and pairwise comparison modeling. Courses start 18 August and you can regist…

---

## [Prior predictive checks in survival modeling with a mixture prior](https://discourse.mc-stan.org/t/prior-predictive-checks-in-survival-modeling-with-a-mixture-prior/38329)

<div class="topic-metadata">

**Author:** [@mazin.abdelghany](https://discourse.mc-stan.org/u/mazin.abdelghany)\
**Replies:** 1\
**Last updated:** [December 31, 2024, 7:39pm UTC](https://discourse.mc-stan.org/t/prior-predictive-checks-in-survival-modeling-with-a-mixture-prior/38329 "2024-12-31T19:39:14Z")

</div>

Hi all, I recently posted for help to build a survival model using a mixture prior. I was able to run this model without issue, code below: data { int\<lower=0\> K; // num covariates int\<lower=0\> N; …

---

## [Survival data modeling using mixture priors](https://discourse.mc-stan.org/t/survival-data-modeling-using-mixture-priors/37844)

<div class="topic-metadata">

**Author:** [@mazin.abdelghany](https://discourse.mc-stan.org/u/mazin.abdelghany)\
**Replies:** 2\
**Last updated:** [December 30, 2024, 9:37pm UTC](https://discourse.mc-stan.org/t/survival-data-modeling-using-mixture-priors/37844 "2024-12-30T21:37:57Z")

</div>

Hi all, This is my first post to the Stan forums, so if there is any helpful additions or modifications that I can make to my post, please let me know and thank you for your patience. I have successfully fit a survival…

---

## [Gompertz distribution cdf under-/overflow](https://discourse.mc-stan.org/t/gompertz-distribution-cdf-under-overflow/36686)

<div class="topic-metadata">

**Author:** [@fredh](https://discourse.mc-stan.org/u/fredh)\
**Replies:** 7\
**Last updated:** [October 11, 2024, 10:12pm UTC](https://discourse.mc-stan.org/t/gompertz-distribution-cdf-under-overflow/36686 "2024-10-11T22:12:55Z")

</div>

Hi, I am trying to write custom functions for the \_cdf/\_lcdf for the gompertz distribtion Wikipedia I have been successful with other standard parametric survival functions which are either implemented already or by cu…

---

## [Estimating 1-2-1 multilevel mediation model](https://discourse.mc-stan.org/t/estimating-1-2-1-multilevel-mediation-model/36674)

<div class="topic-metadata">

**Author:** [@Jeroen](https://discourse.mc-stan.org/u/Jeroen)\
**Replies:** 1\
**Last updated:** [September 20, 2024, 7:43pm UTC](https://discourse.mc-stan.org/t/estimating-1-2-1-multilevel-mediation-model/36674 "2024-09-20T19:43:37Z")

</div>

Would it be possible to estimate a 1-2-1 multilevel mediation model with Stan? A 1-2-1 multilevel mediation model is a model in which the exposure is measured at level 1 (e.g. individual study participant’s income), the …

---

## [Cumulative probability within interval \[t, t+1\]](https://discourse.mc-stan.org/t/cumulative-probability-within-interval-t-t-1/36060)

<div class="topic-metadata">

**Author:** [@Tom\_C](https://discourse.mc-stan.org/u/Tom_C)\
**Replies:** 1\
**Last updated:** [July 30, 2024, 6:18pm UTC](https://discourse.mc-stan.org/t/cumulative-probability-within-interval-t-t-1/36060 "2024-07-30T18:18:16Z")

</div>

For a time-to-event (survival) analysis, I aim to calculate the probability of an event occurring within an interval, e.g. between time t and (t+1), where the time-to-event probability is drawn from a continuous distribu…

---

## [Incorporating Measurement Error for Death Event In Survival Model](https://discourse.mc-stan.org/t/incorporating-measurement-error-for-death-event-in-survival-model/35840)

<div class="topic-metadata">

**Author:** [@outStanding](https://discourse.mc-stan.org/u/outStanding)\
**Replies:** 1\
**Last updated:** [July 11, 2024, 7:49pm UTC](https://discourse.mc-stan.org/t/incorporating-measurement-error-for-death-event-in-survival-model/35840 "2024-07-11T19:49:55Z")

</div>

Hello, I am newer to bayesian modeling and even newer to Stan specifically. I am working on a power survival model and would like to incorporate measurement error - specifically measurement error related to the observat…

---

## [How can I get spline bases from "stan\_surv"?](https://discourse.mc-stan.org/t/how-can-i-get-spline-bases-from-stan-surv/34282)

<div class="topic-metadata">

**Author:** [@Farzin\_Shamloo](https://discourse.mc-stan.org/u/Farzin_Shamloo)\
**Replies:** 0\
**Last updated:** [February 28, 2024, 1:20am UTC](https://discourse.mc-stan.org/t/how-can-i-get-spline-bases-from-stan-surv/34282 "2024-02-28T01:20:07Z")

</div>

I’m fitting a survival model with a cubic spline base hazard and two internal knobs, which results in 6 polynomial bases. I want the spline bases formula to be able to calculate hazard at any time point. If my fitted mod…

---

## [Obtaining posterior for left-censored survival observations with STAN](https://discourse.mc-stan.org/t/obtaining-posterior-for-left-censored-survival-observations-with-stan/33424)

<div class="topic-metadata">

**Author:** [@Greg1](https://discourse.mc-stan.org/u/Greg1)\
**Replies:** 1\
**Last updated:** [November 24, 2023, 9:06pm UTC](https://discourse.mc-stan.org/t/obtaining-posterior-for-left-censored-survival-observations-with-stan/33424 "2023-11-24T21:06:36Z")

</div>

Hi, I have noticed that documentation for survival models is lacking and wondering if anyone can help me with or point me to resources that can help with my modeling challenges. I am trying to build a survival model for…

---

## [Issues to reinstall survival - rstanarm](https://discourse.mc-stan.org/t/issues-to-reinstall-survival-rstanarm/33010)

<div class="topic-metadata">

**Author:** [@sandra.velazco](https://discourse.mc-stan.org/u/sandra.velazco)\
**Replies:** 2\
**Last updated:** [October 10, 2023, 12:30am UTC](https://discourse.mc-stan.org/t/issues-to-reinstall-survival-rstanarm/33010 "2023-10-10T00:30:14Z")

</div>

Hi all, I was unable to reinstall survival branch of rstanarm in my laptop and other devices, so I would like to ask if someone has installed the survival branch and can help me to run my hierarchical model. I ran my mo…

---

## [Initial values for Weibull survival model with brms](https://discourse.mc-stan.org/t/initial-values-for-weibull-survival-model-with-brms/31183)

<div class="topic-metadata">

**Author:** [@Bjoern](https://discourse.mc-stan.org/u/Bjoern)\
**Replies:** 3\
**Last updated:** [May 8, 2023, 4:46am UTC](https://discourse.mc-stan.org/t/initial-values-for-weibull-survival-model-with-brms/31183 "2023-05-08T04:46:33Z")

</div>

When trying something out on the colon dataset from the R survival package, I ran into trouble with initialization for a simple Weibull model. A-priori I expect the intercept to be about 7.5 or so (\\approx log(5\*365.25 d…

---

## [Imputing parameter from survival analysis (gamma distribution)](https://discourse.mc-stan.org/t/imputing-parameter-from-survival-analysis-gamma-distribution/30121)

<div class="topic-metadata">

**Author:** [@danki\_007](https://discourse.mc-stan.org/u/danki_007)\
**Replies:** 0\
**Last updated:** [January 20, 2023, 7:11pm UTC](https://discourse.mc-stan.org/t/imputing-parameter-from-survival-analysis-gamma-distribution/30121 "2023-01-20T19:11:08Z")

</div>

Hi! I wanted to estimate time-till-event from survival analysis. My input data is from experiment where subject is housed in group. in each group, we have total hours that individual is positive. The Event of interest is…

---

## [Interval censored data fails with Weibull but not Gamma?](https://discourse.mc-stan.org/t/interval-censored-data-fails-with-weibull-but-not-gamma/28780)

<div class="topic-metadata">

**Author:** [@sonicking](https://discourse.mc-stan.org/u/sonicking)\
**Replies:** 6\
**Last updated:** [September 9, 2022, 11:26pm UTC](https://discourse.mc-stan.org/t/interval-censored-data-fails-with-weibull-but-not-gamma/28780 "2022-09-09T23:26:23Z")

</div>

I attempt to run survival models with interval-censored data. #War Data from Morrison and Schmittlein 1980 Dropped \<- c(165, 46, 33, 22, 11, 11, 5, 4, 4, 3) Tstart \<- c(0:9); Tend \<- Tstart+1; data\_list \<- list( Dro…

---

## [Predicting future event times that are currently censored](https://discourse.mc-stan.org/t/predicting-future-event-times-that-are-currently-censored/28496)

<div class="topic-metadata">

**Author:** [@Bjoern](https://discourse.mc-stan.org/u/Bjoern)\
**Replies:** 1\
**Last updated:** [August 12, 2022, 4:14pm UTC](https://discourse.mc-stan.org/t/predicting-future-event-times-that-are-currently-censored/28496 "2022-08-12T16:14:15Z")

</div>

Let’s say we are following a cohort of people over time that will at some point have an event (e.g. death) and we think that follows a Weibull distribution. After some time, we look at the data and fit a Weibull model. W…

---

## [Evaluate Bayesian discrete-time survival model with time-varying covariates](https://discourse.mc-stan.org/t/evaluate-bayesian-discrete-time-survival-model-with-time-varying-covariates/27436)

<div class="topic-metadata">

**Author:** [@tester](https://discourse.mc-stan.org/u/tester)\
**Replies:** 1\
**Last updated:** [August 11, 2022, 1:58pm UTC](https://discourse.mc-stan.org/t/evaluate-bayesian-discrete-time-survival-model-with-time-varying-covariates/27436 "2022-08-11T13:58:14Z")

</div>

I have fitted a Bayesian discrete-time survival model with time-varying covariates as a binomial regression, adapting to the excellent material from @Solomon, here. brm\_model\_surv \<- brm( event | trials(1) ~ 0 + Int…

---

## [Evaluation of my single arm treatemt](https://discourse.mc-stan.org/t/evaluation-of-my-single-arm-treatemt/28217)

<div class="topic-metadata">

**Author:** [@Rani](https://discourse.mc-stan.org/u/Rani)\
**Replies:** 1\
**Last updated:** [July 18, 2022, 6:37pm UTC](https://discourse.mc-stan.org/t/evaluation-of-my-single-arm-treatemt/28217 "2022-07-18T18:37:55Z")

</div>

Hello all, I am going to Evaluation of combined surgical and antibiotic treatment for Diabetic foot ulcers, 30 patients with Diabetic foot ulcers were enrolled in this study, and the date of first and last visit was rec…

---

## [Manual absolute predictions from Cox model in brms?](https://discourse.mc-stan.org/t/manual-absolute-predictions-from-cox-model-in-brms/27966)

<div class="topic-metadata">

**Author:** [@AGranholm](https://discourse.mc-stan.org/u/AGranholm)\
**Replies:** 18\
**Last updated:** [July 14, 2022, 8:29am UTC](https://discourse.mc-stan.org/t/manual-absolute-predictions-from-cox-model-in-brms/27966 "2022-07-14T08:29:46Z")

</div>

Dear all, I’m interested in replicating a frequentist analysis using Bayesian methods (first using essentially non-informative priors, second using informative priors and comparing). I am planning to use the brms packag…

---

## [Vignitte recommendation for adjusted survival analysis with brms](https://discourse.mc-stan.org/t/vignitte-recommendation-for-adjusted-survival-analysis-with-brms/20948)

<div class="topic-metadata">

**Author:** [@di4oi4](https://discourse.mc-stan.org/u/di4oi4)\
**Replies:** 5\
**Last updated:** [June 16, 2022, 4:43pm UTC](https://discourse.mc-stan.org/t/vignitte-recommendation-for-adjusted-survival-analysis-with-brms/20948 "2022-06-16T16:43:28Z")

</div>

Could you please suggest a vignette for doing a survival analysis with brms package. Cox model can not be used, since the proportional hazards assumption is violated. Is there an alternative (e.g. just plotting non-propo…

---

## [Speed up sampling of Weibull Survival Model](https://discourse.mc-stan.org/t/speed-up-sampling-of-weibull-survival-model/26710)

<div class="topic-metadata">

**Author:** [@Tikavdm](https://discourse.mc-stan.org/u/Tikavdm)\
**Replies:** 3\
**Last updated:** [April 7, 2022, 12:58pm UTC](https://discourse.mc-stan.org/t/speed-up-sampling-of-weibull-survival-model/26710 "2022-04-07T12:58:16Z")

</div>

I have Weibull model for left-truncated and right-censored data with time-varying predictors. The code below runs about 2.5-3 hours on 15k records. I need to run this on about 300k records. Can anyone spot any obvious im…

---

## [Variable Selection in Parametric Survival Analysis Models](https://discourse.mc-stan.org/t/variable-selection-in-parametric-survival-analysis-models/26690)

<div class="topic-metadata">

**Author:** [@Tikavdm](https://discourse.mc-stan.org/u/Tikavdm)\
**Replies:** 18\
**Last updated:** [March 14, 2022, 3:02pm UTC](https://discourse.mc-stan.org/t/variable-selection-in-parametric-survival-analysis-models/26690 "2022-03-14T15:02:38Z")

</div>

I have a large survival analysis model (Weibull) with about 300k observations on 50+ variables. It takes a very long time to run (\>1d), so for that practical reasons I do not want to follow iterative approaches that invo…

---

## [Rstanarm survival: options for dealing with violated proportional hazards](https://discourse.mc-stan.org/t/rstanarm-survival-options-for-dealing-with-violated-proportional-hazards/21548)

<div class="topic-metadata">

**Author:** [@di4oi4](https://discourse.mc-stan.org/u/di4oi4)\
**Replies:** 11\
**Last updated:** [December 23, 2021, 12:08pm UTC](https://discourse.mc-stan.org/t/rstanarm-survival-options-for-dealing-with-violated-proportional-hazards/21548 "2021-12-23T12:08:52Z")

</div>

I have a relatively large survival data (n \> 10 000), including 5 predictors. Predictors p1 and p2 are continuous, the rest are categorical. Group variable is the one I am interested in, the remaining are just used for a…

---

## [Issue with Survival Models](https://discourse.mc-stan.org/t/issue-with-survival-models/25079)

<div class="topic-metadata">

**Author:** [@phcooney](https://discourse.mc-stan.org/u/phcooney)\
**Replies:** 3\
**Last updated:** [November 26, 2021, 11:16pm UTC](https://discourse.mc-stan.org/t/issue-with-survival-models/25079 "2021-11-26T23:16:04Z")

</div>

I am running into an issue fitting a three parameter generalized gamma survival model. I am using the parameterization from the flexsurv package and have checked that survival and density functions are correct. It seems…

---

## [Trouble writing survival model with time-varying covariates](https://discourse.mc-stan.org/t/trouble-writing-survival-model-with-time-varying-covariates/23824)

<div class="topic-metadata">

**Author:** [@tzlange16](https://discourse.mc-stan.org/u/tzlange16)\
**Replies:** 1\
**Last updated:** [August 11, 2021, 3:48am UTC](https://discourse.mc-stan.org/t/trouble-writing-survival-model-with-time-varying-covariates/23824 "2021-08-11T03:48:53Z")

</div>

Hi Stanners, I’m pretty new to stan and I’m having a dickens of a time trying to properly write a survival model I’m working on. I’m conducting a survival analysis of organizations that have both time-fixed and time-va…

---

## [Complementary lognormal\_cdf(reals y, reals mu, reals sigma)](https://discourse.mc-stan.org/t/complementary-lognormal-cdf-reals-y-reals-mu-reals-sigma/23491)

<div class="topic-metadata">

**Author:** [@MaryBo](https://discourse.mc-stan.org/u/MaryBo)\
**Replies:** 11\
**Last updated:** [July 18, 2021, 7:53am UTC](https://discourse.mc-stan.org/t/complementary-lognormal-cdf-reals-y-reals-mu-reals-sigma/23491 "2021-07-18T07:53:07Z")

</div>

I want to customize my likelihood function. In my customized LL, I need the lognormal complementary cumulative distribution function of y. I cannot use lognormal\_lccdf as it is the log of what I need. I cannot use 1-logn…

---

## [Survival analysis with multiple outcome](https://discourse.mc-stan.org/t/survival-analysis-with-multiple-outcome/22558)

<div class="topic-metadata">

**Author:** [@MaryBo](https://discourse.mc-stan.org/u/MaryBo)\
**Replies:** 5\
**Last updated:** [May 27, 2021, 2:44pm UTC](https://discourse.mc-stan.org/t/survival-analysis-with-multiple-outcome/22558 "2021-05-27T14:44:56Z")

</div>

Hi, I have a dataset with two duration outcome variables and many explanatory variables. The outcome variables can be censored and uncensored. So, I am using parametric survival analysis to model them. Example: outcom…

[Next page](https://discourse.mc-stan.org/tag/survival/180.md?match_all_tags=true&page=1&tags%5B%5D=survival)
