I’m very new to modeling in Stan and was hoping someone might aim me in the right direction for a particular model structure using rstan or cmdstan. This is actually my first question in the forum also, so please forgive any deviance from protocol.
I’m wanting to compare median salmon fry emergence timing among a number of study sites.
The underlying data are from emergence traps, each stocked with either 100 or 200 fertilized eggs in the fall. Surviving fry emerged in the spring ~ 200 d later and were counted on a weekly basis.
the data form:
time (days)| event (emergence [0,1]) | site [1:n]
These data are censored for those fry that either perished (unobserved) sometime during the course of the study, or perhaps would have emerged later had the experiment lasted longer (some traps were lost to high flows before the end of the experiment). I believe time would be considered discrete in that the traps were checked on a weekly basis rather than daily. I also have a few covariates that I would like to include, such as study year and parentage.
My assumption is that this would require a discrete time-to-event model… but I’m unclear on how to approach this in Stan. Might there be an example somewhere with a similar data type?
Thank you in advance.