NBER Working Paper w35948所在周报

fevc: Leave-Out Bias-Corrected Variance Decompositions in Stata

fevc:Stata 中的留出偏差校正方差分解

Johannes F. Schmieder

其他主题 意大利

Abstract

Variance decompositions from regressions with worker and firm fixed effects are widely used to measure heterogeneity and sorting in linked data. Variances computed directly from estimated effects overstate heterogeneity because they include estimation noise, and the bias can be large when few workers move between firms. This article introduces fevc, a Stata command that implements the leave-out bias correction of Kline, Saggio, and Sølvsten (2020, “Leave-Out Estimation of Variance Components,” Econometrica 88: 1859–1898). fevc reports corrected variances of worker and firm effects, their covariance, and the variance of their sum. Researchers choose the unit left out, the treatment of controls, and the weights that define the population being described. The command also reports standard errors for projections of fixed effects on observed characteristics. It has two backends: a source-only Mata implementation that runs wherever Stata runs, and a parallel Rust plugin for large datasets. Calculations based on random projections report Monte Carlo standard errors that measure their numerical precision. In a public extract of Italian social-security records, the correction halves the estimated variance of firm effects and reverses the sign of the worker–firm covariance. In synthetic benchmarks with 6.4 million observations and 28 threads, the Rust backend is 1.3 to 3.5 times as fast as the Matlab package of Kline, Saggio, and Sølvsten. Under match deletion, its measured peak memory is about 30 percent of the Matlab package’s.

中文摘要

来自含工人和企业固定效应回归的方差分解被广泛用于衡量关联数据中的异质性和排序。直接由估计效应计算的方差会高估异质性,因为其中包含估计噪声,且当在企业间流动的工人很少时,偏差可能很大。本文介绍 fevc,这是一个 Stata 命令,实现了 Kline、Saggio 和 Sølvsten(2020,“Leave-Out Estimation of Variance Components,” Econometrica 88: 1859–1898)的留出偏差校正。fevc 报告工人效应和企业效应的校正方差、二者的协方差及其和的方差。研究者可选择留出的单位、控制变量的处理方式以及定义所描述总体的权重。该命令还报告固定效应对可观测特征投影的标准误。它有两个后端:一个仅用源码的 Mata 实现,可在任何运行 Stata 的环境中运行;以及一个用于大型数据集的并行 Rust 插件。基于随机投影的计算报告衡量其数值精度的蒙特卡洛标准误。在意大利社会保障记录的公开摘录中,该校正使企业效应的估计方差减半,并逆转了工人—企业协方差的符号。在包含 640 万观测值和 28 个线程的合成基准测试中,Rust 后端比 Kline、Saggio 和 Sølvsten 的 Matlab 包快 1.3 至 3.5 倍。在匹配删除下,其测得峰值内存约为 Matlab 包的 30%。

在 NBER 阅读原文