Skip to contents

Calculates Mangiafico's d, which is the difference in medians divided by the pooled median absolute deviation, for several groups in a pairwise manner.

Usage

multiMangiaficoD(
  formula = NULL,
  data = NULL,
  x = NULL,
  g = NULL,
  correct = FALSE,
  digits = 3,
  ...
)

Arguments

formula

A formula indicating the response variable and the independent variable. e.g. y ~ group.

data

The data frame to use.

x

If no formula is given, the response variable.

g

If no formula is given, the grouping variable.

correct

If TRUE, applies Hedges' correction.

digits

The number of significant digits in the output.

...

Additional arguments passed to the mad() function.

Value

A list containing a data frame of pairwise statistics, and the comparison with the most extreme value of the statistic.

Details

Mangiafico's d is an appropriate effect size statistic where Mood's median test, or another test comparing two medians, might be used. Note that the response variable is treated as at least interval.

When the data in the first group are greater than in the second group, d is positive. When the data in the second group are greater than in the first group, d is negative.

Be cautious with this interpretation, as R will alphabetize groups in the formula interface if the grouping variable is not already a factor.

Currently, the function makes no provisions for NA values in the data. It is recommended that NAs be removed beforehand.

Note

The parsing of the formula is simplistic. The first variable on the left side is used as the measurement variable. The first variable on the right side is used for the grouping variable.

The parsing of the formula is simplistic. The first variable on the left side is used as the measurement variable. The first variable on the right side is used for the grouping variable.

References

Ricca, B.P. and Blaine, B.E. Brief research report: Notes on a nonparametric estimate of effect size. Journal of Experimental Education 90(1):249–258.

https://rcompanion.org/handbook/F_05.html

See also

Author

Salvatore Mangiafico, mangiafico@njaes.rutgers.edu

Examples

data(Catbus)
multiMangiaficoD(Steps ~ Teacher, data=Catbus)
#> $pairs
#>         Comparison Median.1 Median.2 MAD.1 MAD.2 Difference Pooled.MAD
#> 1 Catbus - Satsuki     7500     8000  1480  1480       -500       1480
#> 2  Catbus - Totoro     7500     8000  1480  1480       -500       1480
#> 3 Satsuki - Totoro     8000     8000  1480  1480          0       1480
#>   Mangiafico.d
#> 1       -0.337
#> 2       -0.337
#> 3        0.000
#> 
#> $comparison
#>         Comparison         Comparison 
#> "Catbus - Satsuki"  "Catbus - Totoro" 
#> 
#> $statistic.m
#> Maximum(abs(d)) 
#>           0.337 
#>