Skip to content
Submodule
causalis.scenarios.classic_rct.inference.welch_permutation_t_test

welch_permutation_t_test

Submodule causalis.scenarios.classic_rct.inference.welch_permutation_t_test with no child pages and 2 documented members.

Functions

Jump directly into the documented functions for this page.

1 items

Data

Jump directly into the documented data for this page.

1 items
data
causalis.scenarios.classic_rct.inference.welch_permutation_t_test.Alternative

Alternative

Value: None

None

Canonical target

causalis.scenarios.classic_rct.inference.welch_permutation_t_test.Alternative

Link to this symbol
function
causalis.scenarios.classic_rct.inference.welch_permutation_t_test.welch_permutation_t_test

welch_permutation_t_test

Run a Welch permutation t-test comparing treated and control outcomes.

This test uses the Welch t-statistic as the test statistic but calculates the p-value using a permutation distribution rather than the t-distribution. This is useful when the normality assumption of the t-test is suspect, while still being robust to unequal variances between groups.

Notes

The permutation p-value is calculated as:

p=b=1BI(tbtobs)+1B+1p = \frac{\sum_{b=1}^B I(|t^*_b| \ge |t_{obs}|) + 1}{B + 1}

where $t_{obs}$ is the observed Welch t-statistic and $t^*_b$ are the t-statistics calculated from $B$ random permutations of the treatment labels. The addition of 1 in the numerator and denominator is a standard correction to ensure the test is valid (never returning a p-value of exactly 0).

Confidence intervals for the absolute and relative differences are still calculated using the Welch-Satterthwaite and Delta method approximations respectively, to remain consistent with other inference methods.

Examples

Parameters

dataCausalData

The CausalData object containing treatment and outcome variables.

alphafloat, default 0.05

Significance level for the theoretical Welch confidence interval.

Bint, default 10000

Number of Monte Carlo label permutations.

alternative{“two-sided”, “greater”, “less”}, default “two-sided”

Alternative hypothesis for the permutation p-value.

seedint, optional

Random seed for reproducible permutations.

Returns

Dict[str, Any]

A dictionary containing the permutation p-value, observed Welch statistic, absolute and relative differences, confidence intervals, number of permutations, and alternative.

Canonical target

causalis.scenarios.classic_rct.inference.welch_permutation_t_test.welch_permutation_t_test

Sections

NotesParametersReturnsExamples
Link to this symbol