Description Usage Arguments Note Examples
Estimate ANOVA-type models with rstanarm
1 2 3 4 5 | stanova_lm(formula, data, check_contrasts = "contr.bayes", ...)
stanova_aov(formula, data, check_contrasts = "contr.bayes", ...)
stanova_glm(formula, data, family, check_contrasts = "contr.bayes", ...)
|
formula |
a formula describing the model to be fitted. Passed to
|
data |
|
check_contrasts |
|
... |
further arguments passed to the |
family |
|
stanova_aov
is a copy of stanova_lm
. All functions discussed here
are only wrappers around stanova
setting model_fun
to "glm"
(and
family = "gaussian"
for stanova_lm
).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | fit_warp <- stanova_lm(breaks ~ wool * tension, data = warpbreaks,
prior = rstanarm::student_t(3, 0, 20, autoscale = FALSE),
chains = 2, iter = 500)
summary(fit_warp)
### from: ?predict.glm
## example from Venables and Ripley (2002, pp. 190-2.)
dfbin <- data.frame(
ldose = rep(0:5, 2),
numdead = c(1, 4, 9, 13, 18, 20, 0, 2, 6, 10, 12, 16),
sex = factor(rep(c("M", "F"), c(6, 6)))
)
budworm.lg <- stanova_glm(cbind(numdead, numalive = 20-numdead) ~ sex*ldose,
data = dfbin,
family = binomial,
chains = 2, iter = 500)
## note: only sex is categorical, ldose is continuous
summary(budworm.lg)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.