bf01: z-test Bayes factor

bf01R Documentation

z-test Bayes factor

Description

This function computes the Bayes factor that quantifies the evidence that the data (in the form of an asymptotically normally distributed parameter estimate with standard error) provide for a point null hypothesis with a normal prior assigned to the parameter under the alternative. The standard error is assumed to be known.

Usage

bf01(estimate, se, null = 0, pm, psd, log = FALSE)

Arguments

estimate

Parameter estimate

se

Standard error of the parameter estimate

null

Parameter value under the point null hypothesis. Defaults to 0

pm

Mean of the normal prior assigned to the parameter under the alternative

psd

Standard deviation of the normal prior assigned to the parameter under the alternative. Set to 0 to obtain a point prior at the prior mean

log

Logical indicating whether the natural logarithm of the Bayes factor should be returned. Defaults to FALSE

Value

Bayes factor in favor of the null hypothesis over the alternative (\text{BF}_{01} > 1 indicates evidence for the null hypothesis, whereas \text{BF}_{01} < 1 indicates evidence for the alternative)

Author(s)

Samuel Pawel

Examples

bf01(estimate = 0.2, se = 0.05, null = 0, pm = 0, psd = 2)


bfpwr documentation built on June 8, 2025, 1:40 p.m.