************************************** *EstModel.do: *called by McFadden.do *actually estimates the model ************************************** *Log Version: treats nonwork as the base category and uses the log of total real income in the remaining categories * as the policy variable ******************************** ****Convert into mcfadden format ******************************** gen id = _n reshape long wratio wratio_other wratio_me, i(id) j(wks) *look at data to make sure this did what it should: *sort country year id weeks *list country year id weeks wratio in 1/100 *Actual weeks worked gen choice = 0 replace choice = 1 if wks == 0 & weeks == 0 replace choice = 1 if wks == 12 & weeks == 1 replace choice = 1 if wks == 20 & weeks == 2 replace choice = 1 if wks == 33 & weeks == 3 replace choice = 1 if wks == 52 & weeks == 4 ******************************************************************* *Interactions for mcfadden model gen wks12 = wks == 12 gen wks20 = wks == 20 gen wks33 = wks == 33 gen wks52 = wks == 52 ********** *Note: because the "parttime" variable is only available for workers, we need to drop it * from this specification too *Main Effects: foreach V in y1980 y1990 { quietly gen byte `V'_12 = `V' * wks12 quietly gen byte `V'_20 = `V' * wks20 quietly gen byte `V'_33 = `V' * wks33 quietly gen byte `V'_52 = `V' * wks52 } foreach V in nb married age age_sq children inschool highschl somepost degree { quietly gen byte `V'12 = `V' * wks12 quietly gen byte `V'20 = `V' * wks20 quietly gen byte `V'33 = `V' * wks33 quietly gen byte `V'52 = `V' * wks52 } * X * region: foreach V in married age age_sq children inschool highschl somepost degree { quietly gen byte `V'12_nb = `V' * wks12 * nb quietly gen byte `V'20_nb = `V' * wks20 * nb quietly gen byte `V'33_nb = `V' * wks33 * nb quietly gen byte `V'52_nb = `V' * wks52 * nb } * Year * region: foreach V in y1980 y1990 { quietly gen byte `V'_12_nb = `V' * wks12 * nb quietly gen byte `V'_20_nb = `V' * wks20 * nb quietly gen byte `V'_33_nb = `V' * wks33 * nb quietly gen byte `V'_52_nb = `V' * wks52 * nb } log close ************ *Regressions ************ #delimit ; log using "Coeffs & Preds, $sex", replace; *Means of all the (actual and counterfactual) policy variables:; sort country year; *ACTUAL:; by country year: tab wks, sum(wratio); sort year; *NB, UNDER 1970 UI RULES:; by year: tab wks if nb==1, sum(wratio_other); *NB, UNDER ME UI RULES:; by year: tab wks if nb==1, sum(wratio_me); ******************************; gen inc_diff = wratio; *BELOW, PUT THE SPECIFICATION YOU WANT TO CALCULATE COUNTERFACTUAL PREDICTIONS FOR **SECOND**:; *WITHOUT region-year interactions:; clogit choice inc_diff wks12 wks20 wks33 wks52 nb12 nb20 nb33 nb52 y1980_12 - y1990_52 married12-degree52 married12_nb-degree52_nb, group(id) ; *WITH region-year interactions:; clogit choice inc_diff wks12 wks20 wks33 wks52 nb12 nb20 nb33 nb52 y1980_12 - y1990_52 married12-degree52 married12_nb-degree52_nb y1980_12_nb - y1990_52_nb, group(id) ; #delimit cr; ********************************* *Actual weeks worked distributions ************************************* sort me year display "$sex" by me year: tab wks, sum(choice) ************************************* *Predicted weeks worked distributions ************************************* predict choice_P sort me year display "$sex" by me year: tab wks, sum(choice_P) **************************************************************** *Predicted weeks worked distributions under different UI regimes **************************************************************** **SIMULATION #1 (remove 71 UI Act in NB) replace inc_diff = wratio_other **New weeks worked distribution predict choice_P4 sort year display "$sex" by year: tab wks if nb==1, sum(choice_P4) ******************** **SIMULATION #2 (impose Maine system on NB) replace inc_diff = wratio_me **New weeks worked distribution predict choice_P5 sort year display "$sex" by year: tab wks if nb==1, sum(choice_P5) log close ******END*********