Learn R Programming

tidyBF (version 0.3.0)

bf_oneway_anova: Bayesian one-way analysis of variance

Description

Bayesian one-way analysis of variance

Usage

bf_oneway_anova(
  data,
  x,
  y,
  bf.prior = 0.707,
  caption = NULL,
  output = "results",
  paired = FALSE,
  k = 2L,
  ...
)

Arguments

data

A dataframe (or a tibble) from which variables specified are to be taken. A matrix or tables will not be accepted.

x

The grouping variable from the dataframe data.

y

The response (a.k.a. outcome or dependent) variable from the dataframe data.

bf.prior

A number between 0.5 and 2 (default 0.707), the prior width to use in calculating Bayes factors.

caption

Text to display as caption (will be displayed on top of the Bayes Factor caption/message).

output

Can either be "null" (or "caption" or "H0" or "h0"), which will return expression with evidence in favor of the null hypothesis, or "alternative" (or "title" or "H1" or "h1"), which will return expression with evidence in favor of the alternative hypothesis, or "results", which will return a dataframe with results all the details).

paired

Decides whether the design is repeated measures or not (Default: FALSE).

k

Number of digits after decimal point (should be an integer) (Default: k = 2L).

...

Additional arguments passed to parameters::model_parameters.BFBayesFactor().

See Also

bf_contingency_tab, bf_corr_test, bf_ttest

Examples

Run this code
# NOT RUN {
# setup
set.seed(123)

# between-subjects -------------------------------------------------------
bf_oneway_anova(
  data = iris,
  x = Species,
  y = Sepal.Length,
  bf.prior = 0.8
)

# within-subjects -------------------------------------------------------
bf_oneway_anova(
  data = bugs_long,
  x = condition,
  y = desire,
  paired = TRUE
)

# expression -------------------------------------------------------
bf_oneway_anova(
  data = bugs_long,
  x = condition,
  y = desire,
  paired = TRUE,
  output = "null"
)
# }

Run the code above in your browser using DataLab