Description Usage Arguments See Also Examples
View source: R/bf_contingency_tab.R
Bayes Factor for contingency table analysis
1 2 3 4 5 6 7 8 9 10 11 12 13 14 
data 
A dataframe (or a tibble) from which variables specified are to be taken. A matrix or a table will not be accepted. 
x 
The variable to use as the rows in the contingency table. 
y 
The variable to use as the columns in the contingency
table. Default is 
counts 
A string naming a variable in data containing counts, or 
ratio 
A vector of proportions: the expected proportions for the
proportion test (should sum to 1). Default is 
sampling.plan 
Character describing the sampling plan. Possible options
are 
fixed.margin 
For the independent multinomial sampling plan, which
margin is fixed ( 
prior.concentration 
Specifies the prior concentration parameter, set
to 
top.text 
Text to display on top of the Bayes Factor message. This is
mostly relevant in the context of 
output 
If 
k 
Number of digits after decimal point (should be an integer)
(Default: 
... 
Arguments passed on to

bf_corr_test
, bf_oneway_anova
,
bf_ttest
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23  # for reproducibility
set.seed(123)
library(tidyBF)
#  association tests 
# to get dataframe
bf_contingency_tab(
data = mtcars,
x = am,
y = cyl,
output = "dataframe"
)
#  goodness of fit tests 
# to get expression
bf_contingency_tab(
data = mtcars,
x = am,
prior.concentration = 10,
output = "expression"
)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.