Learn R Programming

BayesPower (version 1.0.2)

BF10.ttest.OneSample: Bayes Factor for a One-Sample Bayesian t-Test

Description

Computes the Bayes factor (BF10) for a one-sample t-test, comparing an observed t-value against either a point null hypothesis or an interval null hypothesis.

Usage

BF10.ttest.OneSample(
  tval,
  df,
  prior_analysis,
  location,
  scale,
  dff,
  alternative,
  ROPE = NULL
)

Value

A list of class BFvalue_t containing:

type

Character, indicating "One-sample t-test".

bf10

Numeric, the Bayes factor (BF10).

tval

Observed t-value.

df

Degrees of freedom.

analysis_h1

List with the analysis prior parameters: prior_analysis, location, scale, and optionally dff.

alternative

Character, the direction of the alternative hypothesis.

ROPE

Optional numeric vector of interval null bounds.

d

Numeric, observed Cohen's d.

p.value

Numeric, p.value.

Arguments

tval

Numeric scalar. Observed t-value from the one-sample t-test.

df

Numeric scalar. Degrees of freedom of the t-test (must be >= 1).

prior_analysis

Character string. Statistical model for the analysis prior under the alternative hypothesis. Choices are:

"Normal"

Normal distribution.

"Moment"

Normal moment prior.

"t-distribution"

Scaled t-distribution.

location

Numeric scalar. Location parameter for the analysis prior under the alternative hypothesis.

scale

Numeric scalar. Scale parameter for the analysis prior under the alternative hypothesis (must be > 0).

dff

Numeric scalar. Degrees of freedom for the t-distribution prior (only required if prior_analysis = "t-distribution"; must be > 0). Ignored otherwise.

alternative

Character string. The direction of the alternative hypothesis. One of:

"!="

Two-sided (difference from 0).

">"

Right-sided (greater than 0).

"<"

Left-sided (less than 0).

ROPE

Optional numeric vector. Specifies bounds for an interval null hypothesis. For:

Two-sided ("two.sided")

Must be a numeric vector of length 2 with two distinct finite values.

Right-sided ("greater")

Must be a numeric scalar > 0.

Left-sided ("less")

Must be a numeric scalar < 0.

Examples

Run this code
BF10.ttest.OneSample(
tval = 2,
df = 50,
prior_analysis = "t-distribution",
location = 0,
scale = 0.707,
dff = 1,
alternative = "two.sided")


Run the code above in your browser using DataLab