{
  "name": "HC0-HC3 heteroskedasticity-consistent covariance estimators: weighting formula and software defaults across R, Stata, statsmodels and SAS",
  "description": "Compares the four White/MacKinnon-White sandwich variants by the per-observation squared-residual weight used, the option name in each of four statistical packages, and which variant each package uses when the user asks for plain robust errors. Compiled from the sandwich (R) reference page, the statsmodels documentation and source, the SAS/STAT PROC REG documentation and the Stata blog on robust standard errors.",
  "page": "https://casrai.org/guides/robust-standard-errors-hc0-hc3",
  "publisher": "CASRAI",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "dateModified": "2026-11-14T14:22:15Z",
  "temporalCoverage": "2026",
  "spatialCoverage": null,
  "columns": [
    {
      "name": "Variant",
      "unit": "",
      "description": ""
    },
    {
      "name": "Per-observation weight on squared residual e_i^2",
      "unit": "",
      "description": ""
    },
    {
      "name": "R sandwich::vcovHC type",
      "unit": "",
      "description": ""
    },
    {
      "name": "Stata regress option",
      "unit": "",
      "description": ""
    },
    {
      "name": "statsmodels cov_type",
      "unit": "",
      "description": ""
    },
    {
      "name": "SAS PROC REG HCCMETHOD",
      "unit": "",
      "description": ""
    },
    {
      "name": "Software where it is the default",
      "unit": "",
      "description": ""
    }
  ],
  "rows": [
    {
      "Variant": "HC0",
      "Per-observation weight on squared residual e_i^2": "1 (no adjustment)",
      "R sandwich::vcovHC type": "HC0",
      "Stata regress option": "n/a",
      "statsmodels cov_type": "HC0",
      "SAS PROC REG HCCMETHOD": "0",
      "Software where it is the default": "SAS PROC REG (HCCMETHOD default)"
    },
    {
      "Variant": "HC1",
      "Per-observation weight on squared residual e_i^2": "n/(n-k)",
      "R sandwich::vcovHC type": "HC1",
      "Stata regress option": "vce(robust)",
      "statsmodels cov_type": "HC1",
      "SAS PROC REG HCCMETHOD": "1",
      "Software where it is the default": "Stata regress vce(robust); statsmodels get_robustcov_results cov_type default"
    },
    {
      "Variant": "HC2",
      "Per-observation weight on squared residual e_i^2": "1/(1-h_ii)",
      "R sandwich::vcovHC type": "HC2",
      "Stata regress option": "vce(hc2)",
      "statsmodels cov_type": "HC2",
      "SAS PROC REG HCCMETHOD": "2",
      "Software where it is the default": "none of the four"
    },
    {
      "Variant": "HC3",
      "Per-observation weight on squared residual e_i^2": "1/(1-h_ii)^2",
      "R sandwich::vcovHC type": "HC3",
      "Stata regress option": "vce(hc3)",
      "statsmodels cov_type": "HC3",
      "SAS PROC REG HCCMETHOD": "3",
      "Software where it is the default": "R sandwich::vcovHC (type default)"
    }
  ],
  "sources": [
    {
      "title": "vcovHC reference, sandwich R package",
      "url": "https://sandwich.R-Forge.R-project.org/reference/vcovHC.html",
      "accessed": "2026-11-14"
    },
    {
      "title": "statsmodels linear_model source (cov_HC0 to cov_HC3)",
      "url": "https://www.statsmodels.org/stable/_modules/statsmodels/regression/linear_model.html",
      "accessed": "2026-11-14"
    },
    {
      "title": "statsmodels get_robustcov_results documentation",
      "url": "https://www.statsmodels.org/stable/generated/statsmodels.regression.linear_model.RegressionResults.get_robustcov_results.html",
      "accessed": "2026-11-14"
    },
    {
      "title": "SAS/STAT PROC REG: heteroscedasticity-consistent covariance matrix estimators",
      "url": "https://support.sas.com/documentation/cdl/en/statug/67523/HTML/default/statug_reg_details30.htm",
      "accessed": "2026-11-14"
    },
    {
      "title": "Stata Blog: Heteroskedasticity robust standard errors, some practical considerations",
      "url": "https://blog.stata.com/?p=6979",
      "accessed": "2026-11-14"
    }
  ]
}