README file for posted estimation files
"Public Spending on Acute and Long-Term Care for Alzheimer's and Related Dementias"
by Norma B. Coe, Lindsay White, Melissa Oney, Anirban Basu, and Eric B. Larson
Overview:
Before running the code:
- Copy file contents into project folder with the following subfolders: do, output, log, and data
- Change the file path of the folder global ("gl folder") in 000_master.do to the location of the project folder
- Save all data in the data subfolder (and additional subfolders as described below)
Once these changes have been made, running the master file will produce the tables corresponding to the selected sections (noted after each local in 000_master.do). The number of replications and iterations can be adjusted in "gl reps" of 000_master.do.
For questions about the code, please contact NAME (chuxuan.sun@pennmedicine.upenn.edu).
Data required:
Register for access to the HRS and RAND HRS data on the HRS website (https://hrs.isr.umich.edu/data-products), then download the following files:
- HRS tracker file: trk2018tr_r.dta
- RAND HRS Longitudinal File: randhrs1992_2016v1.dta
Files located on the HSRDC server ("/origdata/HRS_CMS/output") include:
- BASF: basf_1992_2015.dta
- Part D: pde_YEAR.dta, for each YEAR from 2006-2015
- Denominator files: dn_YEAR.dta, for each YEAR from 1992-2012
- MBSF: mbsf_2013.dta, mbsf_2014.dta, mbsf_2015.dta
- Part A and B files: dm\ YEAR.dta, pb_ YEAR_.dta, hh\ YEAR.dta, hs_ YEAR_.dta, hs\ YEAR.dta, op_ YEAR_.dta, sn\ YEAR.dta, ip_ YEAR_.dta, for each YEAR from 1992-2015
- Medicaid MAX files: hrs_max_ip\ YEAR.dta, hrs_max_lt_ YEAR_.dta, hrs_max_ot\ YEAR.dta, hrs_max_rx_ YEAR_.dta, for each YEAR from 1999-2012
- Medicaid MAX Personal Summary files: hrs_max_ps_YEAR.dta, for each YEAR from 1999-2012
Finally, supplementary files include:
- Medicare cross-reference file: "/origdata/Coe_HRS/Medicare/xref2015medicare.dta"
Place all publicly accessible data files in the data folder. Do not place any data files in your home directory on the server, only in project folder.
Running the code:
This code is for Stata, and has been verified to run in version 17. The estout package is required to output tables.
Description of files:
The following describes how the files correspond to the inputs and output:
File | Description | Inputs/Outputs | Notes |
---|---|---|---|
000_master.do | Sets macros for all variables, specifications, and replications used in the other files | Only edit the global folder and the individual global macros | |
01_clean.do | Cleans and merges all raw data files | Inputs: HRS tracker file, randhrs1992_2016v1.dta, HRS-CMS linked data files listed above (located on the server) Output: Medicare.dta | |
02_est.do | Runs Basu and Manning method | Input: Medicare.dta Output: Cost-specific tables in both word and excel | Copy and paste excel output into draft tables for updates |
03_summarystatistics.do | Creates summary statistics | Inputs (produced in 01_clean.do): CasesAndControls.dta, AnalyticFileLongBasuVariables_ss_claims.dta, PD_wide.dta, and Medicaid_wide.dta Output: Summary statistics table and Figure 1 | If matching criteria changes (matchgrp variable) make sure to update the through value on line 18 to reflect max value |