Question: capture log close use / Users / abdul / Desktop / Presentation / njmin . dta, replace describe summarize use / Users /

capture log close
use "/Users/abdul/Desktop/Presentation/njmin.dta", replace
describe
summarize
use "/Users/abdul/Desktop/Presentation/njmin_reshaped.dta", replace
describe
summarize
**this is exploring the data to confirm the structure matches the description in the paper and codebook. **
use "/Users/abdul/Desktop/Presentation/njmin.dta", replace
* Generate full-time equivalent (FTE) employment variables before and after the wage change
gen FTE_BEFORE = EMPFT + NMGRS +0.5* EMPPT
gen FTE_AFTER = EMPFT2+ NMGRS2+0.5* EMPPT2
* Create a variable for the gap in wages relative to the new minimum wage in NJ
gen GAP = cond(STATE ==1 & WAGE_ST <5.05,(5.05- WAGE_ST)/ WAGE_ST,0)
* 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 MEAN_FTE_BEFORE = mean(FTE_BEFORE), by(STATE)
egen SD_FTE_BEFORE = sd(FTE_BEFORE), by(STATE)
egen N_BEFORE = count(FTE_BEFORE), by(STATE)
gen SE_FTE_BEFORE = SD_FTE_BEFORE / sqrt(N_BEFORE)
egen MEAN_FTE_AFTER = mean(FTE_AFTER), by(STATE)
egen SD_FTE_AFTER = sd(FTE_AFTER), by(STATE)
egen N_AFTER = count(FTE_AFTER), by(STATE)
gen SE_FTE_AFTER = SD_FTE_AFTER / sqrt(N_AFTER)
* List these values for a quick view
list STATE MEAN_FTE_BEFORE SE_FTE_BEFORE MEAN_FTE_AFTER SE_FTE_AFTER if _n ==1|_n ==_N
* Difference-in-Differences analysis
gen DELTA_FTE = FTE_AFTER - FTE_BEFORE
gen TREATMENT =(STATE ==1)
* Regression for difference-in-differences estimate
reg DELTA_FTE 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 2,3, and 4 as an example
gen CHAIN2=(CHAIN ==2)
gen CHAIN3=(CHAIN ==3)
gen CHAIN4=(CHAIN ==4)
* Run the regression with the newly created dummy variables
reg DELTA_FTE TREATMENT CO_OWNED CHAIN2 CHAIN3 CHAIN4
est tab
*To export the regression results to an external file
outreg2 using results.doc, replace word
* Interaction terms and non-linear effects
gen WAGE_SQ = WAGE_ST^2
gen INTERACTION = TREATMENT * WAGE_ST
reg DELTA_FTE TREATMENT WAGE_ST WAGE_SQ INTERACTION
est store model1
* Check for robustness by adding/removing variables
reg DELTA_FTE TREATMENT WAGE_ST WAGE_SQ
est store model2
reg DELTA_FTE TREATMENT WAGE_ST
est store model3
reg DELTA_FTE TREATMENT CO_OWNED CHAIN2 CHAIN3 CHAIN4 WAGE_ST WAGE_SQ
est store model4
*Displaying the Model in a comparative table
estout model1 model2 model3 model4, cells(b(star fmt(3)) se(par fmt(3))) stats(N r2, fmt(33) labels("Number of obs" "R-squared"))
gen LOW_WAGE_STORE =(WAGE_ST <5.05)
* Run models for the low wage stores
reg DELTA_FTE TREATMENT if LOW_WAGE_STORE ==1
est store low_wage_model
* Table 7 focus on different time effects or regions
reg DELTA_FTE TREATMENT i.YEAR i.REGION
est store time_region_model
* Check the first few entries of DATE2
list DATE2 in 1/10
describe DATE2
* Convert DATE2 to string and ensure it's zero-padded to 6 characters
gen str_date = string(DATE2,"%06.0f")
* Extract month, day, and year components
gen MONTH = real(substr(str_date, 1,2))
gen DAY = real(substr(str_date, 3,2))
* Adjust year for YY format to 1900s or 2000s
gen YEAR = real(substr(str_date, 5,2))
replace YEAR = YEAR +1900 if YEAR <100
* Combine components into a Stata daily date
gen date = mdy(MONTH, DAY, YEAR)
* Now create YEAR and MONTH variables again for clarity
drop YEAR MONTH
gen YEAR = year(date)
gen MONTH = month(date)
* Run regression with YEAR and MONTH as factors
reg DELTA_FTE TREATMENT i.YEAR i.MONTH CHAIN2 CHAIN3 CHAIN4
est store monthly_model
esttab monthly_model
* Run regression with YEAR and MONTH as factors
reg DELTA_FTE TREATMENT i.YEAR i.MONTH CHAIN2 CHAIN3 CHAIN4
est store monthly_model
* Show results
esttab monthly_model
* Regression with the GAP variable
reg DELTA_FTE GAP
* Regression with GAP and additional controls
reg DELTA_FTE GAP CO_OWNED CHAIN2 CHAIN3 CHAIN4
* Output results of regression models
estimates store Model1
estimates store Model2
estimates store Model3
estimates store Model4
estout Model1 Model2 Model3 Model4, cells(b(star fmt(3)) se(par fmt(3))) stats(N r2, fmt(33) labels("Number of obs" "R-squared"))
* Regression model including chain ownership and indicator variables for chains
reg DELTA_FTE TREATMENT CO_OWNED CHAIN2 CHAIN3 CHAIN4
* Include polynomial terms of continuous variables
gen WAGE_SQ = WAGE_ST^2
* Predict Cook's distance for the regression model
predict cooks_d, cooksd
* Drop observations with a Cook's distance greater than 0.5
drop if cooks_d >0.5
gen TREATMENT_ALT = cond(STATE ==1,1,0)
which estout
ssc install estout, replace
ssc install outreg2, replace
reg DELTA_FTE TREATMENT
outreg2 using results.doc, replace
reg DELTA_FTE TREATMENT CO_OWNED CHAIN2 CHAIN3
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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!