Microdata Infrastructure Tools for Firm-Level Microdata Research
Overview
Supports the full analysis pipeline for researchers working with firm-level microdata. Provides data tools for panel preparation (import, outlier detection, classification harmonization), analytical methods (production function estimation, capital stock measurement, markups, intensity measures, distributions, regression, clustering), and disclosure tools for tagging outputs with dominance and observation counts before aggregation and publication. Production function estimation implements methods by Ackerberg, Caves and Frazer (2015) doi:10.3982/ECTA13408, Levinsohn and Petrin (2003) doi:10.1111/1467-937X.00246, Wooldridge (2009) doi:10.1016/j.econlet.2009.04.026, Petrin, Poi and Levinsohn (2004) doi:10.1177/1536867X0400400202, and Arellano and Bond (1991) doi:10.2307/2297968 with the "too many instruments" correction by Roodman (2009) doi:10.1111/j.1468-0084.2008.00542.x. Markup estimation follows De Loecker and Warzynski (2012) doi:10.1257/aer.102.6.2437. Cost-share production function estimation follows Basu and Fernald (1997) doi:10.1086/262073. Capital stock estimation via the Perpetual Inventory Method follows OECD (2009) doi:10.1787/9789264068476-en.
Bug fixes
mdi_aggregate()no longer copies its input when it only summarises it (mrg = FALSE), and reads column types in place instead of copying the columns. Its peak memory on a large table drops from about 2.3 to 0.6 times the table's size.mdi_hier_apply()orders hierarchy levels by their number, soh_10comes afterh_2(they were ordered alphabetically).mdi_clustering()withmethod = "pam"works again: it stopped with "length(labels) must equal nrow(Xmat)" whenever it was used.mdi_clustering()withmethod = "mclust"works without mclust being attached (it stopped with "could not find function mclustBIC").mdi_clustering()no longer changes the caller's random numbers: the seed it sets for reproducible clusters is undone when it returns. Clustering results are unchanged.
Show all changes in 0.1.1Hide the rest of the changes in 0.1.1
mdi_regress()computes confidence intervals with the requested covariance estimator (vcov), matching the standard errors.mdi_make_conc()is rewritten: codes linked across years form one harmonized group (connected components), which removes the many-to-many join that stopped on large concordances. Each group is named after its smallest code in its latest year, with aDsuffix when that year is before the last one. Group membership is unchanged; some group names differ from 0.1.0.year_listnow defaults to the concordance's full year range, and a year without concordance rows is an error.
New features
mdi_import_data()reads tables from an Oracle database (format = "oracle"), through RODBC with the password asked interactively (askpass); both packages are suggested, not required.mdi_aggregate()andmdi_jointdist()takedomVaranddomNrfor the dominance check, andmdi_jointdist()takesminNumObs.mdi_outlier()accepts several grouping variables ingroup.check_dt(),check_string(),check_choice(),check_char_vec()andhier_levels()are exported, for packages that build on mditools.
Documentation
- Help pages use Markdown;
panel_lag()andpanel_lag_L()are documented. - Acknowledgements and the EU funding statement (Technical Support Instrument, project ProdTool) in the README and on the package help page; the European Union is listed as funder.
From NEWS.md in the release
Install
Health
- OK13 OKNow
- OK6 OK2026-08-21
Documentation
- Help pages
- 25 (3 internal)includes a package overview page
- Examples that run
- 64%14 run in a plain check · 8 only when donttest examples are enabled (R CMD check --as-cran)
- Exported functions with examples
- 96%
- Documented parameters
- 98%
- Return-value docs
- 100%
- Help pages citing references
- 4%
Downloads
Repository
4 development-tooling and community-health practices detected across 2 families in the upstream repository
Checks run against github.com/secretariat-compnet/mditools on 2026-10-11.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
Dependencies
Installing mditools adds 41 packages (22 with compiled code, 35 MB of source tarballs). Heaviest: data.table 5.7 MB, fixest 4.8 MB, dbscan 3.8 MB.
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 0.1.1Latest2026-10-08 · current release · diff ↗ ·
added 5 exports
check_char_vec, check_choice, check_dt, check_string, hier_levels - 0.1.02026-08-20
- RR 4.6.0 released · 2026-04-24
Package metadata
- First published
- 2026-08-20
- Total releases
- 2 / 1 yrs
- License
- GPL-3 OSI
- Download size
- 87 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("mditools")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-18, which the citation names so these numbers can be found later. More on citing and the projects behind them.