Hi!

I used the data “birthwt” in MASS package to constructed a model with stan_lm function in rstanarm package. I can get coefficients and Bayesian uncertainty intervals using coef() and posterior_interval() functions. In the models constructed with lm(), we can get P values from the summary() function. However, I can’t find any function to get P values for the variables in the model with stan_lm.

My codes are as follows:

data(“birthwt”, package = “MASS”)

birthwt$race <- factor(birthwt$race, levels = 1:3,

labels = c(“white”, “black”, “other”))

birthwt$bwt <- birthwt$bwt / 1000

birthwt$low <- factor(birthwt$low, levels = 0:1, labels = c(“no”, “yes”))

post1 <- stan_lm(-bwt ~ smoke + age + race + ptl + ht + ftv,

data = birthwt, prior = R2(0.5))

summary(post1)

post1$coefficients

posterior_interval(post1, prob = 0.95)