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 columns

  • ChiSquareTestOfIndependenceFromTable — Chi-square test from a contingency table

  • OneSampleTTest — One-sample t-test against a hypothesized mean

  • TwoSampleTTestOfIndependence — Independent samples t-test between groups

  • TwoSampleTTestPaired — Paired samples t-test for before/after designs

  • OneWayANOVA — One-way ANOVA across multiple groups

  • TTestOfMeanFromStats — One-sample t-test from summary statistics

  • TTestOfTwoMeansFromStats — Two-sample mean comparison from summary statistics

  • TTestOfProportionFromStats — One-sample proportion test from summary statistics

  • ConductLinearRegressionAnalysis — Linear regression with optional diagnostics

  • ConductLogisticRegressionAnalysis — Logistic regression for binary outcomes

  • ConductCoxProportionalHazardRegression — 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 Examplesarrow-up-right for clean, copy-paste snippets.

chevron-rightLegacy draft (collapsed)hashtag
circle-info

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