Skip to content

Set Alpha Based On Sample Size Using Bayes Factors

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

jespernwulff/alphaN

Repository files navigation

alphaN

CRAN Version Downloads Downloads

The goal of alphaN is to help the user set their significance level as a function of the sample size. The function alphaN allows users to set the significance level as function of the sample size based on the evidence and the prior features they desire. The function JABt and JABp converts test statistics and $p$-values into sample size dependent Bayes factors. JAB_plot plots the Bayes factor as a function of the $p$-value, and alphaN_plot plots the alpha level as a function of sample size for a given Bayes factor.

Calculations are based on Wulff & Taylor (2024). If you enjoy the package, please consider citing the paper.

If you’re not an R user, you may also be interested in the associated Shiny app.

Installation

To install the latest release version from CRAN use

install.packages("alphaN")

You can install the development version of alphaN from GitHub with:

# install.packages("devtools")
devtools::install_github("jespernwulff/alphaN")

Example

Here is an example: We are planning to run a linear regression model with 1000 observations. We thus set n = 1000. The default BF is 1 meaning that we want to avoid Lindley’s paradox, i.e. we just want the null and the alternative to be at least equally likely when we reject the null.

library(alphaN)

alpha <- alphaN(n = 1000, BF = 1)
alpha
#> [1] 0.008582267

Therefore, to obtain evidence of at least 1, we should set our alpha to 0.0086.

About

Set Alpha Based On Sample Size Using Bayes Factors

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages