Survival analysis with simulated data - the model doesn't recover the parameters that I used to build the data

I was generating censored observations randomly, when I should have censored observations beyond a specific threshold:

d<-data.frame(days_to_event=c(black,other),color_id=c(rep(1,1000),rep(2,1000)))
d<- d %>% mutate(adopted = if_else(days_to_event >= 200, 0, 1))

Results here:

Inference for Stan model: model.
4 chains, each with iter=2000; warmup=1000; thin=1; 
post-warmup draws per chain=1000, total post-warmup draws=4000.

     mean se_mean   sd 2.5%  25%  50%  75% 97.5% n_eff Rhat
a[1] 4.01       0 0.03 3.95 3.99 4.01 4.03  4.08  3027    1
a[2] 3.50       0 0.03 3.43 3.47 3.49 3.52  3.56  3368    1

Samples were drawn using NUTS(diag_e) at Wed Apr 14 15:46:05 2021.
For each parameter, n_eff is a crude measure of effective sample size,
and Rhat is the potential scale reduction factor on split chains (at 
convergence, Rhat=1).

> 1/exp(4.01)
[1] 0.0181334
> 1/exp(3.50)
[1] 0.03019738

I tried to delete this post because the problem was not related to model specification or with Stan code, but it seems only an admin can do it.

3 Likes