Learn R Programming

orchaRd (version 2.2.1)

magnitude_effects: Magnitude Effects using SAFE Bootstrap

Description

Computes the magnitude effect size and its variance using the SAFE bootstrap method for either independent or dependent samples.

Usage

magnitude_effects(
  x1bar,
  x2bar,
  sd1,
  sd2,
  n1,
  n2,
  min_kept = 2000,
  chunk_init = 4000,
  chunk_max = 2e+06,
  max_draws = Inf,
  patience_noaccept = 5,
  paired = FALSE,
  r = NULL,
  seed = 565
)

Value

A list containing the point estimate, variance, number of kept samples, total draws, number of attempts, and status.

Arguments

x1bar

Mean of group 1.

x2bar

Mean of group 2.

sd1

Standard deviation of group 1.

sd2

Standard deviation of group 2.

n1

Sample size of group 1.

n2

Sample size of group 2.

min_kept

Minimum number of accepted bootstrap samples to keep. Default is 2000.

chunk_init

Initial chunk size for bootstrap sampling. Default is 4000.

chunk_max

Maximum chunk size for bootstrap sampling. Default is 2e6.

max_draws

Maximum total number of bootstrap draws. Default is Inf.

patience_noaccept

Number of consecutive chunks with no accepted samples before stopping. Default is 5.

paired

Logical, whether the samples are paired. Default is FALSE.

r

Optional correlation between groups for dependent samples. Required if `paired` is TRUE.

seed

Random seed for reproducibility. Default is 565.

Examples

Run this code
# \donttest{
# min_kept/chunk_init are set LOW here for speed; use the
# defaults for real analyses.
# Independent samples
magnitude_effects(x1bar = 10, x2bar = 7, sd1 = 2, sd2 = 3,
                  n1 = 30, n2 = 30, min_kept = 200, chunk_init = 400)
# Dependent (paired) samples, given the correlation between groups
magnitude_effects(x1bar = 10, x2bar = 7, sd1 = 2, sd2 = 3,
                  n1 = 30, n2 = 30, paired = TRUE, r = 0.5,
                  min_kept = 200, chunk_init = 400)
# }

Run the code above in your browser using DataLab