pymargins.TestResult

class pymargins.TestResult(statistic: ndarray, pvalue: ndarray, df: int | None = None, null_value: ndarray | float = 0.0, alternative: str = 'two-sided', method: str = 'wald', estimand_metadata: dict = <factory>)

Output of a hypothesis test on a MarginsResult.

statistic

Test statistic (z for Wald, χ² for joint Wald). Per-component for vector estimands.

Type:

array

pvalue

P-value(s).

Type:

array

df

Degrees of freedom (for χ² tests).

Type:

int, optional

null_value

The hypothesized value(s) being tested against.

Type:

array

alternative

“two-sided”, “greater”, or “less”.

Type:

str

method

Test type (“wald”, “joint_wald”, “empirical”).

Type:

str

estimand_metadata

Carried over from the source MarginsResult for output formatting.

Type:

dict

__init__(statistic: ndarray, pvalue: ndarray, df: int | None = None, null_value: ndarray | float = 0.0, alternative: str = 'two-sided', method: str = 'wald', estimand_metadata: dict = <factory>) None

Methods

__init__(statistic, pvalue, df, null_value, ...)

summary()

Human-readable summary of the test.

to_frame()

Return as a tidy DataFrame, one row per estimand component.

Attributes

alternative

df

method

null_value

statistic

pvalue

estimand_metadata