* the command in the next line establishes that the; * semincolon is the end of line marker. This; * allows one to write commands over multiple lines; # delimit; * this program generates estimates from; * angrist and evans, aer, 1998; * the sample is maried women, aged 21-35; * with 2+ kids. from the 1980 census 5% pums; * the outcome of interest is female labor; * supply and the covariate is; * whether a mom had a third kid. The instruments; * are measures of the sex composition of the ; * first 2 children; * this is a large data set so increase; * the memory to 20 megs; set memory 20m; *define log; log using pums80.log,replace; *read in stata data file; use pums80; * get a description of variables; * in the data set; desc; * generate some new variables; gen twoboys=boy1st*boy2nd; gen twogirls=(1-boy1st)*(1-boy2nd); * get descriptive statistics; * 1980 married women sample; * these are in column 3, Table 2; sum kidcount morekids boy1st boy2nd twoboys twogirls samesex multi2nd agem1 agefstm workedm weeksm1; * get correlation coefficient between; * instrument and endogenous RHS variable; * correlation coefficient is 0.0695; corr morekids samesex; * OLS of bivariate regression; * model assuming OLS model is correct; * specification; reg worked morekids; * wald estimate; * using the notation from class, if we have y,x,z,w; * syntax for ivregress; * ivregress 2sls y w (x=z); * in this case, w=null,y=worked, x=morekids, z=samesex; ivregress 2sls worked (morekids=samesex); * notice that ratio of OLS standard error; * to IV std error on MOREKIDS is 0.0020246/0.0291243; * which equals 0.0695, the rho(morekids,samesex); * 1st stage estimates; * married women sample; * these numbers are in Table 6, columns 4-6; *column (4); reg morekids samesex agem1 agefstm black hispan othrace; * column (5); reg morekids samesex boy1st boy2nd agem1 agefstm black hispan othrace; * column (6); * test twoboys=twogirls, the two coefficients are the same; * test twoboys=twogirls=0, the two coefficients equal zero; * this second test is the also the 1st stage f-test; reg morekids twoboys twogirls boy1st agem1 agefstm black hispan othrace; test twoboys=twogirls; test twoboys twogirls; * demonstrate 1st stage and reduced form results for; * exactly identified model; * 1st stage; reg morekids samesex boy1st boy2nd agem1 agefstm black hispan othrace; * reduced form; * look at the t-stat on the same sex variable and compare later on; * to the t-stat in the 2sls model; reg worked samesex boy1st boy2nd agem1 agefstm black hispan othrace; * ols and 2sls results; * 1980 pums; * married women sample; * table 7, columns 4-6; * ols worked for pay model; reg workedm morekids boy1st boy2nd agem1 agefstm black hispan othrace; * 2sls worked for pay model; * same sex as instrument; reg workedm morekids boy1st boy2nd agem1 agefstm black hispan othrace (samesex boy1st boy2nd agem1 agefstm black hispan othrace); * can also do by ivregress; * there are 4 variables, y,x,w and z as we have defined them in class. * the syntax is ivregress 2sls y w (x=z); ivregress 2sls workedm boy1st boy2nd agem1 agefstm black hispan othrace (morekids=samesex); * 2sls worked for pay model; * 2boys 2girls as instruments; ivregress 2sls workedm boy1st agem1 agefstm black hispan othrace (morekids=twoboys twogirls boy1st agem1 agefstm black hispan othrace); * ols weeks worked model; reg weeksm1 morekids boy1st boy2nd agem1 agefstm black hispan othrace; * 2sls weeks worked model; * same sex as instrument; reg weeksm1 morekids boy1st boy2nd agem1 agefstm black hispan othrace (samesex boy1st boy2nd agem1 agefstm black hispan othrace); * 2sls weeks worked model; * 2boys 2girls as instruments; ivreg weeksm1 boy1st agem1 agefstm black hispan othrace (morekids=twoboys twogirls boy1st agem1 agefstm black hispan othrace); log close;