moderndid.EtwfeResult#

class moderndid.EtwfeResult(coefficients: ndarray, std_errors: ndarray, vcov: ndarray, coef_names: list, gt_pairs: list, n_obs: int, n_units: int, r_squared: float | None = None, adj_r_squared: float | None = None, data: object = None, config: object = None, estimation_params: dict = {})[source]#

Bases: NamedTuple

Container for ETWFE regression output.

This class implements the maketables plug-in interface for publication-quality tables. See Publication Tables with maketables.

Returned by etwfe. Stores the saturated TWFE regression coefficients and variance-covariance matrix needed by emfx for aggregation.

Attributes:
coefficientsnumpy.ndarray

Coefficient estimates for each cohort x time interaction term.

std_errorsnumpy.ndarray

Standard errors for each coefficient.

vcovnumpy.ndarray

Variance-covariance matrix of the interaction coefficients.

coef_nameslist[str]

Names for each coefficient (from pyfixest).

gt_pairslist[tuple[float, float]]

(group, time) pair for each coefficient.

n_obsint

Number of observations used in estimation.

n_unitsint

Number of unique cross-sectional units.

r_squaredfloat or None

R-squared of the regression.

adj_r_squaredfloat or None

Adjusted R-squared of the regression.

dataobject or None

Preprocessed DataFrame (used by emfx for cell counts).

configobject or None

EtwfeConfig used for estimation.

estimation_paramsdict

Additional estimation parameters.

Methods

count(value, /)

Return number of occurrences of value.

index(value[, start, stop])

Return first index of value.

Attributes

adj_r_squared

Adjusted R-squared of the regression.

coef_names

Names for each coefficient from pyfixest.

coefficients

Coefficient estimates for each cohort x time interaction term.

config

EtwfeConfig used for estimation.

data

Preprocessed DataFrame (used by emfx for aggregation).

estimation_params

Estimation parameters (yname, cgroup, formula, etc.).

gt_pairs

(group, time) pair for each coefficient.

n_obs

Number of observations used in estimation.

n_units

Number of unique cross-sectional units.

r_squared

R-squared of the regression.

std_errors

Standard errors for each coefficient.

vcov

Variance-covariance matrix of the interaction coefficients.