Dear all,

I am currently trying to fit the model with the function stan_surv in rstanarm. And since I would fit with the frailty term, then I write the code as follows, which (1|id) uses as frailty term.

mod1 ← stan_surv(Surv(start, stop, status)~ x.1 + x.2 + (1|id),

basehaz = “bs”, basehaz_ops = list(degree = 3, knots =kn),

prior = beta_prior,

prior_intercept = normal(0,20),

prior_aux = normal(0,10),

data=dat,

chains=1,

cores=1,

iter=10000, warmup=5000)

However, I intend to assign Gamma(1/sigma, sigma) as the prior distribution for the frailty term. Firstly, I didn’t see the option of the Gamma distribution (maybe I missed it). Secondly, I’m not sure how to assign a prior distribution for hyperparameter sigma in this **prior_intercept** here or if it is possible to do so.

My other question is the number of coefficients estimated from using basehaz_ops. I want to use the cubic B-spline. I have 5 inner knots. When I input 5 values as kn into basehaz_ops=list(degree = 3, knots =kn), the results only provide 8 estimated coefficients. I’m thinking 2 boundary knots + 5 inner knots + order 4, it is supposed to estimate 11 coefficients. Please correct me if I’m wrong. So I’m wondering why it only provides 8 coefficients here. How can I get 11 estimates?

Please feel free to share any insight about the questions.

Thank you very much in advance!