How to write a basic survival model assuming the time follows the exponential distribution in rstan?

Hi everyone, I am quite new to Stan and I am recently using rstan to build a very basic survival model assuming the followup time follows exponential distribution. Exp(theta).

I am wondering what should I write in this model as it has uncensored followup time and censored followup time— How should I reflect this in exponential model? Thanks !!!

There’s a section on censored data in the manual:

Is that your situation?

Thank you bbbales2, this is my situation… Just wondering how to do this in exponential distribution ?

The same sorts of lcdf/lccdf functions exist for the exponentials as for the normal distribution:

So if this is the situation, then follow the guide in the manual and adapt the math for the particular censoring you have (instead of a normal distribution do stuff with the exponential).


kkk, seems worked out…

Cool glad it worked out! The user guide is really handy for these types of examples.