View source: R/alphaN_report.R
| alphaN_report | R Documentation |
Generates a short, human-readable Markdown report that records every input behind a calibrated alpha level together with the result: the sample size, the evidence target, the calibration method and its prior settings, the resulting alpha, and the decision rule. The report is designed to be attached to a preregistration protocol or a supplementary appendix, so that an alpha level chosen before data collection leaves a citable trace. It mirrors the downloadable report of the package's companion Shiny application.
alphaN_report(
n,
BF = 1,
method = "JAB",
upper = 1,
de = 0.5,
nu = NULL,
r = NULL,
q = 1,
p = 0,
file = NULL,
width = 72,
power_at = NULL
)
n |
Sample size. A single positive number (one report describes one design). |
BF |
Target Bayes factor. A single positive number. |
method |
Which Bayes factor to calibrate alpha to. The first four
options invert Jeffreys' approximate Bayes factor and differ in the choice
of the prior fraction 'b'; the last two invert the exact test-statistic
Bayes factors of Klauer et al. (2025), whose priors center the alternative
hypothesis on a prespecified effect size
|
upper |
The upper limit for the range of realistic effect sizes. Only
relevant when method="balanced". Defaults to 1 such that the range of
realistic effect sizes is uniformly distributed between 0 and 1, U(0,1).
Conceptually, |
de |
The prespecified (targeted) effect size in standardized units:
Cohen's d for |
nu |
Degrees of freedom of the prior t distribution for methods "ES"
and "moment". The default, NULL, uses the values recommended by Klauer
et al. (2025): 3 for "ES" and |
r |
Scale of the two prior mixture components for method "ES". The
default, NULL, uses the recommendation of Klauer et al. (2025),
|
q |
Number of coefficients tested jointly. Only used by methods "ES"
and "moment". The default, 1, is the test of a single coefficient; for
|
p |
Number of parameters retained in the model under the null,
including any intercept. Only used by methods "ES" and "moment". The
effective sample size of Klauer et al. (2025) is |
file |
Optional path. If supplied, the report is also written to this file. |
width |
Maximum line width of the report; longer lines are wrapped with a hanging indent. Defaults to 72 characters. |
power_at |
Optional numeric vector of standardized effect sizes. If
supplied, the report includes the power of the calibrated test against
each of them (computed with |
The report as a character vector of lines, invisibly. The report is printed to the console.
alphaN(), alphaN_power()
alphaN_report(n = 1000, BF = 3, method = "JAB")
# Effect-size calibration with a power section, written to a file
f <- tempfile(fileext = ".md")
alphaN_report(n = 1000, BF = 3, method = "ES", de = 0.5,
power_at = c(0.1, 0.2, 0.5), file = f)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.