# \donttest{
## Proportional odds logistic regression ##
if(require(rstanarm) & require(MASS)){
m1 <- stan_polr(Sat ~ Infl + Type,
data = MASS::housing,
prior = rstanarm::R2(0.2, 'mean'),
refresh = 0,
iter = 500)
# marginal effects holding covariates at means #
bayesOrdinalMargEffF(m1,
marginal_effect = "Infl",
start_value = "Low",
end_value = "High",
at = list(Type = c("Tower", "Apartment")),
at_means = TRUE,
n_draws = 500)
}
# }
Run the code above in your browser using DataLab