causalis.scenarios.classic_rct.inference.welch_permutation_t_test.AlternativeAlternative
None
Canonical target
causalis.scenarios.classic_rct.inference.welch_permutation_t_test.Alternative
Python Docs
causalis
Package entry
causalisRoot package overview and namespace mapNamespaces
causalis.scenarios.classic_rct.inference.welch_permutation_t_testSubmodule 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.
Data
Jump directly into the documented data for this page.
causalis.scenarios.classic_rct.inference.welch_permutation_t_test.AlternativeNone
Canonical target
causalis.scenarios.classic_rct.inference.welch_permutation_t_test.Alternative
causalis.scenarios.classic_rct.inference.welch_permutation_t_test.welch_permutation_t_testRun 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:
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
The CausalData object containing treatment and outcome variables.
Significance level for the theoretical Welch confidence interval.
Number of Monte Carlo label permutations.
Alternative hypothesis for the permutation p-value.
Random seed for reproducible permutations.
Returns
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