Factor Model Estimation with Latent Variables
Overview
A flexible framework for estimating factor models with multiple latent variables. Supports linear, probit, ordered probit, and multinomial logit model components. Features include multi-stage estimation, automatic parameter initialization, analytical gradients and Hessians, and parallel estimation. Methods are described in Heckman, Humphries, and Veramendi (2016) doi:10.1016/j.jeconom.2015.12.001, Heckman, Humphries, and Veramendi (2018) doi:10.1086/698760, and Humphries, Joensen, and Veramendi (2024) doi:10.1257/pandp.20241026.
Bug fixes
robust_se()now returns a *named* vector, as documented. It previously computedsqrt(pmax(0, diag(V))), andpmax()copies attributes from its first argument (the scalar0), which dropped the parameter names; name-based indexing of the result then silently returnedNA. Fixed by ordering the parameter vector first (sqrt(pmax(diag(V), 0))), with a regression test on the naming contract.
Usability
define_model_component():covariatesnow defaults toNULL, so a pure measurement item no longer needscovariates = NULLspelled out. The documentation also makes the factor-assignment convention explicit (the length-n_factorsloading_normalizationvector:0off-factor,1anchor,NAfree), and adds afactor_indexconvenience argument for assigning an item to a single factor (factor_index = 2, loading_normalization = 1is shorthand forc(0, 1, 0)in a 3-factor model).
Show all changes in 1.7.1Hide the rest of the changes in 1.7.1
vcov_factorana()now verifies that thedatait is given matches the data the model was fit on (same rows, same order) via a lightweight fingerprint stored on the fit, and errors with a clear message otherwise. This catches the "right shape, wrong rows" case that the free-parameter-count check could not.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK10 OK2026-04-25
- ERROR4 OK, 1 NOTE, 1 ERROR2026-04-23
Documentation
- Help pages
- 61 (15 internal)includes a package overview page
- Examples that run
- 54%7 run in a plain check · 6 only when donttest examples are enabled (R CMD check --as-cran)
- Exported functions with examples
- 34%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Dependencies
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 1.7.1Latest2026-06-10 · current release · diff ↗ ·
added 9 exports
bootstrap_factorana, bootstrap_factorana_multistage, bootstrap_fit_sample, collect_bootstrap, evaluate_obs_scores_cpp, generate_bootstrap_samples, robust_se, simulate_factor_model, vcov_factorana - 1.3.4
- RR 4.6.0 released · 2026-04-24
- 1.2.02026-04-22
- RR 4.5.0 released · 2025-04-11
Package metadata
- First published
- 2026-04-22
- Total releases
- 3 / 1 yrs
- License
- GPL-3 OSI
- Download size
- 1.8 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("factorana")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-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.