Skip to contents

The vcovCL.heckmanGE function computes the variance-covariance matrix of a Heckman model, applying a cluster correction. This is useful for obtaining robust variance estimates, especially when there is within-group dependence.

Usage

vcovCL.heckmanGE(
  x,
  cluster = NULL,
  type = NULL,
  sandwich = TRUE,
  fix = FALSE,
  ...
)

Arguments

x

An object resulting from the estimation of a Heckman model using the heckmanGE method.

cluster

A vector or factor identifying clusters in the data. If NULL, assumes no clustering.

type

A character string specifying the type of cluster correction to be applied. It can be "HC0", "HC1", "HC2", or "HC3".

sandwich

A logical value. If TRUE, the function applies the sandwich estimator to the variance-covariance matrix.

fix

A logical value. If TRUE, corrects any negative eigenvalues in the variance-covariance matrix.

...

Additional arguments that can be passed to internal methods.

Value

A corrected variance-covariance matrix.

Details

This function is a specialized implementation for obtaining a robust variance-covariance matrix from Heckman models estimated with heckmanGE. It allows for cluster correction, which is particularly important in contexts where observations within groups may not be independent.