bf_contingency_tab: Bayesian contingency table analysis.

Description Usage Arguments Author(s) See Also Examples

Description

Bayesian contingency table analysis.

Usage

1
2
3
bf_contingency_tab(data, main, condition, sampling.plan = "indepMulti",
  fixed.margin = "rows", prior.concentration = 1, caption = NULL,
  output = "null", k = 2, ...)

Arguments

data

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

main

The variable to use as the rows in the contingency table.

condition

The variable to use as the columns in the contingency table.

sampling.plan

Character describing the sampling plan. Possible options are "indepMulti" (independent multinomial; default), "poisson", "jointMulti" (joint multinomial), "hypergeom" (hypergeometric). For more, see ?BayesFactor::contingencyTableBF().

fixed.margin

For the independent multinomial sampling plan, which margin is fixed ("rows" or "cols"). Defaults to "rows".

prior.concentration

Specifies the prior concentration parameter, set to 1 by default. It indexes the expected deviation from the null hypothesis under the alternative, and corresponds to Gunel and Dickey's (1974) "a" parameter.

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", which will contain text for evidence in favor of the null hypothesis or H0) or "alternative" (or "title" or "H1") or "results", which will return a dataframe with results all the details).

k

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

...

further arguments to be passed to or from methods.

Author(s)

Indrajeet Patil

See Also

bf_corr_test, bf_oneway_anova, bf_two_sample_ttest

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# for reproducibility
set.seed(123)
library(ggstatsplot)

# to get caption (in favor of null)
bf_contingency_tab(
  data = mtcars,
  main = am,
  condition = cyl,
  fixed.margin = "cols"
)

# to get caption (in favor of alternative)
bf_contingency_tab(
  data = mtcars,
  main = am,
  condition = cyl,
  fixed.margin = "rows",
  output = "alternative"
)

# to see results
bf_contingency_tab(
  data = mtcars,
  main = am,
  condition = cyl,
  sampling.plan = "jointMulti",
  fixed.margin = "rows",
  prior.concentration = 1
)

IndrajeetPatil/ggstatsplot documentation built on June 14, 2019, 9:55 a.m.