Learn R Programming

BayesPower (version 1.0.1)

BFpower.f: Sample size determination for Bayesian F-test

Description

Perform sample size determination or the calculation of compelling and misleading evidence for a Bayesian F-test.

Usage

BFpower.f(
  interval = NULL,
  D = NULL,
  target = NULL,
  FP = NULL,
  p = NULL,
  k = NULL,
  model = NULL,
  dff = NULL,
  rscale = NULL,
  f_m = NULL,
  model_d = NULL,
  dff_d = NULL,
  rscale_d = NULL,
  f_m_d = NULL,
  de_an_prior = NULL,
  N = NULL,
  mode_bf = NULL,
  direct = NULL,
  e = NULL
)

Value

A data frame with the following columns:

  • p(BF10 > D | H1): Probability of obtaining compelling evidence in favor of the alternative hypothesis when the alternative is true.

  • p(BF01 > D | H1): Probability of obtaining misleading evidence in favor of the null hypothesis when the alternative is true.

  • p(BF01 > D | H0): Probability of obtaining compelling evidence in favor of the null hypothesis when the null is true.

  • p(BF10 > D | H0): Probability of obtaining misleading evidence in favor of the alternative hypothesis when the null is true.

  • Required N: The required sample size or the sample size input by the users.

If sample size determination fails, the function returns NULL.

Arguments

interval

Character or integer (0 or 1). If "1", Bayes factor with a point null against a composite alternative hypothesis; otherwise Bayes factor with interval null and alternative hypotheses.

D

The bound of compelling evidence.

target

The targeted true positive rate (if direct = "h1") or true negative rate (if direct = "h0").

FP

The targeted false positive rate (if direct = "h1") or false negative rate (if direct = "h0").

p

Number of predictors in the reduced model.

k

Number of predictors in the full model.

model

Statistical model of the analysis prior under the alternative hypothesis: effect size prior ("effectsize") or Moment prior ("Moment")

dff

Degrees of freedom for the analysis prior under the alternative hypothesis.(must be >3 if moment prior is used)

rscale

Scaling parameter for the analysis effect size prior.

f_m

Cohen's f effect size parameter for the analysis prior.

model_d

Statistical model of the design prior under the alternative hypothesis:: effect size prior ("effectsize"), Moment prior ("Moment"), or Point prior ("Point")

dff_d

Degrees of freedom for the design prior under the alternative hypothesis. (must be >3 if moment prior is used)

rscale_d

Scaling parameter for the design effect size prior.

f_m_d

Cohen's f effect size parameter for the design prior or the point design prior.

de_an_prior

Integer (0 or 1). If 1, analysis and design priors under the alternative are the same; if 0, they are not.

N

Sample size.

mode_bf

Integer (0 or 1). If 1, sample size determination; if 2, N is needed for the calculation of probabilities of compelling and misleading evidence.

direct

If "h1", BF10; if "h0", BF01.

e

The bounds for the interval Bayes factor (used when interval = 0).

Examples

Run this code
BFpower.f(
 inter = "1",
 D = 3,
 target = 0.8,
 p = 1,
 k = 2,
 model = "Moment",
 dff = 1,
 f_m = 0.1,
 de_an_prior = 1,
 mode_bf = 1,
 direct = "h1"
)

Run the code above in your browser using DataLab