BMpTest: Brunner-Munzel Test (Permutation Version) for Two Independent...

View source: R/BMTest_permutations.R

BMpTestR Documentation

Brunner-Munzel Test (Permutation Version) for Two Independent Groups

Description

Performs the Brunner-Munzel test using a permutation approach, suitable for comparing two independent samples when the assumption of equal variances may not hold.

Usage

BMpTest(
  grupo1,
  grupo2,
  alpha = 0.05,
  alternative = c("two.sided", "less", "greater"),
  nperm = 10000,
  seed = NULL
)

Arguments

grupo1

A numeric vector representing the first group.

grupo2

A numeric vector representing the second group.

alpha

Significance level (default is 0.05).

alternative

Character string specifying the alternative hypothesis: one of "two.sided" (default), "greater", or "less".

nperm

Number of permutations to perform (default = 10000).

seed

Optional random seed for reproducibility (default is NULL).

Details

This version computes an empirical p-value based on resampling, without relying on the t-distribution approximation.

Value

An object of class "comparacion" and "brunnermunzel_perm", containing:

  • Resultados: A data frame with comparison name, mean difference, empirical p-value, and significance.

  • Promedios: A named numeric vector of group means.

  • Orden_Medias: Group names ordered by their mean.

  • Metodo: Description of the method used.

References

Brunner, E., & Munzel, U. (2000). "The nonparametric Behrens-Fisher problem: Asymptotic theory and a small-sample approximation." Biometrical Journal, 42(1), 17–25.

Examples

data(d_e, package = "Analitica")
g1 <- d_e$Sueldo_actual[d_e$labor == 1]
g2 <- d_e$Sueldo_actual[d_e$labor == 2]
resultado <- BMpTest(g1, g2)
summary(resultado)


Analitica documentation built on June 14, 2025, 9:07 a.m.