Skip to content

hcinfer

0.3.0Package record

Heteroskedasticity-Consistent Inference for Linear Models

0packages depend
1.2Kdownloads / year
79.0%test coverage
13/13flavors OK

Overview

About

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.

Changes in 0.3.0
  • Added gls_mult() for feasible generalized least squares estimation under multiplicative heteroskedasticity. The estimator argument chooses the fit, either "ml" (default, Gaussian maximum likelihood) or "two_step" (Harvey's corrected auxiliary regression), and for maximum likelihood the method argument selects the stats::optim() algorithm: "BFGS" (default), "Nelder-Mead", "CG", or "L-BFGS-B". New coef() and vcov() methods access the mean and dispersion coefficients via model =, and confint(), tests(), summary(), print(), fitted(), and residuals() methods support applied inference, while logLik() and nobs() enable AIC() and BIC() for maximum likelihood fits. The package Description now 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() and hcinfer() compute g_t = (1 - h_t)^(-delta_t / 2) instead of the expression g_t = (1 - h_t)^(-delta_t) printed in Section 3 of the original article, keeping delta_t = min(h_t / h_bar, max(4, k * h_max / h_bar)) and the default k = 0.7 unchanged. 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, so type = "hc5m" with k1 = 0, k2 = 0, and k3 = 1 no longer reproduces type = "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 of hcinfer(), vcov_hc(), tests(), the methodology vignette, and the package Description.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 3.8 min · r-oldrel-macos-x86_64
Status changes
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK1 OK2026-06-10
Advisories

none known

Documentation

In release 0.3.0
READMEYes · 583 wordsVignettesYes · 7 · dynamicNEWSYes · 100% structured · mentions 0.3.0Citation fileNoWebsiteYes · pkgdown
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

1.2K
CRAN downloads in the past year
Rank #14,909 · ~3/day · ~101/mo
Daily download trend is not available in this view yet.
32030 days
80090 days
1.2K1 year
Compare downloads with other packages →
Also on41 r2u4 autocran

Repository

1Stars
0Forks
0Open issues
0Open PRs
4Releases
47Commits
1Commit identities
47 commits · Last activity 2026-08-25
Responsiveness
How these are sampled
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

2026-07-14 · 22026-08-26 · 4
PracticesBeta

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.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Docs source (3)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-08-25

pkgdown site last built 2026-08-25

Reproducibility and dev environment (1)
data-raw/
CRAN release process (1)
cran-comments.md
Show all practicesHide 1 practice
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v3 (2026-09-26)

Dependencies

Declared dependencies
12 external dependencies (excludes base and recommended)

Installing hcinfer adds 23 packages (11 with compiled code, 15 MB of source tarballs). Heaviest: ggplot2 6.0 MB, isoband 1.5 MB, farver 1.2 MB.

Depends (1)
R >= 4.1.0
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

Datasets

People & History

People (3)
Author, Maintainer since 0.1.0 (2026)
Releases (4)

Pick two releases to compare their code metrics.

  • 0.3.0Latest
    record
    2026-08-25 · current release · diff ↗ ·
    added 1 export
    gls_mult
  • 0.2.0
    record
    2026-08-04 · diff ↗ ·
    added 1 export
    boot_pairs
  • 0.1.1
    record
    2026-07-13 · diff ↗
  • 0.1.0
    record
    2026-06-10
  • R
    R 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")
Marinho, P. R. D., Cribari-Neto, F., & Oliveira Cunha, M. (2026). hcinfer: Heteroskedasticity-Consistent Inference for Linear Models (Version 0.3.0) [Computer software]. https://doi.org/10.32614/CRAN.package.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.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for hcinfer version 0.3.0 [Data set]. HJJB, LLC. Data release v2026-10-19. https://doi.org/10.5281/zenodo.21843040

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.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy