*********************************************** * THIS FILE EXTEND THE EMPIRICAL ANALYSIS * TO INCLUDE ADDITIONAL SPECIFICATIONS ************************************************ log using pf, replace set trace off set more off capture drop _all set mem 120m set matsize 800 *set mem 210m *set virtual on *set matsize 800 ********************************************************* *********************************************** * READ DATA *********************************************** ********************************************************** clear use D:/drive-e/moretti/stata/data2, clear gen x = coll6 gen x80 = coll680 gen Dx = coll6 - coll680 gen ind3_st = ind3*1000 +fst gen ind2_st = ind2*1000 +fst keep if obs30 > 20 drop _merge **************************************************** * THREE GROUPS (L2 is drop out + hs grad) **************************************************** gen L1 = exp(logL1) gen L2 = exp(logL2) replace logL2 = log(L1 + L2) gen L180 = exp(logL180) gen L280 = exp(logL280) replace logL280 = log(L180 + L280) replace DlogL2 = logL2 - logL280 reg DlogVA Dx DlogL2 DlogL3 DlogL4 DlogK mu , cluster(smsa80) areg DlogVA Dx DlogL2 DlogL3 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx DlogL2 DlogL3 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx DlogL2 DlogL3 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) xi: areg DlogVA Dx i.ind2|DlogL2 i.ind2|DlogL3 i.ind2|DlogL4 i.ind2|DlogK mu , cluster(smsa80) absorb(ind3_st) g DlogL2sq = DlogL2*DlogL2 g DlogL4sq = DlogL4*DlogL4 g DlogKsq = DlogK*DlogK g DlogL2_K = DlogL2*DlogK g DlogL4_K = DlogL4*DlogK g DlogL2_L = DlogL2*DlogL4 g DlogL3sq = DlogL3*DlogL3 g DlogL3_K = DlogL3*DlogK g DlogL3_4 = DlogL3*DlogL4 g DlogL2_3 = DlogL2*DlogL3 reg DlogVA Dx DlogL2 DlogL2sq DlogL3 DlogL3sq DlogL4 DlogL4sq DlogK DlogKsq DlogL2_K DlogL3_K DlogL4_K DlogL2_L4 DlogL3_4 DlogL2_3 mu, cluster(smsa80) areg DlogVA Dx DlogL2 DlogL2sq DlogL3 DlogL3sq DlogL4 DlogL4sq DlogK DlogKsq DlogL2_K DlogL3_K DlogL4_K DlogL2_L4 DlogL3_4 DlogL2_3 mu, cluster(smsa80) absorb(fst) areg DlogVA Dx DlogL2 DlogL2sq DlogL3 DlogL3sq DlogL4 DlogL4sq DlogK DlogKsq DlogL2_K DlogL3_K DlogL4_K DlogL2_L4 DlogL3_4 DlogL2_3 mu, cluster(smsa80) absorb(ind3) areg DlogVA Dx DlogL2 DlogL2sq DlogL3 DlogL3sq DlogL4 DlogL4sq DlogK DlogKsq DlogL2_K DlogL3_K DlogL4_K DlogL2_L4 DlogL3_4 DlogL2_3 mu, cluster(smsa80) absorb(ind3_st) xi: areg DlogVA Dx i.ind2|DlogL2 i.ind2|DlogL2sq i.ind2|DlogL3 i.ind2|DlogL3sq i.ind2|DlogL4 i.ind2|DlogL4sq i.ind2|DlogK i.ind2|DlogKsq i.ind2|DlogL2_K i.ind2|DlogL3_K i.ind2|DlogL4_K i.ind2|DlogL2_L4 i.ind2|DlogL3_4 i.ind2|DlogL2_3 mu, cluster(smsa80) absorb(ind3_st) * HOURS WORKED BY PROD AND NON PRODUCTION WORKERS, BY PLANT use D:/drive-e/moretti/Cm/st828792, clear drop if yr ~= 92 gen logH1 = log(ph) gen ph2 = (ph/pw)*(te-pw) gen logH2 = log(ph2) gen logH1b = log(pw) gen logH2b = log(te-pw) keep ppn logH1 logH2 logH1b logH2b sort ppn save tmp, replace use D:/drive-e/moretti/Cm/st828792, clear drop if yr ~= 82 gen logH180 = log(ph) gen ph2 = (ph/pw)*(te-pw) gen logH280 = log(ph2) gen logH180b = log(pw) gen logH280b = log(te-pw) keep ppn logH180 logH280 logH180b logH280b sort ppn merge ppn using tmp drop _merge sort ppn save tmp, replace * MERGE WITH MAIN DATA use D:/drive-e/moretti/stata/data, clear gen x = coll6 gen x80 = coll680 gen Dx = coll6 - coll680 gen ind3_st = ind3*1000 +fst gen ind2_st = ind2*1000 +fst keep if obs30 > 20 drop _merge sort ppn merge ppn using tmp drop _merge sort smsa ind2 merge smsa ind2 using temp2 drop _merge drop if DlogVA ==. summ gen DlogH1 = logH1 - logH180 gen DlogH2 = logH2 - logH280 * Include the following 2 lines to use bodies instead of hours *gen DlogH1 = logH1b - logH180b *gen DlogH2 = logH2b - logH280b * Save data for later use in large-plants/iv3.do *save large-plants/data3, replace replace DlogH1 = 0 if DlogH1 ==. replace DlogH2 = 0 if DlogH2 ==. * HERE I INCLUDE ONLY H1-H2 reg DlogVA Dx DeducNP DeducP DlogH1 DlogH2 DlogK mu, cluster(smsa80) areg DlogVA Dx DeducNP DeducP DlogH1 DlogH2 DlogK mu, cluster(smsa80) absorb(fst) areg DlogVA Dx DeducNP DeducP DlogH1 DlogH2 DlogK mu, cluster(smsa80) absorb(ind3) areg DlogVA Dx DeducNP DeducP DlogH1 DlogH2 DlogK mu, cluster(smsa80) absorb(ind3_st) xi: areg DlogVA Dx DeducNP DeducP i.ind2|DlogH1 i.ind2|DlogH2 i.ind2|DlogK mu , cluster(smsa80) absorb(ind3_st) * HERE I INCLUDE BOTH L1-L4 AND H1-H2 * reg DlogVA Dx DeducNP DeducP DlogL1 DlogL4 DlogH1 DlogH2 DlogK mu, cluster(smsa80) * areg DlogVA Dx DeducNP DeducP DlogL1 DlogL4 DlogH1 DlogH2 DlogK mu, cluster(smsa80) absorb(fst) * areg DlogVA Dx DeducNP DeducP DlogL1 DlogL4 DlogH1 DlogH2 DlogK mu, cluster(smsa80) absorb(ind3) * areg DlogVA Dx DeducNP DeducP DlogL1 DlogL4 DlogH1 DlogH2 DlogK mu, cluster(smsa80) absorb(ind3_st) * xi: areg DlogVA Dx DeducNP DeducP i.ind2|DlogL1 i.ind2|DlogL4 i.ind2|DlogH1 i.ind2|DlogH2 i.ind2|DlogK mu , cluster(smsa80) absorb(ind3_st) g logL1sq = logL1*logL1 g logL4sq = logL4*logL4 g logKsq = logK*logK g logL1_K = logL1*logK g logL4_K = logL4*logK g logL1_L4 = logL1*logL4 g logL1sq8 = logL180*logL180 g logL4sq8 = logL480*logL480 g logKsq8 = logK80*logK80 g logL1_K8 = logL180*logK80 g logL4_K8 = logL480*logK80 g logL1_L8 = logL180*logL480 g DlogL1sq = DlogL1*DlogL1 g DlogL4sq = DlogL4*DlogL4 g DlogKsq = DlogK*DlogK g DlogL1_K = DlogL1*DlogK g DlogL4_K = DlogL4*DlogK g DlogL1_L = DlogL1*DlogL4 g logH1sq = logH1*logH1 g logH2sq = logH2*logH2 g logH1_K = logH1*logK g logH2_K = logH2*logK g logH1_H2 = logH1*logH2 g logH1sq8 = logH180*logH180 g logH2sq8 = logH280*logH280 g logH1_K8 = logH180*logK80 g logH2_K8 = logH280*logK80 g logH1_H8 = logH180*logH280 g DlogH1sq = DlogH1*DlogH1 g DlogH2sq = DlogH2*DlogH2 g DlogH1_K = DlogH1*DlogK g DlogH2_K = DlogH2*DlogK g DlogH1_H = DlogH1*DlogH2 reg DlogVA Dx DeducNP DeducP DlogL1 DlogL1sq DlogL4 DlogL4sq DlogK DlogKsq DlogL1_K DlogL4_K DlogL1_L4 mu DlogH1sq DlogH2 DlogH2sq DlogH1_K DlogH2_K DlogH1_H2, cluster(smsa80) areg DlogVA Dx DeducNP DeducP DlogL1 DlogL1sq DlogL4 DlogL4sq DlogK DlogKsq DlogL1_K DlogL4_K DlogL1_L4 mu DlogH1sq DlogH2 DlogH2sq DlogH1_K DlogH2_K DlogH1_H2, cluster(smsa80) absorb(fst) areg DlogVA Dx DeducNP DeducP DlogL1 DlogL1sq DlogL4 DlogL4sq DlogK DlogKsq DlogL1_K DlogL4_K DlogL1_L4 mu DlogH1sq DlogH2 DlogH2sq DlogH1_K DlogH2_K DlogH1_H2, cluster(smsa80) absorb(ind3) areg DlogVA Dx DeducNP DeducP DlogL1 DlogL1sq DlogL4 DlogL4sq DlogK DlogKsq DlogL1_K DlogL4_K DlogL1_L4 mu DlogH1sq DlogH2 DlogH2sq DlogH1_K DlogH2_K DlogH1_H2, cluster(smsa80) absorb(ind3_st) xi: areg DlogVA Dx DeducNP DeducP i.ind2|DlogL1 i.ind2|DlogL1sq i.ind2|DlogL4 i.ind2|DlogL4sq i.ind2|DlogK i.ind2|DlogKsq i.ind2|DlogL1_K i.ind2|DlogL4_K i.ind2|DlogL1_L4 mu i.ind2|DlogH1sq i.ind2|DlogH2 i.ind2|DlogH2sq i.ind2|DlogH1_K i.ind2|DlogH2_K i.ind2|DlogH1_H2, cluster(smsa80) absorb(ind3_st) **************************************************** * PRODUCTION - NON PRODUCTION * ALTERNATIVE MODEL WHERE PROD and NON PRODUCTION * ARE SPLIT IN VARIOUS EDUCATION GROUPS **************************************************** * EDUCATION OF PRODUCTION WORKERS clear use D:/drive-e/moretti/July03-revision/imported/medu-20groups-pw-npw/medu_l11 keep if prod ==0 drop if sic <24 rename sic ind2 fillin smsa ind2 years replace n = 0 if n==. replace n80 = 0 if n80 ==. egen D = sum(n), by(smsa ind2) egen D80 = sum(n80), by(smsa ind2) g w = n/D g w80 = n80/D80 replace w =0 if w ==. replace w80 =0 if w80==. keep smsa ind2 years w w80 reshape wide w w80, i(smsa ind2) j(years) sort smsa ind2 save tmp, replace summ * EDUCATION OF NON-PRODUCTION WORKERS clear use D:/drive-e/moretti/July03-revision/imported/medu-20groups-pw-npw/medu_l11 keep if prod ==1 drop if sic <24 rename sic ind2 fillin smsa ind2 years replace n = 0 if n==. replace n80 = 0 if n80 ==. egen D = sum(n), by(smsa ind2) egen D80 = sum(n80), by(smsa ind2) g w = n/D g w80 = n80/D80 replace w =0 if w ==. replace w80 =0 if w80==. rename w wB rename w80 wB80 keep smsa ind2 years wB wB80 reshape wide wB wB80, i(smsa ind2) j(years) sort smsa ind2 * MERGE merge smsa ind2 using tmp drop _merge sort smsa ind2 save temp2, replace summ * HOURS WORKED BY PROD AND NON PRODUCTION WORKERS, BY PLANT use D:/drive-e/moretti/Cm/st828792, clear drop if yr ~= 92 gen ph2 = (ph/pw)*(te-pw) g npw = te-pw keep ppn ph ph2 npw te sort ppn save tmp, replace use D:/drive-e/moretti/Cm/st828792, clear drop if yr ~= 82 gen ph280 = (ph/pw)*(te-pw) rename ph ph80 g npw80 = te-pw rename te te80 keep ppn ph80 ph280 te80 npw80 sort ppn merge ppn using tmp drop _merge sort ppn save tmp, replace * MERGE WITH MAIN DATA use D:/drive-e/moretti/stata/data, clear gen x = coll6 gen x80 = coll680 gen Dx = coll6 - coll680 gen ind3_st = ind3*1000 +fst gen ind2_st = ind2*1000 +fst keep if obs30 > 20 drop _merge te* sort ppn merge ppn using tmp drop _merge sort smsa ind2 merge smsa ind2 using temp2 drop _merge drop if DlogVA ==. ************************** * TWO GROUPS ************************** * use bodies instead of hours * IMPUTE HOURS WORKED BY PRODUCTION AND NON-PRODUCTION g P1 = ph*(w0+w1+w2+w3+w4+w5+w6+w7+w8+w9+w10+w11+w12) g P2 = ph*(w13+w14+w15+w16+w17+w18+w19+w20) g NP1 = ph2*(wB0+wB1+wB2+wB3+wB4+wB5+wB6+wB7+wB8+wB9+wB10+wB11+wB12) g NP2 = ph2*(wB13+wB14+wB15+wB16+wB17+wB18+wB19+wB20) g P180 = ph80*(w800+w801+w802+w803+w804+w805+w806+w807+w808+w809+w8010+w8011+w8012) g P280 = ph80*(w8013+w8014+w8015+w8016+w8017+w8018+w8019+w8020) g NP180 = ph280*(wB800+wB801+wB802+wB803+wB804+wB805+wB806+wB807+wB808+wB809+wB8010+wB8011+wB8012) g NP280 = ph280*(wB8013+wB8014+wB8015+wB8016+wB8017+wB8018+wB8019+wB8020) g DlogP1 = log(P1) - log(P180) g DlogP2 = log(P2) - log(P280) g DlogNP1 = log(NP1) - log(NP180) g DlogNP2 = log(NP2) - log(NP280) summ DlogP* DlogNP* reg DlogVA Dx DlogP1 DlogP2 DlogNP1 DlogNP2 DlogK mu, cluster(smsa80) areg DlogVA Dx DlogP1 DlogP2 DlogNP1 DlogNP2 DlogK mu, cluster(smsa80) absorb(fst) areg DlogVA Dx DlogP1 DlogP2 DlogNP1 DlogNP2 DlogK mu, cluster(smsa80) absorb(ind3) areg DlogVA Dx DlogP1 DlogP2 DlogNP1 DlogNP2 DlogK mu, cluster(smsa80) absorb(ind3_st) xi: areg DlogVA Dx i.ind2|DlogP1 i.ind2|DlogP2 i.ind2|DlogNP1 i.ind2|DlogNP2 i.ind2|DlogK mu , cluster(smsa80) absorb(ind3_st) g DlogM1 = DlogP1 g DlogM2 = DlogP2 g DlogM3 = DlogNP1 g DlogM4 = DlogNP2 g DlogM5 = 0 g DlogM6 = 0 g DlogM7 = 0 g DlogM8 = 0 g DlogM9 = 0 g DlogM10 = 0 g DlogKsq = DlogK*DlogK g DM1sq = DlogM1*DlogM1 g DM2sq = DlogM2*DlogM2 g DM3sq = DlogM3*DlogM3 g DM4sq = DlogM4*DlogM4 g DM5sq = DlogM5*DlogM5 g DM6sq = DlogM6*DlogM6 g DM7sq = DlogM7*DlogM7 g DM8sq = DlogM8*DlogM8 g DM9sq = DlogM9*DlogM9 g DM10sq = DlogM10*DlogM10 g M1K = DlogM1*DlogK g M2K = DlogM2*DlogK g M3K = DlogM3*DlogK g M4K = DlogM4*DlogK g M5K = DlogM5*DlogK g M6K = DlogM6*DlogK g M7K = DlogM7*DlogK g M8K = DlogM8*DlogK g M9K = DlogM9*DlogK g M10K = DlogM10*DlogK g M1M2 = DlogM1*DlogM2 g M1M3 = DlogM1*DlogM3 g M1M4 = DlogM1*DlogM4 g M1M5 = DlogM1*DlogM5 g M1M6 = DlogM1*DlogM6 g M1M7 = DlogM1*DlogM7 g M1M8 = DlogM1*DlogM8 g M1M9 = DlogM1*DlogM9 g M1M10 = DlogM1*DlogM10 g M2M3 = DlogM2*DlogM3 g M2M4 = DlogM2*DlogM4 g M2M5 = DlogM2*DlogM5 g M2M6 = DlogM2*DlogM6 g M2M7 = DlogM2*DlogM7 g M2M8 = DlogM2*DlogM8 g M2M9 = DlogM2*DlogM9 g M2M10 = DlogM2*DlogM10 g M3M4 = DlogM3*DlogM4 g M3M5 = DlogM3*DlogM5 g M3M6 = DlogM3*DlogM6 g M3M7 = DlogM3*DlogM7 g M3M8 = DlogM3*DlogM8 g M3M9 = DlogM3*DlogM9 g M3M10 = DlogM3*DlogM10 g M4M5 = DlogM4*DlogM5 g M4M6 = DlogM4*DlogM6 g M4M7 = DlogM4*DlogM7 g M4M8 = DlogM4*DlogM8 g M4M9 = DlogM4*DlogM9 g M4M10 = DlogM4*DlogM10 g M5M6 = DlogM5*DlogM6 g M5M7 = DlogM5*DlogM7 g M5M8 = DlogM5*DlogM8 g M5M9 = DlogM5*DlogM9 g M5M10 = DlogM5*DlogM10 g M6M7 = DlogM6*DlogM7 g M6M8 = DlogM6*DlogM8 g M6M9 = DlogM6*DlogM9 g M6M10 = DlogM6*DlogM10 g M7M8 = DlogM7*DlogM8 g M7M9 = DlogM7*DlogM9 g M7M10 = DlogM7*DlogM10 g M8M9 = DlogM8*DlogM9 g M8M10 = DlogM8*DlogM10 g M9M10 = DlogM9*DlogM10 reg DlogVA Dx DlogM1 DlogM2 DlogM3 DlogM4 DlogM5 DlogM6 DlogM7 DlogM8 DlogM9 DlogM10 DlogK DlogKsq DM1sq DM2sq DM3sq DM4sq DM5sq DM6sq DM7sq DM8sq DM9sq DM10sq M1K M2K M3K M4K M5K M6K M7K M8K M9K M10K M1M2 M1M3 M1M4 M1M5 M1M6 M1M7 M1M8 M1M9 M1M10 M2M3 M2M4 M2M5 M2M6 M2M7 M2M8 M2M9 M2M10 M3M4 M3M5 M3M6 M3M7 M3M8 M3M9 M3M10 M4M5 M4M6 M4M7 M4M8 M4M9 M4M10 M5M6 M5M7 M5M8 M5M9 M5M10 M6M7 M6M8 M6M9 M6M10 M7M8 M7M9 M7M10 M8M9 M8M10 M9M10 mu , cluster(smsa80) areg DlogVA Dx DlogM1 DlogM2 DlogM3 DlogM4 DlogM5 DlogM6 DlogM7 DlogM8 DlogM9 DlogM10 DlogK DlogKsq DM1sq DM2sq DM3sq DM4sq DM5sq DM6sq DM7sq DM8sq DM9sq DM10sq M1K M2K M3K M4K M5K M6K M7K M8K M9K M10K M1M2 M1M3 M1M4 M1M5 M1M6 M1M7 M1M8 M1M9 M1M10 M2M3 M2M4 M2M5 M2M6 M2M7 M2M8 M2M9 M2M10 M3M4 M3M5 M3M6 M3M7 M3M8 M3M9 M3M10 M4M5 M4M6 M4M7 M4M8 M4M9 M4M10 M5M6 M5M7 M5M8 M5M9 M5M10 M6M7 M6M8 M6M9 M6M10 M7M8 M7M9 M7M10 M8M9 M8M10 M9M10 mu, cluster(smsa80) absorb(fst) areg DlogVA Dx DlogM1 DlogM2 DlogM3 DlogM4 DlogM5 DlogM6 DlogM7 DlogM8 DlogM9 DlogM10 DlogK DlogKsq DM1sq DM2sq DM3sq DM4sq DM5sq DM6sq DM7sq DM8sq DM9sq DM10sq M1K M2K M3K M4K M5K M6K M7K M8K M9K M10K M1M2 M1M3 M1M4 M1M5 M1M6 M1M7 M1M8 M1M9 M1M10 M2M3 M2M4 M2M5 M2M6 M2M7 M2M8 M2M9 M2M10 M3M4 M3M5 M3M6 M3M7 M3M8 M3M9 M3M10 M4M5 M4M6 M4M7 M4M8 M4M9 M4M10 M5M6 M5M7 M5M8 M5M9 M5M10 M6M7 M6M8 M6M9 M6M10 M7M8 M7M9 M7M10 M8M9 M8M10 M9M10 mu, cluster(smsa80) absorb(ind3) areg DlogVA Dx DlogM1 DlogM2 DlogM3 DlogM4 DlogM5 DlogM6 DlogM7 DlogM8 DlogM9 DlogM10 DlogK DlogKsq DM1sq DM2sq DM3sq DM4sq DM5sq DM6sq DM7sq DM8sq DM9sq DM10sq M1K M2K M3K M4K M5K M6K M7K M8K M9K M10K M1M2 M1M3 M1M4 M1M5 M1M6 M1M7 M1M8 M1M9 M1M10 M2M3 M2M4 M2M5 M2M6 M2M7 M2M8 M2M9 M2M10 M3M4 M3M5 M3M6 M3M7 M3M8 M3M9 M3M10 M4M5 M4M6 M4M7 M4M8 M4M9 M4M10 M5M6 M5M7 M5M8 M5M9 M5M10 M6M7 M6M8 M6M9 M6M10 M7M8 M7M9 M7M10 M8M9 M8M10 M9M10 mu, cluster(smsa80) absorb(ind3_st) xi: areg DlogVA Dx i.ind2|DlogM1 i.ind2|DlogM2 i.ind2|DlogM3 i.ind2|DlogM4 i.ind2|DlogK i.ind2|DlogKsq i.ind2|DM1sq i.ind2|DM2sq i.ind2|DM3sq i.ind2|DM4sq i.ind2|M1K i.ind2|M2K i.ind2|M3K i.ind2|M4K i.ind2|M1M2 i.ind2|M1M3 i.ind2|M1M4 i.ind2|M2M3 i.ind2|M2M4 i.ind2|M3M4 mu, cluster(smsa80) absorb(ind3_st) **************************** * THREE GROUPS **************************** drop P1* P2* NP* DlogP* DlogNP* DlogM* DlogKsq* M* DM* * IMPUTE HOURS WORKED BY PRODUCTION AND NON-PRODUCTION g P1 = ph*(w0+w1+w2+w3+w4+w5+w6+w7+w8+w9+w10+w11+w12) g P2 = ph*(w13+w14+w15) g P3 = ph*(w16+w17+w18+w19+w20) g NP1 = ph2*(wB0+wB1+wB2+wB3+wB4+wB5+wB6+wB7+wB8+wB9+wB10+wB11+wB12) g NP2 = ph2*(wB13+wB14+wB15) g NP3 = ph2*(wB16+wB17+wB18+wB19+wB20) g P180 = ph80*(w800+w801+w802+w803+w804+w805+w806+w807+w808+w809+w8010+w8011+w8012) g P280 = ph80*(w8013+w8014+w8015) g P380 = ph80*(w8016+w8017+w8018+w8019+w8020) g NP180 = ph280*(wB800+wB801+wB802+wB803+wB804+wB805+wB806+wB807+wB808+wB809+wB8010+wB8011+wB8012) g NP280 = ph280*(wB8013+wB8014+wB8015) g NP380 = ph280*(wB8016+wB8017+wB8018+wB8019+wB8020) g DlogP1 = log(P1) - log(P180) g DlogP2 = log(P2) - log(P280) g DlogP3 = log(P3) - log(P380) g DlogNP1 = log(NP1) - log(NP180) g DlogNP2 = log(NP2) - log(NP280) g DlogNP3 = log(NP3) - log(NP380) summ DlogP* DlogNP* *replace DlogH1 = 0 if DlogH1 ==. *replace DlogH2 = 0 if DlogH2 ==. reg DlogVA Dx DlogP1 DlogP2 DlogP3 DlogNP1 DlogNP2 DlogNP3 DlogK mu, cluster(smsa80) areg DlogVA Dx DlogP1 DlogP2 DlogP3 DlogNP1 DlogNP2 DlogNP3 DlogK mu, cluster(smsa80) absorb(fst) areg DlogVA Dx DlogP1 DlogP2 DlogP3 DlogNP1 DlogNP2 DlogNP3 DlogK mu, cluster(smsa80) absorb(ind3) areg DlogVA Dx DlogP1 DlogP2 DlogP3 DlogNP1 DlogNP2 DlogNP3 DlogK mu, cluster(smsa80) absorb(ind3_st) xi: areg DlogVA Dx i.ind2|DlogP1 i.ind2|DlogP2 i.ind3|DlogP3 i.ind2|DlogNP1 i.ind2|DlogNP2 i.ind2|DlogNP3 i.ind2|DlogK mu , cluster(smsa80) absorb(ind3_st) g DlogM1 = DlogP1 g DlogM2 = DlogP2 g DlogM3 = DlogNP1 g DlogM4 = DlogNP2 g DlogM5 = DlogP3 g DlogM6 = DlogNP3 g DlogM7 = 0 g DlogM8 = 0 g DlogM9 = 0 g DlogM10 = 0 g DlogKsq = DlogK*DlogK g DM1sq = DlogM1*DlogM1 g DM2sq = DlogM2*DlogM2 g DM3sq = DlogM3*DlogM3 g DM4sq = DlogM4*DlogM4 g DM5sq = DlogM5*DlogM5 g DM6sq = DlogM6*DlogM6 g DM7sq = DlogM7*DlogM7 g DM8sq = DlogM8*DlogM8 g DM9sq = DlogM9*DlogM9 g DM10sq = DlogM10*DlogM10 g M1K = DlogM1*DlogK g M2K = DlogM2*DlogK g M3K = DlogM3*DlogK g M4K = DlogM4*DlogK g M5K = DlogM5*DlogK g M6K = DlogM6*DlogK g M7K = DlogM7*DlogK g M8K = DlogM8*DlogK g M9K = DlogM9*DlogK g M10K = DlogM10*DlogK g M1M2 = DlogM1*DlogM2 g M1M3 = DlogM1*DlogM3 g M1M4 = DlogM1*DlogM4 g M1M5 = DlogM1*DlogM5 g M1M6 = DlogM1*DlogM6 g M1M7 = DlogM1*DlogM7 g M1M8 = DlogM1*DlogM8 g M1M9 = DlogM1*DlogM9 g M1M10 = DlogM1*DlogM10 g M2M3 = DlogM2*DlogM3 g M2M4 = DlogM2*DlogM4 g M2M5 = DlogM2*DlogM5 g M2M6 = DlogM2*DlogM6 g M2M7 = DlogM2*DlogM7 g M2M8 = DlogM2*DlogM8 g M2M9 = DlogM2*DlogM9 g M2M10 = DlogM2*DlogM10 g M3M4 = DlogM3*DlogM4 g M3M5 = DlogM3*DlogM5 g M3M6 = DlogM3*DlogM6 g M3M7 = DlogM3*DlogM7 g M3M8 = DlogM3*DlogM8 g M3M9 = DlogM3*DlogM9 g M3M10 = DlogM3*DlogM10 g M4M5 = DlogM4*DlogM5 g M4M6 = DlogM4*DlogM6 g M4M7 = DlogM4*DlogM7 g M4M8 = DlogM4*DlogM8 g M4M9 = DlogM4*DlogM9 g M4M10 = DlogM4*DlogM10 g M5M6 = DlogM5*DlogM6 g M5M7 = DlogM5*DlogM7 g M5M8 = DlogM5*DlogM8 g M5M9 = DlogM5*DlogM9 g M5M10 = DlogM5*DlogM10 g M6M7 = DlogM6*DlogM7 g M6M8 = DlogM6*DlogM8 g M6M9 = DlogM6*DlogM9 g M6M10 = DlogM6*DlogM10 g M7M8 = DlogM7*DlogM8 g M7M9 = DlogM7*DlogM9 g M7M10 = DlogM7*DlogM10 g M8M9 = DlogM8*DlogM9 g M8M10 = DlogM8*DlogM10 g M9M10 = DlogM9*DlogM10 reg DlogVA Dx DlogM1 DlogM2 DlogM3 DlogM4 DlogM5 DlogM6 DlogM7 DlogM8 DlogM9 DlogM10 DlogK DlogKsq DM1sq DM2sq DM3sq DM4sq DM5sq DM6sq DM7sq DM8sq DM9sq DM10sq M1K M2K M3K M4K M5K M6K M7K M8K M9K M10K M1M2 M1M3 M1M4 M1M5 M1M6 M1M7 M1M8 M1M9 M1M10 M2M3 M2M4 M2M5 M2M6 M2M7 M2M8 M2M9 M2M10 M3M4 M3M5 M3M6 M3M7 M3M8 M3M9 M3M10 M4M5 M4M6 M4M7 M4M8 M4M9 M4M10 M5M6 M5M7 M5M8 M5M9 M5M10 M6M7 M6M8 M6M9 M6M10 M7M8 M7M9 M7M10 M8M9 M8M10 M9M10 mu , cluster(smsa80) areg DlogVA Dx DlogM1 DlogM2 DlogM3 DlogM4 DlogM5 DlogM6 DlogM7 DlogM8 DlogM9 DlogM10 DlogK DlogKsq DM1sq DM2sq DM3sq DM4sq DM5sq DM6sq DM7sq DM8sq DM9sq DM10sq M1K M2K M3K M4K M5K M6K M7K M8K M9K M10K M1M2 M1M3 M1M4 M1M5 M1M6 M1M7 M1M8 M1M9 M1M10 M2M3 M2M4 M2M5 M2M6 M2M7 M2M8 M2M9 M2M10 M3M4 M3M5 M3M6 M3M7 M3M8 M3M9 M3M10 M4M5 M4M6 M4M7 M4M8 M4M9 M4M10 M5M6 M5M7 M5M8 M5M9 M5M10 M6M7 M6M8 M6M9 M6M10 M7M8 M7M9 M7M10 M8M9 M8M10 M9M10 mu, cluster(smsa80) absorb(fst) areg DlogVA Dx DlogM1 DlogM2 DlogM3 DlogM4 DlogM5 DlogM6 DlogM7 DlogM8 DlogM9 DlogM10 DlogK DlogKsq DM1sq DM2sq DM3sq DM4sq DM5sq DM6sq DM7sq DM8sq DM9sq DM10sq M1K M2K M3K M4K M5K M6K M7K M8K M9K M10K M1M2 M1M3 M1M4 M1M5 M1M6 M1M7 M1M8 M1M9 M1M10 M2M3 M2M4 M2M5 M2M6 M2M7 M2M8 M2M9 M2M10 M3M4 M3M5 M3M6 M3M7 M3M8 M3M9 M3M10 M4M5 M4M6 M4M7 M4M8 M4M9 M4M10 M5M6 M5M7 M5M8 M5M9 M5M10 M6M7 M6M8 M6M9 M6M10 M7M8 M7M9 M7M10 M8M9 M8M10 M9M10 mu, cluster(smsa80) absorb(ind3) areg DlogVA Dx DlogM1 DlogM2 DlogM3 DlogM4 DlogM5 DlogM6 DlogM7 DlogM8 DlogM9 DlogM10 DlogK DlogKsq DM1sq DM2sq DM3sq DM4sq DM5sq DM6sq DM7sq DM8sq DM9sq DM10sq M1K M2K M3K M4K M5K M6K M7K M8K M9K M10K M1M2 M1M3 M1M4 M1M5 M1M6 M1M7 M1M8 M1M9 M1M10 M2M3 M2M4 M2M5 M2M6 M2M7 M2M8 M2M9 M2M10 M3M4 M3M5 M3M6 M3M7 M3M8 M3M9 M3M10 M4M5 M4M6 M4M7 M4M8 M4M9 M4M10 M5M6 M5M7 M5M8 M5M9 M5M10 M6M7 M6M8 M6M9 M6M10 M7M8 M7M9 M7M10 M8M9 M8M10 M9M10 mu, cluster(smsa80) absorb(ind3_st) *xi: areg DlogVA Dx i.ind2|DlogM1 i.ind2|DlogM2 i.ind2|DlogM3 i.ind2|DlogM4 i.ind2|DlogM5 i.ind2|DlogM6 i.ind2|DlogK i.ind2|DlogKsq i.ind2|DM1sq i.ind2|DM2sq i.ind2|DM3sq i.ind2|DM4sq i.ind2|DM5sq i.ind2|DM6sq i.ind2|DM7sq i.ind2|M1K i.ind2|M2K i.ind2|M3K i.ind2|M4K i.ind2|M5K i.ind2|M6K i.ind2|M7K i.ind2|M8K i.ind2|M9K i.ind2|M10K i.ind2|M1M2 i.ind2|M1M3 i.ind2|M1M4 i.ind2|M1M5 i.ind2|M1M6 i.ind2|M1M7 i.ind2|M1M8 i.ind2|M1M9 i.ind2|M1M10 i.ind2|M2M3 i.ind2|M2M4 i.ind2|M2M5 i.ind2|M2M6 i.ind2|M2M7 i.ind2|M2M8 i.ind2|M2M9 i.ind2|M2M10 i.ind2|M3M4 i.ind2|M3M5 i.ind2|M3M6 i.ind2|M3M7 i.ind2|M3M8 i.ind2|M3M9 i.ind2|M3M10 i.ind2|M4M5 i.ind2|M4M6 i.ind2|M4M7 i.ind2|M4M8 i.ind2|M4M9 i.ind2|M4M10 i.ind2|M5M6 i.ind2|M5M7 i.ind2|M5M8 i.ind2|M5M9 i.ind2|M5M10 i.ind2|M6M7 i.ind2|M6M8 i.ind2|M6M9 i.ind2|M6M10 mu, cluster(smsa80) absorb(ind3_st) *************************** ********************* * DATA ON COLLEGE SHARE * 2-DIGITS AND MANUF ********************* *************************** u imported/medu_lr6 rename sic ind2 rename obs2 obsb rename obs280 obsb80 sort smsa80 ind2 save tmp2, replace * MAIN DATA use D:/drive-e/moretti/stata/data, clear gen x = coll6 gen x80 = coll680 gen Dx = coll6 - coll680 gen ind3_st = ind3*1000 +fst gen ind2_st = ind2*1000 +fst keep if obs30 > 20 drop _merge * MERGE WITH COLLEGE SHARE sort smsa80 ind2 merge smsa80 ind2 using tmp2, nokeep g w = obsb/obs g ww= obsb/obs g tmp = (college - collegb*w)/(1-w) g w80 = obsb80/obs80 g tmp80 = (coll80 - collb80*w80)/(1-w80) summ w w80 tmp tmp80 correlate tmp college tmp80 coll80 drop college coll80 rename tmp college rename tmp80 coll80 * all ages g Dx2 = collegb - collb80 g Dx3 = college - coll80 g logL1sq = logL1*logL1 g logL4sq = logL4*logL4 g logKsq = logK*logK g logL1_K = logL1*logK g logL4_K = logL4*logK g logL1_L4 = logL1*logL4 g logL1sq8 = logL180*logL180 g logL4sq8 = logL480*logL480 g logKsq8 = logK80*logK80 g logL1_K8 = logL180*logK80 g logL4_K8 = logL480*logK80 g logL1_L8 = logL180*logL480 g DlogL1sq = DlogL1*DlogL1 g DlogL4sq = DlogL4*DlogL4 g DlogKsq = DlogK*DlogK g DlogL1_K = DlogL1*DlogK g DlogL4_K = DlogL4*DlogK g DlogL1_L = DlogL1*DlogL4 drop if DlogVA ==. **************** * Dx3 only **************** areg DlogVA Dx3 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx3 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx3 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) xi: areg DlogVA Dx3 i.ind2|DlogL1 i.ind2|DlogL4 i.ind2|DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx3 DlogL1 DlogL1sq DlogL4 DlogL4sq DlogK DlogKsq DlogL1_K DlogL4_K DlogL1_L4 mu, cluster(smsa80) absorb(fst) areg DlogVA Dx3 DlogL1 DlogL1sq DlogL4 DlogL4sq DlogK DlogKsq DlogL1_K DlogL4_K DlogL1_L4 mu, cluster(smsa80) absorb(ind3) areg DlogVA Dx3 DlogL1 DlogL1sq DlogL4 DlogL4sq DlogK DlogKsq DlogL1_K DlogL4_K DlogL1_L4 mu, cluster(smsa80) absorb(ind3_st) xi: areg DlogVA Dx3 i.ind2|DlogL1 i.ind2|DlogL1sq i.ind2|DlogL4 i.ind2|DlogL4sq i.ind2|DlogK i.ind2|DlogKsq i.ind2|DlogL1_K i.ind2|DlogL4_K i.ind2|DlogL1_L4 mu, cluster(smsa80) absorb(ind3_st) ***************** * Dx2 (TRIMMED) ****************** areg DlogVA Dx2 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx2 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx2 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) xi: areg DlogVA Dx2 i.ind2|DlogL1 i.ind2|DlogL4 i.ind2|DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx2 DlogL1 DlogL1sq DlogL4 DlogL4sq DlogK DlogKsq DlogL1_K DlogL4_K DlogL1_L4 mu, cluster(smsa80) absorb(fst) areg DlogVA Dx2 DlogL1 DlogL1sq DlogL4 DlogL4sq DlogK DlogKsq DlogL1_K DlogL4_K DlogL1_L4 mu, cluster(smsa80) absorb(ind3) areg DlogVA Dx2 DlogL1 DlogL1sq DlogL4 DlogL4sq DlogK DlogKsq DlogL1_K DlogL4_K DlogL1_L4 mu, cluster(smsa80) absorb(ind3_st) xi: areg DlogVA Dx2 i.ind2|DlogL1 i.ind2|DlogL1sq i.ind2|DlogL4 i.ind2|DlogL4sq i.ind2|DlogK i.ind2|DlogKsq i.ind2|DlogL1_K i.ind2|DlogL4_K i.ind2|DlogL1_L4 mu, cluster(smsa80) absorb(ind3_st) *********************************** *************************** * PATEN CITATIONS * 2 DIGITS *************************** *********************************** * READ PATENT DATA clear use D:/drive-e/moretti/July03-revision/imported/patents/data4b rename sic2_out sic_out rename sic2_in sic_in rename college2 college rename coll280 colle80 rename obs2 obs rename obs280 obs80 keep if sic_out >=24 & sic_out <=39 g Dx = college - colle80 summ keep if share ~=. & college ~=. keep if obs >50 & obs80 >50 *keep if sic_out ~=39 *replace Dx =. if Dx <-.8 | Dx >.8 gsort smsa80 sic_out -share quietly by smsa80 sic_out: gen t = _n quietly by smsa80 sic_out: gen T = _N if _n == _N tab T gen q = 1 if t >=1 & t <=5 replace q = 2 if t >=6 & t <=10 replace q = 3 if t >=11& t <=15 replace q = 4 if t >=16& t <=20 replace q = 5 if t >=21& t <=25 replace q = 6 if t >=26& t <=30 replace q = 7 if t >=31 collapse Dx share [weight = cellsize], by(smsa sic_out q) * weight = obs2 * weight = (obs2+obs280)/2 * IF A CELL HAS NO OBS, I ASSIGN Dx=0 summ fillin smsa sic_out q drop _fillin replace Dx = 0 if Dx==. *RESHAPE AND SAVE reshape wide Dx share, i(smsa sic_out) j(q) sort smsa sic_out save tmp, replace summ * MAIN DATA use D:/drive-e/moretti/stata/data, clear *gen x = coll6 *gen x80 = coll680 *gen Dx = coll6 - coll680 gen sic_out = ind2 gen ind3_st = ind3*1000 +fst gen ind2_st = ind2*1000 +fst keep if obs30 > 20 drop _merge sort smsa80 sic_out merge smsa80 sic_out using tmp drop _merge summ areg DlogVA Dx* DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx1 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx2 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx3 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx4 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx5 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx6 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx7 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx* DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx1 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx2 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx3 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx4 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx5 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx6 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx7 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx* DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx1 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx2 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx3 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx4 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx5 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx6 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx7 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) *********************************** * READ PATENT DATA clear use D:/drive-e/moretti/July03-revision/imported/patents/data4b rename sic2_out sic_out rename sic2_in sic_in rename college2 college rename coll280 colle80 rename obs2 obs rename obs280 obs80 keep if sic_out >=24 & sic_out <=39 g Dx = college - colle80 summ keep if share ~=. & college ~=. keep if obs >50 & obs80 >50 *keep if sic_out ~=39 *replace Dx =. if Dx <-.8 | Dx >.8 gsort smsa80 sic_out -share quietly by smsa80 sic_out: gen t = _n quietly by smsa80 sic_out: gen T = _N if _n == _N tab T gen q = 1 if t >=1 & t <=5 replace q = 2 if t >=6 & t <=10 replace q = 3 if t >=11& t <=15 replace q = 4 if t >=16& t <=20 replace q = 5 if t >=21& t <=25 replace q = 6 if t >=26& t <=30 replace q = 7 if t >=31 collapse Dx [weight = cellsize], by(smsa sic_out q) * weight = obs2 * weight = (obs2+obs280)/2 * IF A CELL HAS NO OBS, I ASSIGN Dx=0 summ *fillin smsa sic_out q *drop _fillin *replace Dx = 0 if Dx==. *RESHAPE AND SAVE reshape wide Dx, i(smsa sic_out) j(q) sort smsa sic_out save tmp, replace summ * MAIN DATA use D:/drive-e/moretti/stata/data, clear *gen x = coll6 *gen x80 = coll680 *gen Dx = coll6 - coll680 gen sic_out = ind2 gen ind3_st = ind3*1000 +fst gen ind2_st = ind2*1000 +fst keep if obs30 > 20 drop _merge sort smsa80 sic_out merge smsa80 sic_out using tmp drop _merge areg DlogVA Dx* DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx1 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx2 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx3 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx4 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx5 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx6 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx7 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx* DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx1 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx2 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx3 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx4 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx5 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx6 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx7 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx* DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx1 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx2 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx3 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx4 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx5 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx6 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx7 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) ******************************************* **************************************** * PATENT CITATIONS * 1 digit **************************************** ******************************************* * READ PATENT DATA clear use D:/drive-e/moretti/July03-revision/imported/patents/data4 rename sic1_out sic_out rename sic1_in sic_in rename college1 college rename coll180 colle80 rename obs1 obs rename obs180 obs80 g Dx = college - colle80 summ * THIS IS THE RANKNG OF 1-DIGIT INDUSTRIES, BY CLOSENESS TO MANUF keep if sic_out ==1 keep if smsa ==9000 sort share list sic_in share *********************************** *************************** * UNCENTERED CORRELATION *************************** *********************************** * MODEL 1 clear use D:/drive-e/moretti/July03-revision/imported/patents2/data2 rename sic2 sic_out rename sic2b sic_in rename college2 college rename coll280 colle80 rename obs2 obs rename obs280 obs80 keep if sic_out >=24 & sic_out <=39 g Dx = college - colle80 summ keep if rho ~=. & college ~=. gsort smsa80 sic_out -rho quietly by smsa80 sic_out: gen t = _n quietly by smsa80 sic_out: gen T = _N if _n == _N tab T gen q = 1 if t >=1 & t <=5 replace q = 2 if t >=6 & t <=10 replace q = 3 if t >=11& t <=15 replace q = 4 if t >=16& t <=20 replace q = 5 if t >=21& t <=25 replace q = 6 if t >=26& t <=30 replace q = 7 if t >=31 summ rho if q==1 summ rho if q==2 summ rho if q==3 summ rho if q==4 summ rho if q==5 summ rho if q==6 summ rho if q==7 collapse Dx rho, by(smsa sic_out q) * weight = obs2 * weight = (obs2+obs280)/2 summ fillin smsa sic_out q drop _fillin replace Dx = 0 if Dx==. *RESHAPE AND SAVE reshape wide Dx rho, i(smsa sic_out) j(q) sort smsa sic_out save tmp, replace summ * MAIN DATA use D:/drive-e/moretti/stata/data, clear *gen x = coll6 *gen x80 = coll680 *gen Dx = coll6 - coll680 gen sic_out = ind2 gen ind3_st = ind3*1000 +fst gen ind2_st = ind2*1000 +fst keep if obs30 > 20 drop _merge sort smsa80 sic_out merge smsa80 sic_out using tmp drop _merge summ areg DlogVA Dx* DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx1 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx2 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx3 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx4 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx5 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx6 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx7 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx* DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx1 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx2 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx3 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx4 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx5 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx6 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx7 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx* DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx1 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx2 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx3 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx4 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx5 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx6 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx7 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) ********************************* * MODEL 2 * (like model 1, but weight when collapse) clear use D:/drive-e/moretti/July03-revision/imported/patents2/data2 rename sic2 sic_out rename sic2b sic_in rename college2 college rename coll280 colle80 rename obs2 obs rename obs280 obs80 keep if sic_out >=24 & sic_out <=39 g Dx = college - colle80 summ keep if rho ~=. & college ~=. keep if obs >300 & obs80 >300 *keep if sic_out ~=39 *replace Dx =. if Dx <-.8 | Dx >.8 gsort smsa80 sic_out -rho quietly by smsa80 sic_out: gen t = _n quietly by smsa80 sic_out: gen T = _N if _n == _N tab T gen q = 1 if t >=1 & t <=5 replace q = 2 if t >=6 & t <=10 replace q = 3 if t >=11& t <=15 replace q = 4 if t >=16& t <=20 replace q = 5 if t >=21& t <=25 replace q = 6 if t >=26& t <=30 replace q = 7 if t >=31 summ rho if q==1 summ rho if q==2 summ rho if q==3 summ rho if q==4 summ rho if q==5 summ rho if q==6 summ rho if q==7 collapse Dx [weight = obs], by(smsa sic_out q) * weight = obs2 * weight = (obs2+obs280)/2 summ fillin smsa sic_out q drop _fillin replace Dx = 0 if Dx==. *RESHAPE AND SAVE reshape wide Dx, i(smsa sic_out) j(q) sort smsa sic_out save tmp, replace summ * MAIN DATA use D:/drive-e/moretti/stata/data, clear *gen x = coll6 *gen x80 = coll680 *gen Dx = coll6 - coll680 gen sic_out = ind2 gen ind3_st = ind3*1000 +fst gen ind2_st = ind2*1000 +fst keep if obs30 > 20 drop _merge sort smsa80 sic_out merge smsa80 sic_out using tmp drop _merge areg DlogVA Dx* DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx1 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx2 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx3 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx4 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx5 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx6 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx7 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx* DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx1 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx2 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx3 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx4 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx5 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx6 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx7 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx* DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx1 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx2 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx3 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx4 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx5 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx6 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx7 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) ********************************************************* *********************************************** * REFEREE's 1 REQUEST #3 *********************************************** ********************************************************** *************************** * MAIN DATA *************************** use D:/drive-e/moretti/stata/data, clear gen x = coll6 gen x80 = coll680 gen Dx = coll6 - coll680 gen ind3_st = ind3*1000 +fst gen ind2_st = ind2*1000 +fst keep if obs30 > 20 drop _merge sort smsa80 ind2 save tmp0, replace ******************************************************* sort ppn merge ppn using share/data2, nokeep g ind_smsa = smsa*10000 + ind3 g Dx1 = share1 - share180 g Dx2 = share2 - share280 g Dx3 = share3 - share380 g ww = sumte3 g www = sumpw3 summ share* coll* Dx1 Dx2 Dx3 Dx summ Dx3, detail sum sumte3, detail ******************************************* * Here I normalize share3, so that it has the * same mean and variance of college share ******************************************** summ x x80 Dx egen new3 = std(share3), mean(.1935) std(.06000) egen new380 = std(share380), mean(.148386) std(.041379) egen newDx3 = std(Dx3), mean(.045218) std(.027195) g newDx3b = new3 - new380 drop Dx3 g Dx3 = newDx3 *g Dx3 = newDx3b areg DlogVA Dx3 DlogL1 DlogL4 DlogK mu [weight = ww], cluster(ind_smsa) absorb(fst) areg DlogVA Dx3 DlogL1 DlogL4 DlogK mu [weight = ww], cluster(ind_smsa) absorb(ind3) areg DlogVA Dx3 DlogL1 DlogL4 DlogK mu [weight = ww], cluster(ind_smsa) absorb(ind3_st) xi: areg DlogVA Dx3 i.ind2|DlogL1 i.ind2|DlogL4 i.ind2|DlogK mu [weight = ww], cluster(ind_smsa) absorb(ind3_st) *areg DlogVA Dx3 DlogL1 DlogL4 DlogK mu [weight = www], cluster(ind_smsa) absorb(fst) *areg DlogVA Dx3 DlogL1 DlogL4 DlogK mu [weight = www], cluster(ind_smsa) absorb(ind3) *areg DlogVA Dx3 DlogL1 DlogL4 DlogK mu [weight = www], cluster(ind_smsa) absorb(ind3_st) *xi: areg DlogVA Dx3 i.ind2|DlogL1 i.ind2|DlogL4 i.ind2|DlogK mu [weight = www], cluster(ind_smsa) absorb(ind3_st) ****************************** *Translog ****************************** g logL1sq = logL1*logL1 g logL4sq = logL4*logL4 g logKsq = logK*logK g logL1_K = logL1*logK g logL4_K = logL4*logK g logL1_L4 = logL1*logL4 g logL1sq8 = logL180*logL180 g logL4sq8 = logL480*logL480 g logKsq8 = logK80*logK80 g logL1_K8 = logL180*logK80 g logL4_K8 = logL480*logK80 g logL1_L8 = logL180*logL480 g DlogL1sq = DlogL1*DlogL1 g DlogL4sq = DlogL4*DlogL4 g DlogKsq = DlogK*DlogK g DlogL1_K = DlogL1*DlogK g DlogL4_K = DlogL4*DlogK g DlogL1_L = DlogL1*DlogL4 replace Dx3 =. if sumte3 <800 areg DlogVA Dx3 DlogL1 DlogL1sq DlogL4 DlogL4sq DlogK DlogKsq DlogL1_K DlogL4_K DlogL1_L4 mu [weight = ww], cluster(smsa80) absorb(fst) areg DlogVA Dx3 DlogL1 DlogL1sq DlogL4 DlogL4sq DlogK DlogKsq DlogL1_K DlogL4_K DlogL1_L4 mu [weight = ww], cluster(smsa80) absorb(ind3) areg DlogVA Dx3 DlogL1 DlogL1sq DlogL4 DlogL4sq DlogK DlogKsq DlogL1_K DlogL4_K DlogL1_L4 mu [weight = ww], cluster(smsa80) absorb(ind3_st) xi: areg DlogVA Dx3 i.ind2|DlogL1 i.ind2|DlogL1sq i.ind2|DlogL4 i.ind2|DlogL4sq i.ind2|DlogK i.ind2|DlogKsq i.ind2|DlogL1_K i.ind2|DlogL4_K i.ind2|DlogL1_L4 mu [weight = ww], cluster(smsa80) absorb(ind3_st) *areg DlogVA Dx3 DlogL1 DlogL1sq DlogL4 DlogL4sq DlogK DlogKsq DlogL1_K DlogL4_K DlogL1_L4 mu [weight = www], cluster(smsa80) absorb(fst) *areg DlogVA Dx3 DlogL1 DlogL1sq DlogL4 DlogL4sq DlogK DlogKsq DlogL1_K DlogL4_K DlogL1_L4 mu [weight = www], cluster(smsa80) absorb(ind3) *areg DlogVA Dx3 DlogL1 DlogL1sq DlogL4 DlogL4sq DlogK DlogKsq DlogL1_K DlogL4_K DlogL1_L4 mu [weight = www], cluster(smsa80) absorb(ind3_st) *xi: areg DlogVA Dx3 i.ind2|DlogL1 i.ind2|DlogL1sq i.ind2|DlogL4 i.ind2|DlogL4sq i.ind2|DlogK i.ind2|DlogKsq i.ind2|DlogL1_K i.ind2|DlogL4_K i.ind2|DlogL1_L4 mu [weight = www], cluster(smsa80) absorb(ind3_st) ******************************************************************** ******************************************************************** * REFEREE 1 REQUEST #5 ******************************************************************** ******************************************************************** u D:/drive-e/moretti/July03-revision/imported/high-tech/ht3 rename sic ind2 drop if ind==. | ind ==0 **************************** g Dx_lt = college - coll80 g Dx_ht = collegeb - coll80b drop coll* summ sort smsa ind2 save tmp, replace use D:/drive-e/moretti/stata/data, clear gen x = coll6 gen x80 = coll680 gen Dx = coll6 - coll680 gen ind3_st = ind3*1000 +fst gen ind2_st = ind2*1000 +fst keep if obs30 > 20 drop _merge sort smsa ind2 merge smsa ind2 using tmp gen ht=0 replace ht =1 if ind==3571 replace ht =1 if ind==3572 replace ht =1 if ind==3575 replace ht =1 if ind==3577 replace ht =1 if ind==3578 replace ht =1 if ind==3579 replace ht =1 if ind==3651 replace ht =1 if ind==3652 replace ht =1 if ind==3661 replace ht =1 if ind==3663 replace ht =1 if ind==3669 replace ht =1 if ind==3671 replace ht =1 if ind==3672 replace ht =1 if ind==3675 replace ht =1 if ind==3676 replace ht =1 if ind==3677 replace ht =1 if ind==3678 replace ht =1 if ind==3679 replace ht =1 if ind==3674 replace ht =1 if ind==3821 replace ht =1 if ind==3822 replace ht =1 if ind==3823 replace ht =1 if ind==3824 replace ht =1 if ind==3825 replace ht =1 if ind==3826 replace ht =1 if ind==3829 replace ht =1 if ind==3827 replace ht =1 if ind==3861 replace ht =1 if ind==3812 replace ht =1 if ind==3844 replace ht =1 if ind==3845 summarize ind ht *replace Dx_ht =0 if Dx_ht ==. *replace Dx_lt =0 if Dx_lt ==. *replace Dx_ht =Dx if Dx_ht ==. *replace Dx_lt =Dx if Dx_lt ==. * college share in ht - plant is ht gen Dx_ht_ht = Dx_ht*ht * college share in ht - plant is lt gen Dx_ht_lt = Dx_ht*(1-ht) * college share in lt - plant is ht gen Dx_lt_ht = Dx_lt*ht * college share in lt - plant is lt gen Dx_lt_lt = Dx_lt*(1-ht) keep if DlogVA ~=. summ Dx* *drop if obs1b < 10 reg DlogVA Dx_ht_ht Dx_ht_lt Dx_lt_ht Dx_lt_lt DlogL1 DlogL4 DlogK mu , cluster(smsa80) areg DlogVA Dx_ht_ht Dx_ht_lt Dx_lt_ht Dx_lt_lt DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx_ht_ht Dx_ht_lt Dx_lt_ht Dx_lt_lt DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind2) areg DlogVA Dx_ht_ht Dx_ht_lt Dx_lt_ht Dx_lt_lt DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx_ht_ht Dx_ht_lt Dx_lt_ht Dx_lt_lt DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) g DlogL1sq = DlogL1*DlogL1 g DlogL4sq = DlogL4*DlogL4 g DlogKsq = DlogK*DlogK g DlogL1_K = DlogL1*DlogK g DlogL4_K = DlogL4*DlogK g DlogL1_L = DlogL1*DlogL4 reg DlogVA Dx_ht_ht Dx_ht_lt Dx_lt_ht Dx_lt_lt DlogL1 DlogL1sq DlogL4 DlogL4sq DlogK DlogKsq DlogL1_K DlogL4_K DlogL1_L4 mu, cluster(smsa80) areg DlogVA Dx_ht_ht Dx_ht_lt Dx_lt_ht Dx_lt_lt DlogL1 DlogL1sq DlogL4 DlogL4sq DlogK DlogKsq DlogL1_K DlogL4_K DlogL1_L4 mu, cluster(smsa80) absorb(fst) areg DlogVA Dx_ht_ht Dx_ht_lt Dx_lt_ht Dx_lt_lt DlogL1 DlogL1sq DlogL4 DlogL4sq DlogK DlogKsq DlogL1_K DlogL4_K DlogL1_L4 mu, cluster(smsa80) absorb(ind3) areg DlogVA Dx_ht_ht Dx_ht_lt Dx_lt_ht Dx_lt_lt DlogL1 DlogL1sq DlogL4 DlogL4sq DlogK DlogKsq DlogL1_K DlogL4_K DlogL1_L4 mu, cluster(smsa80) absorb(ind3_st) ******************************************************************** ******************************************************************** * REFEREE 2 REQUEST #2 ******************************************************************** ******************************************************************** use D:/drive-e/moretti/stata/data, clear gen x = coll6 gen x80 = coll680 gen Dx = coll6 - coll680 gen ind3_st = ind3*1000 +fst gen ind2_st = ind2*1000 +fst keep if obs30 > 20 drop _merge sort smsa80 ind2 save tmp0, replace ******************************************************************** u imported/local-industries/data g ind3 = sic if sic <=999 replace ind3 = int(sic/10) if sic >=1000 g ind2 = int(sic/10) if sic <=999 replace ind2 = int(sic/100) if sic >=1000 summ collapse distance, by(ind3) summ sort ind3 save tmp, replace u tmp0 sort ind3 merge ind3 using tmp drop if distance ==. g local = 0 if distance >=500 replace local = 1 if distance < 500 summ gen ht=0 replace ht =1 if ind==3571 replace ht =1 if ind==3572 replace ht =1 if ind==3575 replace ht =1 if ind==3577 replace ht =1 if ind==3578 replace ht =1 if ind==3579 replace ht =1 if ind==3651 replace ht =1 if ind==3652 replace ht =1 if ind==3661 replace ht =1 if ind==3663 replace ht =1 if ind==3669 replace ht =1 if ind==3671 replace ht =1 if ind==3672 replace ht =1 if ind==3675 replace ht =1 if ind==3676 replace ht =1 if ind==3677 replace ht =1 if ind==3678 replace ht =1 if ind==3679 replace ht =1 if ind==3674 replace ht =1 if ind==3821 replace ht =1 if ind==3822 replace ht =1 if ind==3823 replace ht =1 if ind==3824 replace ht =1 if ind==3825 replace ht =1 if ind==3826 replace ht =1 if ind==3829 replace ht =1 if ind==3827 replace ht =1 if ind==3861 replace ht =1 if ind==3812 replace ht =1 if ind==3844 replace ht =1 if ind==3845 tab ht local g Dx_local = Dx*local * with main effect areg DlogVA Dx Dx_local local DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx Dx_local local DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx Dx_local local DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) xi: areg DlogVA Dx Dx_local local i.ind2|DlogL1 i.ind2|DlogL4 i.ind2|DlogK mu , cluster(smsa80) absorb(ind3_st) g DlogL1sq = DlogL1*DlogL1 g DlogL4sq = DlogL4*DlogL4 g DlogKsq = DlogK*DlogK g DlogL1_K = DlogL1*DlogK g DlogL4_K = DlogL4*DlogK g DlogL1_L = DlogL1*DlogL4 areg DlogVA Dx Dx_local local DlogL1 DlogL1sq DlogL4 DlogL4sq DlogK DlogKsq DlogL1_K DlogL4_K DlogL1_L4 mu, cluster(smsa80) absorb(fst) areg DlogVA Dx Dx_local local DlogL1 DlogL1sq DlogL4 DlogL4sq DlogK DlogKsq DlogL1_K DlogL4_K DlogL1_L4 mu, cluster(smsa80) absorb(ind3) areg DlogVA Dx Dx_local local DlogL1 DlogL1sq DlogL4 DlogL4sq DlogK DlogKsq DlogL1_K DlogL4_K DlogL1_L4 mu, cluster(smsa80) absorb(ind3_st) xi: areg DlogVA Dx Dx_local local i.ind2|DlogL1 i.ind2|DlogL1sq i.ind2|DlogL4 i.ind2|DlogL4sq i.ind2|DlogK i.ind2|DlogKsq i.ind2|DlogL1_K i.ind2|DlogL4_K i.ind2|DlogL1_L4 mu, cluster(smsa80) absorb(ind3_st) ******************************************************************** ******************************************************************** * REFEREE 2 REQUEST #1 and #14 ******************************************************************** ******************************************************************** * college data use D:/drive-e/moretti/July03-revision/imported/colleges/data sort smsa save tmp, replace * densisty data use D:/drive-e/moretti/July03-revision/imported/density/density g ddens = density - densit80 sort smsa save tmp1, replace use D:/drive-e/moretti/stata/data, clear gen x = coll6 gen x80 = coll680 gen Dx = coll6 - coll680 gen ind3_st = ind3*1000 +fst gen ind2_st = ind2*1000 +fst keep if obs30 > 20 drop _merge * CONTROLS FOR NUMBER OF COLLEGES AND NUMBER OF DEGREE AWARDED sort smsa80 merge smsa using tmp replace dinst = 0 if dinst ==. replace ddegr = 0 if ddegr ==. reg DlogVA Dx dinst DlogL1 DlogL4 DlogK mu , cluster(smsa80) areg DlogVA Dx dinst DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx dinst DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx dinst DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) xi: areg DlogVA Dx dinst i.ind2|DlogL1 i.ind2|DlogL4 i.ind2|DlogK mu , cluster(smsa80) absorb(ind3_st) reg DlogVA Dx ddegr DlogL1 DlogL4 DlogK mu , cluster(smsa80) areg DlogVA Dx ddegr DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx ddegr DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx ddegr DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) xi: areg DlogVA Dx ddegr i.ind2|DlogL1 i.ind2|DlogL4 i.ind2|DlogK mu , cluster(smsa80) absorb(ind3_st) reg DlogVA Dx dinst ddegr DlogL1 DlogL4 DlogK mu , cluster(smsa80) areg DlogVA Dx dinst ddegr DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx dinst ddegr DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx dinst ddegr DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) xi: areg DlogVA Dx dinst ddegr i.ind2|DlogL1 i.ind2|DlogL4 i.ind2|DlogK mu , cluster(smsa80) absorb(ind3_st) * CONTROLS FOR DENSITY drop _merge sort smsa merge smsa using tmp1 replace dden =0 if dden ==. reg DlogVA Dx dden DlogL1 DlogL4 DlogK mu , cluster(smsa80) areg DlogVA Dx dden DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx dden DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx dden DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) xi: areg DlogVA Dx dden i.ind2|DlogL1 i.ind2|DlogL4 i.ind2|DlogK mu , cluster(smsa80) absorb(ind3_st) ******************************************************************** ******************************************************************** * REFEREE 2 REQUEST #7 ******************************************************************** ******************************************************************** use D:/drive-e/moretti/stata/data, clear gen x = coll6 gen x80 = coll680 gen Dx = coll6 - coll680 gen ind3_st = ind3*1000 +fst gen ind2_st = ind2*1000 +fst keep if obs30 > 20 drop _merge drop if ind ==3571 | ind==3572 | ind ==3577 reg DlogVA Dx DlogL1 DlogL4 DlogK mu , cluster(smsa80) areg DlogVA Dx DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) xi: areg DlogVA Dx i.ind2|DlogL1 i.ind2|DlogL4 i.ind2|DlogK mu , cluster(smsa80) absorb(ind3_st) ******************************************************************** ******************************************************************** * REFEREE 2 REQUEST #6 ******************************************************************** ******************************************************************** * DUMMY =1 IF PLANT IS IN ASM IN 1982 use D:/drive-e/moretti2/lrd/gs82-subset2 tab et g asm = 1 if et ==0 replace asm = 0 if et ==1 drop et sort ppn save tmp, replace use D:/drive-e/moretti/stata/data, clear gen x = coll6 gen x80 = coll680 gen Dx = coll6 - coll680 gen ind3_st = ind3*1000 +fst gen ind2_st = ind2*1000 +fst keep if obs30 > 20 drop _merge sort ppn merge ppn using tmp drop _merge drop if DlogVA ==. tab asm g Dx_asm = Dx*asm drop if asm ==1 reg DlogVA Dx DlogL1 DlogL4 DlogK mu , cluster(smsa80) areg DlogVA Dx DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(fst) areg DlogVA Dx DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3) areg DlogVA Dx DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) *xi: areg DlogVA Dx i.ind2|DlogL1 i.ind2|DlogL4 i.ind2|DlogK mu , cluster(smsa80) absorb(ind3_st) ******************************************************************** ******************************************************************** * REFEREE 2 REQUEST #5 ******************************************************************** ******************************************************************** * HOURS WORKED BY PROD AND NON PRODUCTION WORKERS, BY PLANT use D:/drive-e/moretti/Cm/st828792, clear drop if yr ~= 92 gen logH1 = log(ph) gen ph2 = (ph/pw)*(te-pw) keep ppn ph ph2 te pw sort ppn save tmp, replace use D:/drive-e/moretti/Cm/st828792, clear drop if yr ~= 82 gen logH180 = log(ph) gen ph280 = (ph/pw)*(te-pw) rename te te80 rename pw pw80 rename ph ph80 keep ppn ph80 ph280 te80 pw80 sort ppn merge ppn using tmp drop _merge sort ppn save tmp, replace use D:/drive-e/moretti/stata/data, clear gen x = coll6 gen x80 = coll680 gen Dx = coll6 - coll680 gen ind3_st = ind3*1000 +fst gen ind2_st = ind2*1000 +fst keep if obs30 > 20 drop _merge ph* sort ppn merge ppn using tmp g L1 = exp(logL1) g L4 = exp(logL4) g L180 = exp(logL180) g L480 = exp(logL480) g coll = L4/(L1+L4) g coll80 = L480/(L180+L480) g prod = ph2/(ph+ph2) g prod80 = ph280/(ph80+ph280) summ coll* prod* correlate coll prod correlate coll80 prod80 correlate coll prod if prod>0 correlate coll80 prod80 if prod80>0 correlate coll prod if coll>0 correlate coll80 prod80 if coll80>0 correlate coll prod if prod<1 correlate coll80 prod80 if prod80<1 correlate coll prod if coll<1 correlate coll80 prod80 if coll80<1 replace prod = (te-pw)/te replace prod80 = (te80-pw80)/te80 summ coll* prod* correlate coll prod correlate coll80 prod80 correlate coll prod if prod>0 correlate coll80 prod80 if prod80 >0 correlate coll prod if coll>0 correlate coll80 prod80 if coll80>0 correlate coll prod if prod<1 correlate coll80 prod80 if prod80<1 correlate coll prod if coll<1 correlate coll80 prod80 if coll80<1 ********************************************************** ********************************************************** * INPUT OUTPUT TABLES /* clear use D:/drive-e/moretti/imported/medu_l32 keep if obs >50 & obs80 >50 drop year* *keep if sic_out ~=39 */ /* gsort smsa80 sic_out -io quietly by smsa80 sic_out: gen t = _n quietly by smsa80 sic_out: gen T = _N if _n == _N tab T gen q = 1 if t >=1 & t <=1 replace q = 1 if t >=2 & t <=2 replace q = 2 if t >=3 & t <=3 replace q = 2 if t >=4 & t <=4 replace q = 3 if t >=5 & t <=5 replace q = 3 if t >=6 & t <=6 replace q = 4 if t >=7 & t <=7 replace q = 4 if t >=8 & t <=8 replace q = 5 if t >=9 & t <=9 replace q = 5 if t >=10 & t <=10 replace q = 6 if t >=11 & t <=11 replace q = 6 if t >=12 & t <=12 replace q = 7 if t >=13 & t <=13 replace q = 7 if t >=14 & t <=14 replace q = 8 if t >=15 & t <=15 replace q = 8 if t >=16 & t <=16 replace q = 9 if t >=17 & t <=17 replace q = 9 if t >=18 & t <=18 replace q = 10 if t >=19 & t <=19 replace q = 10 if t >=20 & t <=20 replace q = 11 if t >=21 & t <=21 replace q = 11 if t >=22 & t <=22 replace q = 12 if t >=23 & t <=23 replace q = 12 if t >=24 & t <=24 replace q = 13 if t >=25 & t <=25 replace q = 13 if t >=26 & t <=26 replace q = 14 if t >=27 & t <=27 replace q = 14 if t >=28 & t <=28 replace q = 15 if t >=29 & t <=30 */ /* *** Spec 99 sort smsa80 collapse (sum) tot_io = io, by(smsa80 sic_out) sort smsa80 sic_out save tmp, replace clear use E:/moretti/imported/medu_l32 keep if sic_out ~=. keep if college ~=. & colle80 ~=. sort smsa80 sic_out merge smsa80 sic_out using tmp gen ratio = io/tot_io keep if ratio ~= . summ ratio, detail gen q = 1 if ratio <=0.0019 replace q = 2 if ratio > 0.0019 & ratio <= 0.0098 replace q = 3 if ratio > 0.0098 & ratio <= 0.037 replace q = 4 if ratio > 0.037 */ **************************************** **************************************** /* g college1 = college if q ==1 g college2 = college if q ==2 g college3 = college if q ==3 g college4 = college if q ==4 g college5 = college if q ==5 g college6 = college if q ==6 g college7 = college if q ==7 g college8 = college if q ==8 g college9 = college if q ==9 g colleg10 = college if q ==10 g colleg11 = college if q ==11 g colleg12 = college if q ==12 g colleg13 = college if q ==13 g colleg14 = college if q ==14 g colleg15 = college if q ==15 g colle180 = colle80 if q ==1 g colle280 = colle80 if q ==2 g colle380 = colle80 if q ==3 g colle480 = colle80 if q ==4 g colle580 = colle80 if q ==5 g colle680 = colle80 if q ==6 g colle780 = colle80 if q ==7 g colle880 = colle80 if q ==8 g colle980 = colle80 if q ==9 g coll1080 = colle80 if q ==10 g coll1180 = colle80 if q ==11 g coll1280 = colle80 if q ==12 g coll1380 = colle80 if q ==13 g coll1480 = colle80 if q ==14 g coll1580 = colle80 if q ==15 g io1 = io if q ==1 g io2 = io if q ==2 g io3 = io if q ==3 g io4 = io if q ==4 g io5 = io if q ==5 g io6 = io if q ==6 g io7 = io if q ==7 g io8 = io if q ==8 g io9 = io if q ==9 g io10 = io if q ==10 g io11 = io if q ==11 g io12 = io if q ==12 g io13 = io if q ==13 g io14 = io if q ==14 g io15 = io if q ==15 sort smsa80 sic_out g w = (obs+obs80)/2 collapse college1 college2 college3 college4 college5 college6 college7 college8 college9 colleg10 colleg11 colleg12 colleg13 colleg14 colleg15 colle180 colle280 colle380 colle480 colle580 colle680 colle780 colle880 colle980 coll1080 coll1180 coll1280 coll1380 coll1480 coll1580 io1 io2 io3 io4 io5 io6 io7 io8 io9 io10 io11 io12 io13 io14 io15 [weight = w], by(smsa80 sic_out) *[weight = w] summ save tmp, replace * Read Lrd use D:/drive-e/moretti/stata/data, clear gen ind3_st = ind3*1000 +fst gen ind2_st = ind2*1000 +fst keep if obs30 > 20 gen sic_out = ind2 drop _merge sort smsa80 sic_out * Merge Lrd and Input Output Data merge smsa80 sic_out using tmp gen Dx1 = college1 - colle180 gen Dx2 = college2 - colle280 gen Dx3 = college3 - colle380 gen Dx4 = college4 - colle480 gen Dx5 = college5 - colle580 gen Dx6 = college6 - colle680 gen Dx7 = college7 - colle780 gen Dx8 = college8 - colle880 gen Dx9 = college9 - colle980 gen Dx10 = colleg10 - coll1080 gen Dx11 = colleg11 - coll1180 gen Dx12 = colleg12 - coll1280 gen Dx13 = colleg13 - coll1380 gen Dx14 = colleg14 - coll1480 gen Dx15 = colleg15 - coll1580 *replace Dx6 =0 *replace Dx7 =0 replace Dx8 =0 replace Dx9 =0 replace Dx10 =0 replace Dx11 =0 replace Dx12 =0 replace Dx13 =0 replace Dx14 =0 replace Dx15 =0 summ *reg DlogVA Dx1 Dx2 Dx3 Dx4 Dx5 Dx6 Dx7 Dx8 Dx9 Dx10 Dx11 Dx12 Dx13 Dx14 Dx15 DlogL1 DlogL4 DlogK mu , cluster(smsa80) reg DlogVA Dx1 DlogL1 DlogL4 DlogK mu , cluster(smsa80) reg DlogVA Dx2 DlogL1 DlogL4 DlogK mu , cluster(smsa80) reg DlogVA Dx3 DlogL1 DlogL4 DlogK mu , cluster(smsa80) reg DlogVA Dx4 DlogL1 DlogL4 DlogK mu , cluster(smsa80) reg DlogVA Dx5 DlogL1 DlogL4 DlogK mu , cluster(smsa80) reg DlogVA Dx6 DlogL1 DlogL4 DlogK mu , cluster(smsa80) reg DlogVA Dx7 DlogL1 DlogL4 DlogK mu , cluster(smsa80) reg DlogVA Dx8 DlogL1 DlogL4 DlogK mu , cluster(smsa80) reg DlogVA Dx9 DlogL1 DlogL4 DlogK mu , cluster(smsa80) reg DlogVA Dx10 DlogL1 DlogL4 DlogK mu , cluster(smsa80) reg DlogVA Dx11 DlogL1 DlogL4 DlogK mu , cluster(smsa80) reg DlogVA Dx12 DlogL1 DlogL4 DlogK mu , cluster(smsa80) reg DlogVA Dx13 DlogL1 DlogL4 DlogK mu , cluster(smsa80) reg DlogVA Dx14 DlogL1 DlogL4 DlogK mu , cluster(smsa80) reg DlogVA Dx15 DlogL1 DlogL4 DlogK mu , cluster(smsa80) *areg DlogVA Dx1 Dx2 Dx3 Dx4 Dx5 Dx6 Dx7 Dx8 Dx9 Dx10 Dx11 Dx12 Dx13 Dx14 Dx15 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx1 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx2 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx3 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx4 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx5 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx6 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx7 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx8 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx9 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx10 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx11 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx12 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx13 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx14 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) areg DlogVA Dx15 DlogL1 DlogL4 DlogK mu , cluster(smsa80) absorb(ind3_st) */