Skip to contents

Replicate the permutation computations

Usage

replicate_permutation(
  number_permutations = 999,
  future_seed = TRUE,
  exact = FALSE,
  scheme = c("auto", "sign", "moderators"),
  assume_exchangeable = FALSE,
  alternative = c("two.sided", "greater", "less"),
  max_exact = 50000L,
  ...
)

Arguments

number_permutations

The number of permutations to perform, default is 999.

future_seed

Seed control forwarded to future.apply::future_lapply(future.seed = ...).

exact

Enumerate every sign pattern or row permutation. Default FALSE.

scheme

auto selects sign changes for intercept-only models and moderator permutation otherwise. sign requires independent symmetric errors around zero.

assume_exchangeable

Set TRUE only when moderator blocks are exchangeable relative to effects and variances under the global null of all slopes zero.

alternative

Coefficient-test tail: two.sided, greater, or less. The global moderator Wald statistic always uses its upper tail.

max_exact

Maximum number of exact transformations, default 50000.

...

Additional function arguments passed to the permutation_mars() function.

Value

A list with original_fit, robust_type, and permutation-statistic attributes.

Details

number_permutations counts random transformations; the observed fit is included once more to prevent zero p-values. Exact enumeration includes every transformation, including the identity. Any failed or non-estimable statistic withholds that test's p-value. Moderator p-values test the global null, not partial hypotheses conditional on nuisance moderators. Null-statistic quantiles are not confidence intervals. No permutation confidence intervals are supplied.

Examples

# \donttest{
perm_reps <- replicate_permutation(
  number_permutations = 5,
  data = teacher_expectancy,
  studyID = "study",
  effectID = NULL,
  sample_size = NULL,
  formula = yi ~ 1,
  variance = "vi",
  varcov_type = "univariate",
  structure = "univariate"
)
# }