Heteroskedasticity-Consistent Inference for Linear Models
Overview
Performs heteroskedasticity-consistent inferences in linear regressions under heteroskedasticity. The published HC0 through HC5m estimators implemented in the package follow White (1980) doi:10.2307/1912934, Hinkley (1977) doi:10.1080/00401706.1977.10489550, MacKinnon and White (1985) doi:10.1016/0304-4076(85)90158-7, Cribari-Neto (2004) doi:10.1016/S0167-9473(02)00366-3, Cribari-Neto and da Silva (2011) doi:10.1007/s10182-010-0141-2, Cribari-Neto et al. (2007) doi:10.1080/03610920601126589 with its erratum doi:10.1080/03610920802109210, and Li et al. (2016) doi:10.1080/00949655.2016.1198906. The package also includes HCbeta, a new estimator proposed by the package authors. It additionally provides feasible generalized least squares estimation under multiplicative heteroskedasticity following Harvey (1976) doi:10.2307/1913974 and Cribari-Neto and Pereira (2019) doi:10.1080/00949655.2019.1586902, with two-step and maximum likelihood fitting and information criteria for the likelihood fit. It provides normal Wald tests, confidence intervals, diagnostics, and S3 output for applied inference.
- Added
gls_mult()for feasible generalized least squares estimation under multiplicative heteroskedasticity. Theestimatorargument chooses the fit, either"ml"(default, Gaussian maximum likelihood) or"two_step"(Harvey's corrected auxiliary regression), and for maximum likelihood themethodargument selects thestats::optim()algorithm:"BFGS"(default),"Nelder-Mead","CG", or"L-BFGS-B". Newcoef()andvcov()methods access the mean and dispersion coefficients viamodel =, andconfint(),tests(),summary(),print(),fitted(), andresiduals()methods support applied inference, whilelogLik()andnobs()enableAIC()andBIC()for maximum likelihood fits. The packageDescriptionnow also covers feasible generalized least squares following Harvey (1976) and Cribari-Neto and Pereira (2019). - Corrected the HC5 adjustment factor, which now follows the erratum to Cribari-Neto, Souza and Vasconcellos (2007).
vcov_hc()andhcinfer()computeg_t = (1 - h_t)^(-delta_t / 2)instead of the expressiong_t = (1 - h_t)^(-delta_t)printed in Section 3 of the original article, keepingdelta_t = min(h_t / h_bar, max(4, k * h_max / h_bar))and the defaultk = 0.7unchanged. HC5 adjustment factors are therefore smaller, and HC5 standard errors, Wald statistics, p-values, and confidence intervals differ from those returned by earlier versions. HC5m is unaffected because it follows Li, Zhang, Zhang and Wang (2016) and applies its own exponent without the factor 1/2, sotype = "hc5m"withk1 = 0,k2 = 0, andk3 = 1no longer reproducestype = "hc5"and instead squares its adjustment factor. - Documented the corrected HC5 expression in the
vcov_hc()help page and in the methodology vignette, and added the 2008 erratum to the references ofhcinfer(),vcov_hc(),tests(), the methodology vignette, and the packageDescription.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK1 OK2026-06-10
Documentation
- Help pages
- 24 (1 internal)includes a package overview page
- Examples that run
- 100%14 run in a plain check
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 21%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 8
- Median days to close, 50 most recently updated closed PRs
- 0
Releases over time
Commits over time
8 development-tooling and community-health practices detected across 5 families in the upstream repository
Checks run against github.com/prdm0/hcinfer on 2026-10-11.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-08-25
pkgdown site last built 2026-08-25
Show all practicesHide 1 practice
Dependencies
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- 0.3.0Latest
- 0.2.0
- 0.1.12026-07-13 · diff ↗
- 0.1.02026-06-10
- RR 4.6.0 released · 2026-04-24
Package metadata
- First published
- 2026-06-10
- Total releases
- 4 / 1 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 4.1.0
- Bundled data
- 5.5 KB / 4 files
- Download size
- 1.1 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("hcinfer")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-19, which the citation names so these numbers can be found later. More on citing and the projects behind them.