Changelog
Source:NEWS.md
avlm (development version)
New Features
-
anova()on anavlmobject returns the sequential ANOVA table with anytime-valid p-values; previously it silently returned the classical table. - A warning is given when there are no more clusters than coefficients, since the cluster-robust covariance is then singular.
-
confint()validateslevel; theavaovsummary printsg.
avlm 0.2.0
CRAN release: 2026-10-21
New Features
-
av.lm()gains aclusterargument for CR1 cluster-robust standard errors (the sandwich scaled byG / (G - 1), without Stata/fixest’s extra(n - 1) / (n - k)). Whenclusteris supplied, the anytime-valid p-values, F-test, and confidence intervals useG - 1(clusters minus one) as the denominator degrees of freedom, rather thann - p(observations minus coefficients).clustercannot be combined withvcov_estimator. The method is described in Lindon (2026), “Anytime-Valid Inference in Linear Models with Clustered Outcomes: Exact Multivariate Tests and Cluster-Robust Confidence Sequences”, https://arxiv.org/abs/2610.25613. -
clusteraccepts a vector of cluster identifiers, a one-sided formula (cluster = ~ cyl), or a column name (cluster = "cyl"). Formulas and column names are looked up in the model’sdataand aligned with the observations used in the fit. - With
cluster, the anytime-valid sample size is the number of clustersG, sogis on the cluster scale, and the joint F-test uses the cluster-robust e-value with exponentG/2. The F-test p-value is 1 when the cluster-robust covariance of the tested coefficients is singular (e.g. fewer clusters than tested coefficients). -
vcov()on anavlmobject returns the covariance used for inference (classical, HC or CR1). -
optimal_g()gains anuargument, so it can tunegfor cluster-robust inference (optimal_g(G, nu = G - 1, alpha = 0.05)). - The summary prints the value of
g.
Bug Fixes
- The heteroskedasticity-robust (
vcov_estimator) F-test now uses the Wald statistic of the tested coefficients, inverting their covariance rather than taking a block of the full precision matrix, and stores it asQ / d. Previously the evidence was overstated when testing more than one coefficient. -
confint()no longer misplaces intervals when the fit has aliased (NA) coefficients; previously every coefficient after an aliased one gotNAor the wrong standard error. Heteroskedasticity- and cluster-robust summaries of such fits no longer fail with a singular-matrix error. - Heteroskedasticity- and cluster-robust standard errors now account for
weights(rows and residuals are scaled bysqrt(w); zero weights are dropped). Previously the weights were ignored, giving wrong standard errors for weighted fits. - Intercept-only models now work with
vcov_estimatorandcluster. -
clusternow accepts one observation per cluster, which gives the HC0 sandwich scaled byn / (n - 1). -
optimal_g()now searches belowg = 1, where the optimum lies for small samples. - Anytime-valid ANOVA p-values use the number of observations as the sample size; models without an intercept were off by one.
-
av()checks thatgis a single positive number and gives informative errors forglm, multivariate (mlm) and multi-stratum (Error()) fits instead of failing later or returning meaningless output.
avlm 0.1.0
CRAN release: 2025-04-23
New Features
- First release of the avlm package, which implements anytime-valid inference for linear models and ANOVA.
- Provides a drop-in replacement for
summary.lm()andsummary.aov()with sequential p-values and confidence intervals. - Includes support for:
Notes
- Based on the methodology described in
“Anytime-Valid Linear Models and Regression Adjusted Causal Inference in Randomized Experiments”
available at: https://arxiv.org/abs/2210.08589