This repository contains the Julia simulation code for the paper "Estimating interaction effects with panel data" by Muris and Wacker.
Link to the paper on arXiv: https://arxiv.org/abs/2211.01557
The simulation code is organized into two main folders:
bias-rmse: Contains the code for the bias and relative efficiency simulations (Sections 6.1 and 6.2 of the paper).-
The
src/directory contains source files with the data generating process code and the estimators. -
The
main-Figure-....jlfiles run the simulations that underlie the figures in the paper.
-
inference: Contains the code for the statistical inference simulations (Section 6.3 of the paper).
The following Julia packages are required to run the simulations. You can install them by running the following command in your Julia REPL:
import Pkg; Pkg.add(["DataFrames", "Random", "Distributions", "LinearAlgebra", "Statistics", "ProgressMeter", "Printf", "Plots", "LaTeXStrings", "StatsPlots", "FixedEffects", "FixedEffectModels"])The scripts are written in Julia. To reproduce the figures from the paper, you can run the main .jl files located in each subfolder.
Navigate to the bias-rmse directory. The following scripts generate the corresponding figures:
- Figure 1 (Bias analysis):
main-Figure-1a.jlmain-Figure-1b.jl
- Figure 2 (Relative efficiency analysis):
main-Figure-2a.jlmain-Figure-2b.jlmain-Figure-2c.jlmain-Figure-2d.jlmain-Figure-2e.jlmain-Figure-2f.jl
Navigate to the inference directory. The following scripts generate the corresponding figures:
- Figure 3 (Distribution of t-values and estimators):
Figure3.jl
- Figure 4 (Rejection frequencies):
Figure4a.jlFigure4b.jl
The simulation scripts save the output figures as PDF files in the output directory within each respective subfolder (bias-rmse/output/ and inference/output/).