Hypothesis Testing
Statistical inference tools for common tests and regression models.
Purpose
Use this module to run hypothesis tests, compare groups, and fit simple models.
Key functions
ChiSquareTestOfIndependence— Chi-square test from two categorical columnsChiSquareTestOfIndependenceFromTable— Chi-square test from a contingency tableOneSampleTTest— One-sample t-test against a hypothesized meanTwoSampleTTestOfIndependence— Independent samples t-test between groupsTwoSampleTTestPaired— Paired samples t-test for before/after designsOneWayANOVA— One-way ANOVA across multiple groupsTTestOfMeanFromStats— One-sample t-test from summary statisticsTTestOfTwoMeansFromStats— Two-sample mean comparison from summary statisticsTTestOfProportionFromStats— One-sample proportion test from summary statisticsConductLinearRegressionAnalysis— Linear regression with optional diagnosticsConductLogisticRegressionAnalysis— Logistic regression for binary outcomesConductCoxProportionalHazardRegression— Cox proportional hazards survival model
Common use cases
Categorical association testing (contingency tables)
Mean comparisons (one-sample, independent, paired)
Multi-group mean comparisons (ANOVA)
Working from summary stats instead of raw data
Regression modeling (linear, logistic)
Survival analysis (time-to-event)
Examples
See Hypothesis Testing Examples for clean, copy-paste snippets.
Legacy draft (collapsed)
Examples assume you already have a pandas.DataFrame (named df) in memory.
ChiSquareTestOfIndependence
TwoSampleTTestPaired
Performs a chi-square test of independence between two categorical variables.
ChiSquareTestOfIndependenceFromTable
Performs a chi-square test from a precomputed contingency table.
OneSampleTTest
Performs a one-sample t-test against a hypothesized mean.
TwoSampleTTestOfIndependence
Performs an independent samples t-test to compare means between two groups.
Runs a chi-square test using two categorical columns.
Performs a paired samples t-test for before/after comparisons.
TwoSampleTTestPaired
Performs a one-way ANOVA to compare means across multiple groups.
TTestOfMeanFromStats
OneWayANOVA
Compares two means using summary statistics.
TTestOfTwoMeansFromStats
Performs a one-sample t-test using summary statistics rather than raw data.
Tests a sample proportion against a hypothesized value.
TTestOfProportionFromStats
Performs linear regression analysis with optional diagnostics.
ConductLinearRegressionAnalysis
Performs logistic regression for binary outcomes.
ConductLogisticRegressionAnalysis
Performs survival analysis using Cox proportional hazards regression.
ConductCoxProportionalHazardRegression
Last updated