How to change my interval within the function stan_glm() in R?

87 views Asked by At

when i use stan_glm(), i dont know how to change my interval.

my code:

mod_rstan <- stan_glm(
    formula = f,
    data = dat,
    family = gaussian(), 
    prior_intercept = normal(0, 10),
    prior = normal(0, 2.5),
    prior_aux = cauchy(0, 5),
    cores = 3,
    chains = 3,
    iter = 2000)
     s_rstan <- summary(mod_rstan)

I get a result as the following picture showing: enter image description here

how can we change the interval from 10% to 2.5% and the another from 90% to 97.5%?

1

There are 1 answers

2
user2974951 On

The estimation of the credible interval for the coefficients is performed in the summary call, not the stan_glm call. You can adjust the width of the interval with the argument probs, summary(example_model, probs = c(0.025, 0.975)).