Microdata Infrastructure Tools for Firm-Level Microdata Research

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) , Levinsohn and Petrin (2003) , Wooldridge (2009) , Petrin, Poi and Levinsohn (2004) , and Arellano and Bond (1991) with the "too many instruments" correction by Roodman (2009) . Markup estimation follows De Loecker and Warzynski (2012) . Cost-share production function estimation follows Basu and Fernald (1997) . Capital stock estimation via the Perpetual Inventory Method follows OECD (2009) .


mditools

Microdata Infrastructure Tools: Analysis Tools for Firm-Level Microdata Research

mditools supports the full analysis pipeline for researchers working with firm-level microdata.

Start with the data tools to prepare your panel: import raw files, detect outliers, and harmonize classifications over time. Then run your analysis — estimate production functions and capital stock, compute markups, intensity measures, and distributions, or run regressions and clustering. Once results are ready, use the disclosure tools to tag outputs with dominance and observation counts, aggregate to industry or country level, and apply suppression rules before publication.

Installation

Once on CRAN:

install.packages("mditools")

Development version from GitHub:

# install.packages("remotes")
remotes::install_github("Secretariat-CompNet/mditools")

Main features

Area Functions
Data tools mdi_import_data(), mdi_outlier(), mdi_make_conc()
Aggregation mdi_aggregate(), mdi_hier_apply()
Disclosure control mdi_disclose_crit(), mdi_disclose_reg_tab()
Production functions mdi_estimate_prodfun(), mdi_acf_prodest(), mdi_lp_prodest(), mdi_ols_prodest(), mdi_wdrg_prodest(), mdi_cs_prodest(), mdi_dpgmm_prodest()
Analysis functions mdi_regress(), mdi_clustering(), mdi_estimate_markup(), mdi_pim_capital(), mdi_intensity(), mdi_jointdist(), mdi_transition()

Usage example

library(mditools)
library(data.table)

DT <- data.table(
  firmid = rep(1:10, each = 2),
  year   = rep(2020:2021, 10),
  nace   = rep(c("A", "B"), 10),
  emp    = sample(10:100, 20)
)

# Aggregate employment by industry, with disclosure criteria
agg <- mdi_aggregate(DT, var_list = "emp", bygroups = c("nace", "year"),
                     agg_type = "sum", disclosure = TRUE)

# Check disclosure criteria (dominance and observation counts)
disc <- mdi_disclose_crit(agg, domVar = "var", domNr = 2L,
                          bygroups = c("nace", "year"), var_list = "emp")

Acknowledgements

We thank Jorge de la Cal Medina, Ashim Dubey, Dominik Frommeyer (Statistisches Bundesamt, Destatis), Adam Haunch, Rachel Kühn (Statistisches Bundesamt, Destatis) and Elena Sponga.

Funded by the European Union under the Technical Support Instrument (TSI). This package was developed as part of the project ProdTool (TSI-2025-MULTIMSPROD-IBA, TSI Project Number: 101261159). Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Commission. Neither the European Union nor the granting authority can be held responsible for them.

License

GPL-3.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("mditools")

0.1.1 by Johanna Weiss, 13 days ago


https://github.com/Secretariat-CompNet/mditools


Report a bug at https://github.com/Secretariat-CompNet/mditools/issues


Browse source code at https://github.com/cran/mditools


Authors: Daniele Aglio [aut] , Eric Bartelsman [aut] , Mirja Hälbig [aut] , Marco Miorandi [aut] , Johanna Weiss [aut, cre] , Alessandro Zona Mattioli [aut] , Julián Díaz-Acosta [ctb] , Alberto Ferreira [ctb] , Javier Miranda [ctb] , Marcelo Piemonte Ribeiro [ctb] , Reetuparna Vishwanath [ctb] , Chengzi Yi [ctb] , European Union [fnd] (Technical Support Instrument (TSI) , project ProdTool , TSI-2025-MULTIMSPROD-IBA , TSI Project Number 101261159)


Documentation:   PDF Manual  


GPL-3 license


Imports data.table, fixest, haven, readxl, Matrix, cluster, dbscan, mclust, stats, utils, graphics, grDevices

Suggests testthat, arrow, RODBC, askpass


See at CRAN