Question: capture log close use / Users / abdul / Desktop / Presentation / njmin . dta, replace describe summarize use / Users /
capture log close
use UsersabdulDesktopPresentationnjmindta", replace
describe
summarize
use UsersabdulDesktopPresentationnjminreshaped.dta", replace
describe
summarize
this is exploring the data to confirm the structure matches the description in the paper and codebook.
use UsersabdulDesktopPresentationnjmindta", replace
Generate fulltime equivalent FTE employment variables before and after the wage change
gen FTEBEFORE EMPFT NMGRS EMPPT
gen FTEAFTER EMPFT NMGRS EMPPT
Create a variable for the gap in wages relative to the new minimum wage in NJ
gen GAP condSTATE & WAGEST WAGEST WAGEST
Descriptive statistics: Mean and Standard Error for NJ and PA before and after the wage change
Compute means and standard deviations by state for before and after wage change
egen MEANFTEBEFORE meanFTEBEFORE bySTATE
egen SDFTEBEFORE sdFTEBEFORE bySTATE
egen NBEFORE countFTEBEFORE bySTATE
gen SEFTEBEFORE SDFTEBEFORE sqrtNBEFORE
egen MEANFTEAFTER meanFTEAFTER bySTATE
egen SDFTEAFTER sdFTEAFTER bySTATE
egen NAFTER countFTEAFTER bySTATE
gen SEFTEAFTER SDFTEAFTER sqrtNAFTER
List these values for a quick view
list STATE MEANFTEBEFORE SEFTEBEFORE MEANFTEAFTER SEFTEAFTER if n n N
DifferenceinDifferences analysis
gen DELTAFTE FTEAFTER FTEBEFORE
gen TREATMENT STATE
Regression for differenceindifferences estimate
reg DELTAFTE TREATMENT
Check unique values in CHAIN to understand how many dummies are needed
tabulate CHAIN, missing
Generate dummy variables for each chain if they are categorical and not numeric IDs
Let's create dummy variables for chain and as an example
gen CHAINCHAIN
gen CHAINCHAIN
gen CHAINCHAIN
Run the regression with the newly created dummy variables
reg DELTAFTE TREATMENT COOWNED CHAIN CHAIN CHAIN
est tab
To export the regression results to an external file
outreg using results.doc, replace word
Interaction terms and nonlinear effects
gen WAGESQ WAGEST
gen INTERACTION TREATMENT WAGEST
reg DELTAFTE TREATMENT WAGEST WAGESQ INTERACTION
est store model
Check for robustness by addingremoving variables
reg DELTAFTE TREATMENT WAGEST WAGESQ
est store model
reg DELTAFTE TREATMENT WAGEST
est store model
reg DELTAFTE TREATMENT COOWNED CHAIN CHAIN CHAIN WAGEST WAGESQ
est store model
Displaying the Model in a comparative table
estout model model model model cellsbstar fmt separ fmt statsN r fmt labelsNumber of obs" Rsquared"
gen LOWWAGESTORE WAGEST
Run models for the low wage stores
reg DELTAFTE TREATMENT if LOWWAGESTORE
est store lowwagemodel
Table focus on different time effects or regions
reg DELTAFTE TREATMENT iYEAR iREGION
est store timeregionmodel
Check the first few entries of DATE
list DATE in
describe DATE
Convert DATE to string and ensure it's zeropadded to characters
gen strdate stringDATEf
Extract month, day, and year components
gen MONTH realsubstrstrdate,
gen DAY realsubstrstrdate,
Adjust year for YY format to s or s
gen YEAR realsubstrstrdate,
replace YEAR YEAR if YEAR
Combine components into a Stata daily date
gen date mdyMONTH DAY, YEAR
Now create YEAR and MONTH variables again for clarity
drop YEAR MONTH
gen YEAR yeardate
gen MONTH monthdate
Run regression with YEAR and MONTH as factors
reg DELTAFTE TREATMENT iYEAR iMONTH CHAIN CHAIN CHAIN
est store monthlymodel
esttab monthlymodel
Run regression with YEAR and MONTH as factors
reg DELTAFTE TREATMENT iYEAR iMONTH CHAIN CHAIN CHAIN
est store monthlymodel
Show results
esttab monthlymodel
Regression with the GAP variable
reg DELTAFTE GAP
Regression with GAP and additional controls
reg DELTAFTE GAP COOWNED CHAIN CHAIN CHAIN
Output results of regression models
estimates store Model
estimates store Model
estimates store Model
estimates store Model
estout Model Model Model Model cellsbstar fmt separ fmt statsN r fmt labelsNumber of obs" Rsquared"
Regression model including chain ownership and indicator variables for chains
reg DELTAFTE TREATMENT COOWNED CHAIN CHAIN CHAIN
Include polynomial terms of continuous variables
gen WAGESQ WAGEST
Predict Cook's distance for the regression model
predict cooksd cooksd
Drop observations with a Cook's distance greater than
drop if cooksd
gen TREATMENTALT condSTATE
which estout
ssc install estout, replace
ssc install outreg replace
reg DELTAFTE TREATMENT
outreg using results.doc, replace
reg DELTAFTE TREATMENT COOWNED CHAIN CHAIN
Please help correct the STATA code to replicate CARD AND KRUEGER PAPAER ON Minimum wage.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
