** Edward Witherington and Brian Moran ** ** Regression Research Do File ** ** December 13, 2024 ** **Changing Working Directory** cd "/Volumes/middfiles/Classes/Fall24/ECON0211C/PUBLIC_HTML/STUDENTS/EW&BM RP" use "/Volumes/middfiles/Classes/Fall24/ECON0211C/PUBLIC_HTML/STUDENTS/EW&BM RP/usa_00006.dta", clear *Narrowing dataset to individuals older than 18 and younger than 64 keep if age>18 & age<64 & poverty~=0 * Generating Variables * *Dummy Variable for individuals who are insured or not gen uninsured=(hcovany==1) *Dummy Variable for years from 2014 to 2023 gen postACA=(year>=2014) *Dummy Variable for states that adopted the ACA exapansions 01/01/2014 gen IMDA=(statefip==21 | statefip==5 | statefip==4 | statefip==6 | statefip==8 | statefip==9 | statefip==10 | statefip==15 | statefip==19 | statefip==17 | statefip==25 | statefip==24 | statefip==26 | statefip==27 | statefip==38 | statefip==34 | statefip==35 | statefip==32 | statefip==36 | statefip==39 | statefip==41 | statefip==44 | statefip==50 | statefip==53 | statefip==54) *Dummy Variable for states that adopted the ACA expansions at some point between 2014 and 2023 gen LTA= (statefip==2 | statefip==16 | statefip==18 | statefip==22 | statefip==23 | statefip==29 | statefip==30 | statefip==37 | statefip==31 | statefip==33 | statefip==40 | statefip==42 | statefip==46 | statefip==49 | statefip==51) *Dummy Variable for states that never adopted ACA exapansions gen NVA= (statefip==1 | statefip== 12| statefip==13 | statefip==20 | statefip==28 | statefip==45 | statefip==47 | statefip== 48 | statefip== 55 | statefip==56) *Generating variable for those whose income is below the 138% Federal Poverty Line gen under138=(poverty<138) replace under138=. if poverty==0 /* 0 is niu */ *Generating dummy variable for states that adopted ACA regardless of time gen treat= (statefip==21 | statefip==5 | statefip==4 | statefip==6 | statefip==8 | statefip==9 | statefip==10 | statefip==15 | statefip==19 | statefip==17 | statefip==25 | statefip==24 | statefip==26 | statefip==27 | statefip==38 | statefip==34 | statefip==35 | statefip==32 | statefip==36 | statefip==39 | statefip==41 | statefip==44 | statefip==50 | statefip==53 | statefip==54 | statefip==2 | statefip==16 | statefip==18 | statefip==22 | statefip==23 | statefip==29 | statefip==30 | statefip==37 | statefip==31 | statefip==33 | statefip==40 | statefip==42 | statefip==46 | statefip==49 | statefip==51) *Generating Interaction Term gen treatXpostACA=treat*postACA *Generating variable "statecat" to create table and graph gen statecat=. replace statecat=1 if statefip==21 | statefip==5 | statefip==4 | statefip==6 | statefip==8 | statefip==9 | statefip==10 | statefip==15 | statefip==19 | statefip==17 | statefip==25 | statefip==24 | statefip==26 | statefip==27 | statefip==38 | statefip==34 | statefip==35 | statefip==32 | statefip==36 | statefip==39 | statefip==41 | statefip==44 | statefip==50 | statefip==53 | statefip==54 replace statecat=2 if statefip==2 | statefip==16 | statefip==18 | statefip==22 | statefip==23 | statefip==29 |statefip==30 | statefip==37 | statefip==31 | statefip==33 | statefip==40 | statefip==42 | statefip==46 | statefip==49 | statefip==51 replace statecat=3 if statefip==1 | statefip== 12| statefip==13 | statefip==20 | statefip==28 | statefip==45 | statefip==47 | statefip== 48 | statefip== 55 | statefip==56 label define statefip 1 "Immediate" 2 "Late" 3 "Never", replace label val statecat statefip tab year statecat if under138==1 [w=perwt], sum(uninsured) means noobs *Creating Graph snapshot save keep if under138==1 collapse uninsured [w=perwt], by(statecat year) # delimit ; twoway (connected uninsured year if statecat==1) (connected uninsured year if statecat==2) (connected uninsured year if statecat==3), xline(2014) title("Health Coverage for Individuals Below the 138% FPL") subtitle("2010-2023") legend(label(1 "Immediate") label(2 "Late") label(3 "Never")) name(state, replace); # delimit cr graph export line.png, replace snapshot restore 1 *Adding Controls gen female=sex==2 gen unemp=empstat==2 replace unemp=. if empstat==3 *Dummy variables for race and Hispan gen white_nh=0 replace white_nh=1 if race==1 & hispan==0 gen black_nh=0 replace black_nh=1 if race==2 & hispan==0 gen other_nh=0 replace other_nh=1 if race>2 & hispan==0 gen hispanic=0 replace hispanic=1 if hispan>0 *Dummy variables for educational attainment gen LTHS=0 replace LTHS=1 if educ<6 gen HS=0 replace HS=1 if educ==6 gen SC=0 replace SC=1 if educ>=7 & educ<=9 gen BA=0 replace BA=1 if educ==10 gen GRAD=0 replace GRAD=1 if educ>10 & educ<12 *Generating state unemployment continuous variable bys statefip year: egen state_unemp=mean(unemp) **Summary Statistics** bys year: sum uninsured IMDA LTA NVA postACA age female white_nh black_nh other_nh hispanic state_unemp unemp LTHS HS SC BA GRAD * Create a subset for years before 2014 gen pre2014 = year<2014 sum uninsured IMDA LTA NVA postACA age female white_nh black_nh other_nh hispanic state_unemp unemp LTHS HS SC BA GRAD if pre2014 * Create a subset for years 2014 to 2023 gen post2014 = year>=2014 & year<=2023 sum uninsured IMDA LTA NVA postACA age female white_nh black_nh other_nh hispanic state_unemp unemp LTHS HS SC BA GRAD if post2014 ***Regressions*** ** Outreg2 Installation * ssc install outreg2 *Naive Regression reg uninsured IMDA LTA postACA if under138==1 [w=perwt], vce(cluster statefip) outreg2 using ACA_coverage, excel replace ctitle(Naive) *Interaction term regression reg uninsured IMDA LTA postACA treatXpost if under138==1 [w=perwt], vce(cluster statefip) outreg2 using ACA_coverage, excel append ctitle(Interaction) *Robust Regression reg uninsured IMDA LTA postACA treatXpost age female white_nh other_nh hispanic state_unemp unemp HS SC BA GRAD if under138==1 [w=perwt], vce(cluster statefip) outreg2 using ACA_coverage, excel append ctitle(Robust) *Generate Diff-in-Diff graph reg uninsured i.treat##i.postACA age female white_nh black_nh other_nh hispanic state_unemp HS SC BA GRAD if under138==1 [w=perwt], vce(cluster statefip) margins postACA, over(treat) marginsplot, name(DD_controls, replace) title("Diff-in-Diff: ACA and Insurance Access Individuals Below 138% FPL") subtitle(US ACS 2010-2023) graph export DND.png, replace ***Placebo Test*** *Creating same graph as before but for people above the 138% FPL preserve keep if under138==0 collapse uninsured [w=perwt], by(statecat year) # delimit ; twoway (connected uninsured year if statecat==1) (connected uninsured year if statecat==2) (connected uninsured year if statecat==3), xline(2014) title("Health Coverage for Individuals Above the 138% FPL") subtitle("2010-2023") legend(label(1 "Immediate") label(2 "Late") label(3 "Never")) name(state, replace); # delimit cr graph export Placebo.png, replace restore **Regression for individuals NOT in poverty ** *Naive Regression reg uninsured IMDA LTA postACA if under138==0 [w=perwt], vce(cluster statefip) outreg2 using ACA_coverage2, excel replace ctitle(Naive) *Interaction reg uninsured IMDA LTA postACA treatXpost if under138==0 [w=perwt], vce(cluster statefip) outreg2 using ACA_coverage2, excel append ctitle(Interaction) *Robust reg uninsured IMDA LTA postACA treatXpost age female white_nh other_nh hispanic state_unemp unemp HS SC BA GRAD if under138==0 [w=perwt], vce(cluster statefip) outreg2 using ACA_coverage2, excel append ctitle(Robust) *Diff-in-Diff for Placebo reg uninsured i.treat##i.postACA age female white_nh other_nh hispanic state_unemp HS SC BA GRAD if under138==0 [w=perwt], vce(cluster statefip) margins postACA, over(treat) marginsplot, name(DD_controls_placebo, replace) title("Diff-in-Diff: ACA and Insurance Access for Individuals Above the 138% FPL") subtitle(US ACS 2010-2023) graph export placebodnd.png, replace