This folder contains code to create summary data tables from MEPS household component (HC) public use files (PUFs).
To create / update the tables, open UPDATE.R in RStudio and edit the year_list variable to include the years you want to run, and set the mydir variable to a local directory where you want to store the PUF (.ssp or .sas7bdat) files. This code then sources other R codes as follows:
-
build_codes.R: Pulls R and SAS code outlines for each table series from codelist_r.R and codelist_sas.R to create complete codes for each statistic and group option ('year' is left as a macro variable). Code outlines are created from code snippets stored in the code folder.
-
transfer_pufs.R: Reads PUF names from meps_file_names.csv on the main MEPS repository on the HHS-AHRQ GitHub site, downloads them from the MEPS website, and stores them in mydir.
-
tables_run.R: Runs new tables for each table series.
-
check_UPDATE.R: Compares data tables from the new year to previous years to identify anomalies.
-
tables_format.R: Formats data tables and stores them in the formatted_tables directory.
-
../r/Update_master.R: Combines formatted tables and stores as an .Rdata object for faster loading..
-
../r/RtoHTML.R: Creates index.html files for each table series.
-
../r/RtoJSON.R: Creates JSON files for each table series
The final codes are saved in the mepstrends folder to be read and displayed on the interactive tables webpage.