smmargins.MarginsResult¶
- class smmargins.MarginsResult(estimate: ndarray, vcov: ndarray, labels: Sequence[str] | None = None, level: float = 0.95, df: int | None = None, stat_name: str = 'margin', outcome_labels: Sequence[str] | None = None, outcome_index: ndarray | None = None, ci_method: str = 'pointwise', draws: ndarray | None = None)¶
Container for marginal effects or adjusted predictions.
This class holds the point estimates, their delta-method covariance matrix, and provides methods for summarizing results, computing linear contrasts, or subsetting multi-outcome results.
- estimate¶
Point estimates for each margin.
- Type:
ndarray
- vcov¶
The estimated covariance matrix of the margins (delta method or empirical covariance of simulation/bootstrap draws).
- Type:
ndarray
- se¶
Standard errors (square root of the diagonal of
vcov, or the standard deviation of draws when available).- Type:
ndarray
- tvalues¶
Test statistics (estimate / se).
- Type:
ndarray
- pvalues¶
Two-sided p-values based on either the normal or t distribution.
- Type:
ndarray
- labels¶
Labels for each row of the results.
- Type:
list of str
- ci_method¶
Method used to compute confidence intervals (“pointwise”, “bonferroni”, “sidak”, or “sup-t”).
- Type:
str
- draws¶
Simulation/bootstrap draw matrix of shape (S, m) when available.
- Type:
ndarray or None
- __init__(estimate: ndarray, vcov: ndarray, labels: Sequence[str] | None = None, level: float = 0.95, df: int | None = None, stat_name: str = 'margin', outcome_labels: Sequence[str] | None = None, outcome_index: ndarray | None = None, ci_method: str = 'pointwise', draws: ndarray | None = None)¶
Methods
__init__(estimate, vcov[, labels, level, ...])contrast(c[, labels, name, ci_method])Compute linear contrasts of the estimates.
outcome(k)Slice rows belonging to the specified outcome class(es).
pairwise(by[, ci_method])All pairwise comparisons of a factor variable's levels.
summary()A summary table of the results.
wald([C, value])Joint Wald test of linear restrictions on the margins.
Attributes
ci_lowerLower confidence bound.
ci_upperUpper confidence bound.