ess_model¶
- ess_model(x_cov, assignments, y_mat, *, contrast=(1.0, -1.0))[source]¶
Model-based effective sample size of each assignment.
Within each group, the outcome is regressed on an intercept and
x_cov. The contrast is estimated by regression imputation at the full-sample covariate meanb, with variancesum_g c_g^2 * s_g^2 * b' (B_g' B_g)^{-1} b, wheres_g^2is the group’s residual variance onn_g - pdegrees of freedom.- Parameters:
x_cov (np.ndarray) – Covariates used in the outcome models, one row per unit.
assignments (np.ndarray) – Assignments to assess, one per row.
y_mat (np.ndarray) – Potential outcomes, one column per group in sorted label order.
contrast (Sequence[float]) – Coefficient for each group.
- Returns:
ESS per assignment; the most precise assignment has ESS equal to N.
- Return type:
np.ndarray