HomogeneityTest

class hypex.HomogeneityTest[source]

Bases: ExperimentShell

A class for conducting homogeneity tests between the groups.

This class provides functionality to test whether treatment and control groups are homogeneous across target variables using multiple statistical tests including t-test, Kolmogorov-Smirnov test, and chi-square test.

The class runs the following analyses:
  • Group size comparisons

  • Group differences

  • T-test for continuous variables

  • KS-test for distribution comparisons

  • Chi-square test for categorical variables

  • AA statistics analysis

Examples

# Basic homogeneity test
homo_test = HomogeneityTest()
results = homo_test.execute(data)

# Accessing specific test results
homo_test = HomogeneityTest()
results = homo_test.execute(data)
output = results.resume

# Running test on dataset with roles
from hypex.dataset import Dataset, TargetRole, TreatmentRole
ds = Dataset(
    roles={
        'treatment': TreatmentRole(),
        'outcome': TargetRole()
    },
    data=df
)
homo_test = HomogeneityTest()
results = homo_test.execute(ds)
__init__()[source]

Initialize HomogeneityTest with default experiment and output configurations.