statsmodels.stats.sandwich_covariance.cov_nw_groupsum(results, nlags, time, weights_func=<function weights_bartlett>, use_correction=0)
[source]
Driscoll and Kraay Panel robust covariance matrix
Robust covariance matrix for panel data of Driscoll and Kraay.
Assumes we have a panel of time series where the time index is available. The time index is assumed to represent equal spaced periods. At least one observation per period is required.
Parameters: |
|
---|---|
Returns: |
cov – HAC robust covariance matrix for parameter estimates |
Return type: |
ndarray, (k_vars, k_vars) |
Tested against STATA xtscc package, which uses no small sample correction
This first averages relevant variables for each time period over all individuals/groups, and then applies the same kernel weighted averaging over time as in HAC.
Warning: In the example with a short panel (few time periods and many individuals) with mainly across individual variation this estimator did not produce reasonable results.
Options might change when other kernels besides Bartlett and uniform are available.
Daniel Hoechle, xtscc paper Driscoll and Kraay
© 2009–2012 Statsmodels Developers
© 2006–2008 Scipy Developers
© 2006 Jonathan E. Taylor
Licensed under the 3-clause BSD License.
http://www.statsmodels.org/stable/generated/statsmodels.stats.sandwich_covariance.cov_nw_groupsum.html