Replication package for: Estimating residential energy efficiency through energy use intensity: A multilevel analysis of the 2020 Residential Energy Consumption Survey
Description
This package contains the complete materials to reproduce all results, tables, and figures in the article "Estimating residential energy efficiency through energy use intensity: A multilevel analysis of the 2020 Residential Energy Consumption Survey." The study models residential energy use intensity (consumption per square foot of conditioned area, kBTU/ft²) for 18,243 U.S. households nested in 17 IECC climate zones, using a survey-weighted two-level multilevel model with a two-stage variable-selection strategy. The package includes: (i) the RECS 2020 microdata used in the analysis (public-domain data from the U.S. Energy Information Administration) and the 2020 state-level contextual variables—GDP per capita, average residential electricity price, and urbanization rate—aggregated to the IECC climate-zone level; (ii) the first-stage R script (elastic net with differential penalty factors; glmnet, seed 123) that screens more than 1,000 candidate terms; (iii) the Stata master do-file that builds the analysis dataset, screens 25 candidate interaction blocks, estimates the final multilevel model and all robustness specifications, and exports every table and figure; (iv) the saved Stata estimates (.ster); and (v) the scripts that generate the figures and the graphical abstract. A full validated run log and a README with the output-to-paper mapping and verification values are included. Third-party content (the RECS microdata) is identified as such in the README.
Files
Steps to reproduce
Software: Stata 17 (the do-file auto-installs estout/esttab) and R with the glmnet package. Put the files in the stata/ folder in one working directory and keep the R/ folder alongside it. (1) Stata — run stata/_Do-file.do, sections 1–4. This reads recs2020.dta and the contextual CSVs (tasa_urbanizacion_y_pib_percapita_estados_usa_2020.csv, precio_electricidad_2020.csv), builds the analysis dataset recs2020_comun.dta, and exports the design matrix base_r_regularizacion_v2.csv. (2) R — run R/script.R (set.seed(123)). It fits the first-stage elastic net with differential penalty factors (main effects unpenalized) and outputs candidatas_filtro2_v2.csv (25 surviving variable pairs) and columnas_seleccionadas_v2.csv (29 columns). These 25 pairs are also hard-coded in section 6 of the do-file, so this step can be skipped if only the downstream results are needed. (3) Stata — run stata/_Do-file.do, sections 5–11. This screens the 25 interaction blocks (Supplementary Table S2), estimates the final survey-weighted multilevel model (final_v3.ster) and the robustness specifications (scheme B, log-EUI, wood-excluded, total consumption), computes the ICC (Table 2), the average marginal effects (Table 4 Panel A) and the full coefficient table (Supplementary Table S1), exports the tables and Figures 2–4 (EPS + 300-dpi TIFF), and in section 11 reports the conditional all-electric price–intensity slope via lincom (the point estimate and 95% CI feeding the graphical abstract). (4) Figures — run fig1/make_fig1.py (IECC climate-zone map, Figure 1) and make_graphical_abstract.py (graphical abstract; runs as-is from the reported estimates and the section-11 lincom CI). Verification (validated run, 15-Jun-2026; see stata/replicacion_full.log): ICC 0.1934 / 0.1781 / 0.2119; 18 interaction blocks selected; AMEs −1.692, +2.166, −1.973, −0.496, +4.686; all-electric × price conditional slope −0.8934, 95% CI [−1.331, −0.456] (scheme A). The README maps every output file to its location in the paper.