Learn R Programming

ImpactEffectsize

An R package for calculating and visualizing the Impact effect size measure, which combines central tendency differences with morphological differences in data distribution shapes between two groups.

Overview

The Impact effect size measure provides a comprehensive assessment of differences between two groups by considering both:

  • Central tendency component (CT): Differences in group medians normalized by the Gini Mean Difference
  • Morphological component (Morph): Differences in the shapes of probability density functions using Pareto Density Estimation

This dual approach makes Impact particularly effective for detecting group differences that traditional effect size measures might miss, especially when groups have similar central tendencies but different distribution shapes.

Features

  • Dual-component analysis: Combines location and shape-based differences
  • Robust median-based calculations: Less sensitive to outliers than mean-based measures
  • Pareto Density Estimation: Non-parametric approach for capturing distribution shape differences
  • Built-in visualization: Optional density plot generation with customizable aesthetics
  • Automatic data validation: Handles missing values and validates input requirements
  • Kolmogorov-Smirnov integration: Uses KS test to assess distributional differences

Installation

You can install ImpactEffectsize from CRAN:

install.packages("ImpactEffectsize")

Or install the development version directly from GitHub:

devtools::install_github("JornLotsch/ImpactEffectsize")

For more information, visit the CRAN package page: https://cran.r-project.org/package=ImpactEffectsize

Dependencies

The package requires:

  • caTools (for numerical integration)
  • methods (for argument checking)
  • matrixStats (for matrix operations)
  • stats (for statistical functions)

Quick start

Basic usage

library(ImpactEffectsize)
# Load example data
data("FeatureselectionData")
# Calculate Impact effect size
result <- Impact(Data = FeatureselectionDataVar0011, Cls = FeatureselectionDataClasses)
# View results
print(resultImpact) # Main effect size measure print(resultCTDiff) # Central tendency component print(result$MorphDiff) # Morphological component

With visualization

# Calculate Impact with density plot
result <- Impact(Data = FeatureselectionDataVar0011, Cls = FeatureselectionDataClasses, PlotIt = TRUE, col = c("red", "blue"), meanLines = TRUE, medianLines = TRUE)

Main function: Impact()

Call

result <- Impact(Data, Cls, PlotIt = FALSE, pde = TRUE, col = c("red", "blue"), meanLines = FALSE, medianLines = FALSE, ...)

Parameters

ParameterTypeDefaultDescription
Datanumeric vector-The data of both groups as a vector
Clsvector-Class information vector of similar length as Data
PlotItlogicalFALSEWhether to plot the probability density functions
pdelogicalTRUEUse Pareto density estimation (TRUE) vs standard density (FALSE)
colcharacter vectorc("red", "blue")Colors for the two density lines in plots
meanLineslogicalFALSEAdd perpendicular lines at group means
medianLineslogicalFALSEAdd perpendicular lines at group medians
...--Additional graphical parameters for plotting

Output

OutputTypeDescription
ImpactnumericThe main Impact effect size measure
CTDiffnumericCentral tendency difference component
MorphDiffnumericMorphological difference component

Examples

Example 1: Basic Impact calculation

data("FeatureselectionData") result <- Impact(Data = FeatureselectionDataVar0011, Cls = FeatureselectionDataClasses, PlotIt = TRUE)
cat("Impact Effect Size:", resultImpact, "\n") cat("CT Component:", resultCTDiff, "\n") cat("Morphological Component:", result$MorphDiff, "\n")

Example 2: Custom visualization

data("BcellLymphomaCD79") result <- Impact(Data = BcellLymphomaCD79SomeVariable, Cls = BcellLymphomaCD79Classes, PlotIt = TRUE, col = c("darkred", "darkblue"), meanLines = TRUE, medianLines = TRUE, main = "Impact Analysis with Reference Lines")

Interpretation

The Impact effect size measure ranges from 0 to positive values:

  • 0: No meaningful difference between groups
  • > 0: Increasing difference between groups
  • Positive/Negative values: Direction indicates which group has higher central tendency

The measure combines:

  • CTDiff: Captures location differences (similar to standardized mean difference)
  • MorphDiff: Captures shape differences not detected by location-based measures

License

GPL-3

Citation

Lötsch J, Ultsch A. A non-parametric effect-size measure capturing changes in central tendency and data distribution shape. PLoS One. 2020 Sep 24;15(9):e0239623. doi: 10.1371/journal.pone.0239623. PMID: 32970758; PMCID: PMC7514071.

Copy Link

Version

Install

install.packages('ImpactEffectsize')

Monthly Downloads

285

Version

0.8

License

GPL-3

Maintainer

Jorn Lotsch

Last Published

September 2nd, 2025

Functions in ImpactEffectsize (0.8)

ImpactEffectsize-package

ImpactEffectsize-package
StocksFluctuation

Example data of stock fluctuation.
BcellLymphomaCD79

Example data of bimodal CD79 expression.
SameMeansData

Example artificial data with two groups of same means but different data distribution shapes.
Impact

Impact effect size measure
FeatureselectionData

Example data with two groups and the Impact effet size measure.
FlowcytometricData

Example data of hematologic marker expression.