Learn R Programming

BayesPower (version 1.0.2)

BF10.ttest.TwoSample: Bayes Factor for Two-Sample Bayesian t-Test

Description

Compute the Bayes factor (BF10) for a two-sample independent-samples t-test. Supports both point-null and interval-null hypotheses.

Usage

BF10.ttest.TwoSample(
  tval,
  N1,
  N2,
  prior_analysis,
  location,
  scale,
  dff,
  alternative,
  ROPE = NULL
)

Value

A list of class BFvalue_t containing:

type

Character string describing the test type.

bf10

Computed Bayes factor BF10.

tval

Observed t-value.

df

Degrees of freedom (currently NA / not computed).

analysis_h1

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

alternative

Hypothesis tested ("two.sided", "greater", or "less").

ROPE

Interval bounds used, if any.

N1

Sample size of group 1 .

N2

Sample size of group 2 .

d

Numeric, observed Cohen's d.

p.value

Numeric, p.value.

Arguments

tval

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

N1

Numeric integer. Sample size of group 1 (must be > 2, will be rounded to nearest integer).

N2

Numeric integer. Sample size of group 2 (must be > 2, will be rounded to nearest integer).

prior_analysis

Character. Analysis prior under the alternative hypothesis: "Normal", "Moment" (normal-moment prior), or "t-distribution".

location

Numeric scalar. Location parameter of the analysis prior.

scale

Numeric scalar > 0. Scale parameter of the analysis prior.

dff

Numeric scalar. Degrees of freedom for the analysis prior (required if prior_analysis = "t-distribution"; ignored otherwise).

alternative

Character. The direction of the alternative hypothesis two-sided ("two.sided"), right-sided ("greater"), or left-sided ("less").

ROPE

Optional numeric. Bounds for an interval null:

  • For "two.sided", must be a numeric vector of length 2 with distinct finite values.

  • For "greater", must be a single numeric scalar > 0.

  • For "less", must be a single numeric scalar < 0.

Examples

Run this code
BF10.ttest.TwoSample(
 tval = -1.148,
 N1 = 53,
 N2 = 48,
 prior_analysis = "t-distribution",
 location = 0,
 scale = 0.707,
 dff = 1,
 alternative = "two.sided",
 ROPE = c(-0.36,0.36))

Run the code above in your browser using DataLab