open "/Users/jcaceres/Google Drive/jcd/carlos3/2015_2016/Aplicada/Week8_2016/fertil.gdt" #i) y ii) list X=age agesq black educ loop foreach i 74 76 78 80 82 84 genr d$i=year==$i setinfo d$i -d "Dummy Year 19$i" endloop list YrD=d74 d76 d78 d80 d82 d84 ols kids const YrD --robust ols kids const X --robust ols kids const X YrD --robust #iii) #ha caido de manera significativa en 1982 con respecto a 1972? #Puede deberse al incremento de la educación entre estos dos años? loop foreach i 74 76 78 80 82 84 genr edu_d$i=educ*d$i genr age_d$i=age*d$i genr agesq_d$i=agesq*d$i genr black_d$i=black*d$i setinfo edu_d$i -d "Inter Year 19$i and educ" setinfo age_d$i -d "Inter Year 19$i and age" setinfo agesq_d$i -d "Inter Year 19$i and agesq" setinfo black_d$i -d "Inter Year 19$i and black" endloop ols kids const X YrD edu_d74 edu_d76 edu_d78 edu_d80 edu_d82 edu_d84 --robust #Contraste la hipotesis de que el retorno a la educacion es diferente en 1982 con respecto a 1972 #Para cualquier periodo? omit edu_d74 edu_d76 edu_d78 edu_d80 edu_d82 edu_d84 --quiet genr sample=year==72 || year==82 smpl sample --restrict ols kids const age agesq black educ --robust ols kids const age agesq black educ d82 age_d82 agesq_d82 black_d82 edu_d82 --robust omit d82 age_d82 agesq_d82 black_d82 edu_d82 --quiet ols kids const age agesq black educ --robust chow d82 --dummy clear open "/Users/jcaceres/Google Drive/jcd/carlos3/2015_2016/Aplicada/Week8_2016/hours.gdt" # dummies genr y80 = year = 80 genr y82 = year = 82 genr y84 = year = 84 # we need genr agesq = age*age genr y80child = y80*child genr y82child = y82*child genr y84child = y84*child # models ols hours const age agesq marr child --robust ols hours const age agesq marr child y82 y84 --robust ols hours const age agesq marr child y82 y84 y82child y84child --robust ols hours const age agesq marr y82 y84 y80child y82child y84child --robust # Questions: #1) ols hours const age agesq marr child --robust genr b = $coeff genr dif = (40-30) * b[2] + (40^2 - 30^2)*b[3] #2) #effect = b[2] + 2* b[3] * age ols hours const age agesq marr child --robust omit age agesq --wald # significant effect ols hours const age agesq marr child --robust omit agesq --wald # effect is not constant genr agestar = -b[2]/(2*b[3]) #Negative if age > agestar #3) ols hours const age agesq marr child y82 y84 --robust # y82 negative and significant: decreased in 1982 # y84 vs y82: restrict --quiet b[y82] - b[y84]= 0 end restrict # constant between 82 and 84 #4 ols hours const age agesq marr child y82 y84 y82child y84child --robust # Constant in the whole period omit y84child y82child --wald # do not reject H0 # child impact ols hours const age agesq marr child y82 y84 y82child y84child --robust omit child y84child y82child --wald # Reject H0 clear open "/Users/jcaceres/Google Drive/jcd/carlos3/2015_2016/Aplicada/Week8_2016/duration.gdt" # trabajadores de Kentucky con salarios altos smpl ky=1 && highearn=1 --restrict summary durat --simple --by=afchnge ols durat const afchnge --robust # trabajadores de Kentucky con salarios bajos smpl --full smpl ky=1 && highearn=0 --restrict ols durat const afchnge --robust # ii) smpl --full genr ldurat=log(durat) genr afchigh=afchnge*highearn smpl ky=1 --restrict ols ldurat const afchnge highearn afchigh --robust # iii) mirar interpretacion de coef. de afchange !! # iv) valor del R^2 # v) smpl --full smpl ky=1 --restrict ols ldurat const afchnge highearn afchigh male married manuf construc --robust # vi) smpl --full smpl mi=1 --restrict ols ldurat const afchnge highearn afchigh --robust ols ldurat const afchnge highearn afchigh male married manuf construc --robust