Skip to content

TST: HAC robust covariances for GLM #1625

Open

Description

@josef-pkt

I just saw that Stata provides vce(hac) for GLM. It doesn't for explicit MLE models like nbreg.

useful for writing unit tests, currently only cluster robust covariances have unit tests for Poisson.

Activity

  1. kshedden commented on Apr 23, 2014

    @kshedden
    Contributor

    I wonder if vce(hac) is related to GEE with the autocorrelation dependence structure. I'm not sure about the heteroscedasticity part.

  2. josef-pkt commented on Apr 23, 2014

    @josef-pkt
    MemberAuthor

    GEE uses the autocorrelation in the estimation of the mean parameters.
    vce(...) options only affects how the cov_params is estimated. It's a correction for un- or mis-specified correlation to have valid inference for parameters.

    I don't know if vce(hac) allows for longitudinal/cluster structure. newey, which is vce(hac) in the linear regression case has a force option if the data is a panel (xtset) instead of a time series (tsset)

  3. kshedden commented on Apr 23, 2014

    @kshedden
    Contributor

    If we restrict GEE to one iteration it might be the same. The first
    iteration uses the identity correlation matrix by default, so the estimates
    after one iteration should be the same as with GLM.

  4. josef-pkt commented on Apr 23, 2014

    @josef-pkt
    MemberAuthor

    If w stop after one iteration, does the calculation of the robust cov_params still take the specified correlation structure into account.

    My impression is that GEE would return something similar to vce(cluster) cluster robust standard errors, which allow for arbitrary within cluster correlation.

    I guess, HAC with a uniform kernel in the full length of the time dimension of each cluster would be equivalent. I don't remember if I checked this.
    HAC discounts long lags and is only relevant if we have many time periods and few clusters/cross-sectional units, long instead of wide panel data.

    Stata has another model, xtgls for linear only, that uses the covariance pattern to estimate cov_params under the assumption that it is correctly specified. IIRC
    This would correspond to GEE stopped after one iteration with cov_params based only on the specified correlation structure, without additional robustification to misspecified covariances.

  5. kshedden commented on Apr 24, 2014

    @kshedden
    Contributor

    I wasn't thinking clearly about this before.

    Stopping the GEE iterations after one iteration won't work for this because
    the mean structure parameters won't have reached a fixed point after just
    one iteration.

    The way to get equivalence between GEE and HAC might be to run many GEE
    iterations without updating the covariance structure, then update the
    covariance structure once and return. If the covariance structure is AR,
    this (might) be equivalent to HAC. The reason is that the GEE iterations
    all use the initial AR specification, which is the identity matrix, hence
    we are just computing the usual GLM fit using Gauss-Seidel iterations
    instead of IRLS. Then the final (only) covariance structure update should
    be similar to what HAC does, and since we then return rather than doing
    more mean structure iterations, the regression slopes will be the same as
    in standard GLM.

    I think we had discussed before about having more fine-grained control over
    the GEE iteration process. Right now, one Gauss-Seidel step to update the
    mean structure alternates with one update of the covariance structure. We
    should allow people to specify the number of Gauss-Seidel steps per
    covariance update. This might be useful in some of the categorical models
    where the dependence structure updates are expensive. Also it would
    provide an alternative route to getting "robust" standard errors for GLM.

    On Thu, Apr 24, 2014 at 1:03 AM, Josef Perktold [email protected]:

    If w stop after one iteration, does the calculation of the robust
    cov_params still take the specified correlation structure into account.

    My impression is that GEE would return something similar to vce(cluster)cluster robust standard errors, which allow for arbitrary within cluster
    correlation.

    I guess, HAC with a uniform kernel in the full length of the time
    dimension of each cluster would be equivalent. I don't remember if I
    checked this.
    HAC discounts long lags and is only relevant if we have many time periods
    and few clusters/cross-sectional units, long instead of wide panel data.

    Stata has another model, xtgls for linear only, that uses the covariance
    pattern to estimate cov_params under the assumption that it is correctly
    specified. IIRC
    This would correspond to GEE stopped after one iteration with cov_params
    based only on the specified correlation structure, without additional
    robustification to misspecified covariances.

    Reply to this email directly or view it on GitHubhttps://github.com//issues/1625#issuecomment-41187250
    .

  6. added this to the 0.7 milestone on Aug 23, 2014
  7. removed this from the 0.7 milestone on Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions