statsmodels.stats.sandwich_covariance.cov_cluster¶
-
statsmodels.stats.sandwich_covariance.cov_cluster(results, group, use_correction=
True
)[source]¶ cluster robust covariance matrix
Calculates sandwich covariance matrix for a single cluster, i.e. grouped variables.
- Parameters:¶
- results
result
instance
result of a regression, uses results.model.exog and results.resid TODO: this should use wexog instead
- use_correctionbool
If true (default), then the small sample correction factor is used.
- results
- Returns:¶
- cov
ndarray
, (k_vars
,k_vars
) cluster robust covariance matrix for parameter estimates
- cov
Notes
same result as Stata in UCLA example and same as Peterson
Last update:
Oct 03, 2024