-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
consistent outputs across Bayesian and frequentist tests #630
Comments
Another improvement we can do is display the |
library(BayesFactor)
#> Loading required package: coda
#> Loading required package: Matrix
#> ************
#> Welcome to BayesFactor 0.9.12-4.2. If you have questions, please contact Richard Morey ([email protected]).
#>
#> Type BFManual() to open the manual.
#> ************
library(parameters)
data(raceDolls)
# Bayesian
ttestBF(mtcars$wt, mu = 3) |> parameters(cohens_d = TRUE)
#> # Fixed Effects
#>
#> Parameter | Median | 95% CI | Cohen's d | d CI | pd | % in ROPE | Prior | BF | Method
#> -----------------------------------------------------------------------------------------------------------------------------------
#> Difference | 0.20 | [-0.18, 0.54] | 0.19 | [-0.16, 0.54] | 85.72% | 24.78% | Cauchy (0 +- 0.71) | 0.387 | Bayesian t-test
# frequentist
t.test(mtcars$wt, mu = 3) |> parameters(standardized_d = TRUE)
#> One Sample t-test
#>
#> Parameter | mu | Difference | 95% CI | t(31) | Cohen's d | d 95% CI | p
#> ----------------------------------------------------------------------------------------
#> mtcars$wt | 3.00 | 0.22 | [2.86, 3.57] | 1.26 | 0.22 | [-0.13, 0.58] | 0.218
#>
#> Alternative hypothesis: true mean is not equal to 3
# Bayesian
contingencyTableBF(raceDolls, sampleType = "indepMulti", fixedMargin = "cols") |>
parameters(cramers_v = TRUE)
#> Warning: Could not estimate a good default ROPE range. Using 'c(-0.1, 0.1)'.
#> # Fixed Effects
#>
#> Parameter | Cramer's V | Cramers CI | Prior | BF | Method
#> ---------------------------------------------------------------------------------------------------------------------
#> Ratio | 0.16 | [0.01, 0.29] | Independent multinomial (0 +- 1) | 1.81 | Bayesian contingency table analysis
# frequentist
chisq.test(raceDolls) |>
parameters(cramers_v = TRUE)
#> Pearson's Chi-squared test with Yates' continuity correction
#>
#> Chi2(1) | Cramer's V | Cramers 95% CI | p
#> ---------------------------------------------
#> 3.86 | 0.17 | [0.03, 1.00] | 0.050 Created on 2021-11-07 by the reprex package (v2.0.1) |
Thanks! 🤩 This is another minor inconsistency we can get rid of:
|
Also, library(BayesFactor)
library(parameters)
library(statsExpressions)
data(raceDolls)
options(tibble.width = Inf)
contingencyTableBF(raceDolls, sampleType = "indepMulti", fixedMargin = "cols") |>
parameters(cramers_v = TRUE) |>
as.data.frame()
#> Parameter Median CI CI_low CI_high Cramers_v Cramers_CI_low Cramers_CI_high
#> 1 Ratio NA NA NA NA 0.1663267 0.01151098 0.2932553
#> pd ROPE_Percentage Prior_Distribution Prior_Location Prior_Scale
#> 1 NA NA independent multinomial 0 1
#> BF Method
#> 1 1.814856 Bayesian contingency table analysis Created on 2021-11-07 by the reprex package (v2.0.1) This is present in library(BayesFactor)
library(effectsize)
data(raceDolls)
contingencyTableBF(raceDolls, sampleType = "indepMulti", fixedMargin = "cols") |>
effectsize() |>
as.data.frame()
#> Cramers_v CI CI_low CI_high
#> 1 0.1620444 0.95 0.01022901 0.2918251 Created on 2021-11-07 by the reprex package (v2.0.1) |
Basically, we need to have one-row dataframe summaries for
BFBayesFactor
objects, the same way we have them forhtest
objects.t-test
contingency table
Created on 2021-11-07 by the reprex package (v2.0.1)
The text was updated successfully, but these errors were encountered: