#delimit; clear; set more off; global temp /Sastemp; global path ~; set mem 5000m; capture log close; log using $path/morg/kevin/morg_kevin.log, replace; *========================================================= Program: morg_kevin.do Author: Kevin Stange Created: April 27, 2007 Purpose: This program estimates state-level average wages for college grads and non-college grads from May Outgoing Rotation Group of the CPS. I restrict sample to 1997-1999, people with at least a high school degree, and people aged 22 to 30. ===========================================================; *==================================================== Step 1: Read in raw CPS data *====================================================; use ~/morg/datafiles/morg_pool.dta, clear; *==================================================== Step 2: Restrict sample to only people aged 22-30 *====================================================; keep if year == 1997 | year == 1998 | year == 1999; keep if age >= 22 & age <= 30; keep if edcat >= 12; gen exper_2 = exper^2; gen ba = 1 if edcat >= 16; replace ba = 0 if edcat < 16; gen lwagepred = .; gen bareturn = .; gen female = sex-1; gen str2 stateabb = " "; replace stateabb = "ME" if state ==11; replace stateabb = "NH" if state ==12; replace stateabb = "VT" if state ==13; replace stateabb = "MA" if state ==14; replace stateabb = "RI" if state ==15; replace stateabb = "CT" if state ==16; replace stateabb = "NY" if state ==21; replace stateabb = "NJ" if state ==22; replace stateabb = "PA" if state ==23; replace stateabb = "OH" if state ==31; replace stateabb = "IN" if state ==32; replace stateabb = "IL" if state ==33; replace stateabb = "MI" if state ==34; replace stateabb = "WI" if state ==35; replace stateabb = "MN" if state ==41; replace stateabb = "IA" if state ==42; replace stateabb = "MO" if state ==43; replace stateabb = "ND" if state ==44; replace stateabb = "SD" if state ==45; replace stateabb = "NE" if state ==46; replace stateabb = "KS" if state ==47; replace stateabb = "DE" if state ==51; replace stateabb = "MD" if state ==52; replace stateabb = "DC" if state ==53; replace stateabb = "VA" if state ==54; replace stateabb = "WV" if state ==55; replace stateabb = "NC" if state ==56; replace stateabb = "SC" if state ==57; replace stateabb = "GA" if state ==58; replace stateabb = "FL" if state ==59; replace stateabb = "KY" if state ==61; replace stateabb = "TN" if state ==62; replace stateabb = "AL" if state ==63; replace stateabb = "MS" if state ==64; replace stateabb = "AR" if state ==71; replace stateabb = "LA" if state ==72; replace stateabb = "OK" if state ==73; replace stateabb = "TX" if state ==74; replace stateabb = "MT" if state ==81; replace stateabb = "ID" if state ==82; replace stateabb = "WY" if state ==83; replace stateabb = "CO" if state ==84; replace stateabb = "NM" if state ==85; replace stateabb = "AZ" if state ==86; replace stateabb = "UT" if state ==87; replace stateabb = "NV" if state ==88; replace stateabb = "WA" if state ==91; replace stateabb = "OR" if state ==92; replace stateabb = "CA" if state ==93; replace stateabb = "AK" if state ==94; replace stateabb = "HI" if state ==95; sort stateabb female; global states " ME NH VT MA RI CT NY NJ PA OH IN IL MI WI MN IA MO ND SD NE KS DE MD DC VA WV NC SC GA FL KY TN AL MS AR LA OK TX MT ID WY CO NM AZ UT NV WA OR CA AK HI"; *============================================================ Step 3: Estimate lwage equation separately by state and gender *============================================================; foreach state of global states{; regress lwage ba exper exper_2 [w=earnwt] if female==0 & stateabb =="`state'" ; replace lwagepred = (ba)*(_b[ba]) + (_b[_cons]) if female==0 & stateabb =="`state'"; regress lwage ba exper exper_2 [w=earnwt] if female==1 & stateabb =="`state'"; replace lwagepred = (ba)*(_b[ba]) + (_b[_cons]) if female==1 & stateabb =="`state'"; }; *==================================================== Step 4: Collapse data and export file *====================================================; collapse lwagepred, by(stateabb female ba); outsheet using statecpswages.csv, comma nolabel replace; log close;