Bayesian hypothesis tests and credible intervals
bayes_inference(
y,
x = NULL,
data,
type = c("ci", "ht"),
statistic = c("mean", "proportion"),
success = NULL,
null = NULL,
cred_level = 0.95,
alternative = c("twosided", "less", "greater"),
hypothesis_prior = c(H1 = 0.5, H2 = 0.5),
n_0 = 1,
beta_prior = NULL,
beta_prior1 = NULL,
beta_prior2 = NULL,
verbose = TRUE,
show_summ = verbose,
show_res = verbose,
show_plot = verbose
)
Response variable, can be numerical or categorical
Explanatory variable, categorical (optional)
Name of data frame that y and x are in
of inference; "ci" (credible interval) or "ht" (hypothesis test)
population parameter to estimate: mean or proportion
which level of the categorical variable to call "success", i.e. do inference on
null value for the hypothesis test
confidence level, value between 0 and 1
direction of the alternative hypothesis; "less","greater", or "twosided"
discrete prior for H1 and H2, default is the uniform prior: c(H1=0.5,H2=0.5)
Prior sample size for calculating the Bayes factor of the twosided test of one mean
beta priors for p (or p_1 and p_2) for one or two proportion inference
whether output should be verbose or not, default is TRUE
print summary stats, set to verbose by default
print results, set to verbose by default
print inference plot, set to verbose by default
Results of inference task performed