Skip to content

Safe Anytime Valid Inference for Linear Models

0packages depend
2.5Kdownloads / year
92.8%test coverage
13/13flavors OK

Overview

About

Anytime-valid inference for linear models, namely, sequential t-tests, sequential F-tests, and confidence sequences with time-uniform Type-I error and coverage guarantees. This allows hypotheses to be continuously tested without sacrificing false positive guarantees. Heteroskedasticity-robust and cluster-robust versions are provided. It is based on the methods documented in Lindon et al. (2026) doi:10.1080/01621459.2026.2692052 and Lindon (2026) doi:10.48550/arXiv.2610.25613.

Changes in 0.2.0

New Features

  • av.lm() gains a cluster argument for CR1 cluster-robust standard errors (the sandwich scaled by G / (G - 1), without Stata/fixest's extra (n - 1) / (n - k)). When cluster is supplied, the anytime-valid p-values, F-test, and confidence intervals use G - 1 (clusters minus one) as the denominator degrees of freedom, rather than n - p (observations minus coefficients). cluster cannot be combined with vcov_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>.
  • cluster accepts 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's data and aligned with the observations used in the fit.
  • With cluster, the anytime-valid sample size is the number of clusters G, so g is on the cluster scale, and the joint F-test uses the cluster-robust e-value with exponent G/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).
Show all changes in 0.2.0Hide the rest of the changes in 0.2.0
  • vcov() on an avlm object returns the covariance used for inference (classical, HC or CR1).
  • optimal_g() gains a nu argument, so it can tune g for 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 as Q / 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 got NA or 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 by sqrt(w); zero weights are dropped). Previously the weights were ignored, giving wrong standard errors for weighted fits.
  • Intercept-only models now work with vcov_estimator and cluster.
  • cluster now accepts one observation per cluster, which gives the HC0 sandwich scaled by n / (n - 1).
  • optimal_g() now searches below g = 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 that g is a single positive number and gives informative errors for glm, multivariate (mlm) and multi-stratum (Error()) fits instead of failing later or returning meaningless output.

Internal

  • The classical, heteroskedasticity-robust and cluster-robust code paths share one covariance routine, and unused helpers were removed.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 58 s · r-release-macos-x86_64
Status changes
  • OK13 OK2026-09-08
  • ERROR12 OK, 1 ERROR2026-09-07
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 0.2.0
READMEYes · 107 wordsVignettesNoNEWSYes · 100% structured · mentions 0.2.0Citation fileYes · cites a publicationWebsitenot declared in DESCRIPTION
Help pages
16 (6 internal)
Examples that run
100%5 run in a plain check
Exported functions with examples
50%
Documented parameters
100%
Return-value docs
100%
Help pages citing references
13%

Downloads

2.5K
CRAN downloads in the past year
Rank #21,153 · ~7/day · ~206/mo
Daily download trend is not available in this view yet.
24830 days
62690 days
2.5K1 year
Compare downloads with other packages →
Also on81 r2u15 autocran

Dependencies

Declared dependencies
1 external dependency (excludes base and recommended)

Installing avlm adds no packages beyond those that come with R.

Depends (0)
none
Imports (0)
none
LinkingTo (0)
none
Suggests (1)
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

People & History

People (1)
Author, Maintainer since 0.1.0 (2025)
Releases (2)

Pick two releases to compare their code metrics.

  • 0.2.0Latest
    record
    2026-10-21 · current release · diff ↗ ·
    22 hours in CRAN's queue
    Listed in CRAN's incoming queue from 2026-10-20 17:40 to 2026-10-21 15:47 UTC, in 6 readings.
  • R
    R 4.6.0 released · 2026-04-24
  • 0.1.0
    record
    2025-04-23
  • R
    R 4.5.0 released · 2025-04-11
Across CRAN, the median accepted release of the past year spent 26 hours in the queue, 90% under 11 days.How queue time is measured

Package metadata

First published
2025-04-23
Total releases
2 / 1 yrs
License
MIT + file LICENSE OSI
Download size
22 KB

Cite

Cite this package

Run in R for the authors' entry:

citation("avlm")

The package provides a citation file, so citation() returns the authors' own entry.

It points to 10.1080/01621459.2026.2692052.

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 avlm version 0.2.0 [Data set]. HJJB, LLC. Data release v2026-10-22. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-22, 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