3.11.1.1.15. statsmodels.stats.api.cov_cluster_2groups

statsmodels.stats.api.cov_cluster_2groups(results, group, group2=None, use_correction=True)[source]

cluster robust covariance matrix for two groups/clusters

Parameters:

results : result instance

result of a regression, uses results.model.exog and results.resid TODO: this should use wexog instead

use_correction : bool

If true (default), then the small sample correction factor is used.

Returns:

cov_both : ndarray, (k_vars, k_vars)

cluster robust covariance matrix for parameter estimates, for both clusters

cov_0 : ndarray, (k_vars, k_vars)

cluster robust covariance matrix for parameter estimates for first cluster

cov_1 : ndarray, (k_vars, k_vars)

cluster robust covariance matrix for parameter estimates for second cluster

Notes

verified against Peterson’s table, (4 decimal print precision)