hcinfer (development version)
- Added the HC0R estimator,
type = "hc0r"invcov_hc()andhcinfer(). It keeps the HC0 weightsg_t = 1and computes the sandwich with the least median of squares residuals of Rousseeuw (1984), as proposed by Lima, Souza, Cribari-Neto and Fernandes (2010), while the tested coefficients remain the OLS estimates. The LMS fit usesMASS::lqs(method = "lms"), soMASSis now imported. The method argumentseed(default 1) fixes the random elemental subsets thatMASS::lqs()samples when there are at least 5000 of them. These subsets are drawn with R’s default random number generators whateverRNGkind()the session uses, and the caller’s random number generator state is restored afterwards. -
summary()forhcinfer()andgls_mult()objects gains the argumentsimple. The defaultsimple = TRUEprints a compact report in the style ofsummary.lm(), whose coefficient table adds anull_valuecolumn only when a null value is nonzero;simple = FALSEprints the detailed report of earlier versions, now followed by the quasi-F test. Printing agls_mult()object now shows the compact report. - Both summaries report a quasi-F test that all coefficients except the intercept are zero. The statistic is
F = W / q, whereWis the Wald statistic computed with the stored covariance matrix (for the HC estimators, the statistic studied by Godfrey, 2006) andqis the number of tested coefficients, and its p-value comes from the asymptotic chi-squared(q) reference forW. The result is stored in thequasi_fcomponent of the summary. - Printed output no longer contains emoji, and the option
hcinfer.use_emojiwas removed. -
hcinfer()andgls_mult()objects no longer store aresidualscomponent; they store the originallmfit asmodel, andresiduals()returns the residuals as before. The sample size componentnofhcinfer(),vcov_hc(),boot_pairs(), andgls_mult()objects, and of the corresponding summaries, is now callednum_obs, andgls_mult()objects no longer containnobs; usenobs()instead. - Corrected the reference to the HCbeta article (Cunha, Cribari-Neto and Marinho, 2026, Journal of Statistical Computation and Simulation, doi:10.1080/00949655.2026.2757763).
citation("hcinfer")now also returns this article.
hcinfer 0.3.0
CRAN release: 2026-08-25
- 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.
hcinfer 0.2.0
CRAN release: 2026-08-04
- Added
boot_pairs()for pairs (case) bootstrap standard errors and confidence intervals of ordinary least squares coefficients. It resamples the observations with replacement, refits the model on each replicate, and summarizes the sampling distribution of the coefficients, providing an assumption-free empirical reference for the analytic heteroskedasticity-consistent standard errors fromhcinfer()andvcov_hc(). Percentile, basic, and normal intervals are available, the resampling is reproducible through theseedargument, and the replicate fits can optionally run in parallel viapurrr::in_parallel()andmiraiwithout changing the numeric result. - Added
coef(),vcov(),confint(),print(), andplot()methods for thehcinfer_bootobjects returned byboot_pairs().vcov()returns the bootstrap covariance matrix of the coefficients,confint()can recompute intervals at a differentlevelortypedirectly from the stored replicates, andplot()draws the bootstrap confidence intervals, coloring each coefficient by whether its interval excludes or includes zero. -
hcinfer()andvcov_hc()now accept independent HCbeta shape caps from 50 through 25000 inclusive, with defaults of 10000. HC0, HC1, and HCbeta also remain defined for an exact leverage value of one, while HC2, HC3, HC4, HC4m, HC5, and HC5m retain the positive leverage-complement requirement. -
hcinfer()andvcov_hc()now enforce the fixed HCbeta shape floor of 0.01 after shrinkage and before the upper caps, including for nondefault leverage-complement truncation limits. The shape floor remains fixed whenlowerchanges and is not a method argument.
hcinfer 0.1.1
CRAN release: 2026-07-13
- Added the
PublicSchools2dataset with 2024 per capita income, 2025 public school expenditure per student, a Southern-region indicator, and complete variable and source documentation. - Standardized the federal district name in
PublicSchoolsfromWashington DCtoDistrict of Columbia.
hcinfer 0.0.0.9000
- Added the initial development version with HC covariance estimators, normal Wald inference, S3 output, and the PublicSchools dataset.
-
plot()now supportsvcov_hc()objects, producing leverage-versus-adjustment-factor graphics for inspecting the relationship between h_t and g_t. - summary() now prints formal test results, confidence interval checks, and optional emoji markers to improve interpretation of robust inference output.
- summary() now keeps displayed test_result decisions consistent with numeric p-values when p-values are displayed as <0.001.
- Added
tests()as a formal extractor for coefficient-level Wald test results. The function mirrors the API ofconfint(): an optionalparmargument selects coefficients by name or position, and an optionalalphaargument recomputes therejectcolumn without affecting the stored p-values or test statistics.
