#delimit; **Do file for Homework 6, Emprical Anlysis of Microdata, Osaka University**; **11/12/2002**; **by Daiji Kawaguchi**; clear; set more off; set mem 250m; cap log close; log using \stataproject\micrometrics\hw6\hw6.log, replace; *Page 294, 10.7 GPA of student athlete; use \stataproject\micrometrics\hw6\gpa.dta,replace; *Fixed Effects Estimation; xtreg trmgpa spring crsgpa frstsem season, fe i(id); hausman,save; *Random Effects Estimation; xtreg trmgpa spring crsgpa frstsem season sat verbmath hsperc hssize black female, re i(id); hausman; *Page 295, 10.10 Murder rate and death penalty; use \stataproject\micrometrics\hw6\murder.dta,replace; *First Difference Estimation; *You MUST include time dummy because theta_t is included in the specification; reg cmrdrte d93 cexec cunem; *Test of serical correlation of ideosyncratic error; predict uhat,residual; gen uhatlag=uhat[_n-1] if id==id[_n-1]; reg uhat uhatlag; *Fixed Effects Estimation; xtreg mrdrte d90 d93 exec unem,i(id) fe; *Page 295, 10.11 Lowbirth Weight and AFDC (Estimatoin of HH production function); use \stataproject\micrometrics\hw6\lowbirth.dta,replace; *OLS estimation with usual standard error; reg lowbrth d90 afdcprc lphypc lbedspc lpcinc lpopul; *OLS estimation with serical correlation-robust standard error; reg lowbrth d90 afdcprc lphypc lbedspc lpcinc lpopul,cluster(stateabb); *First Difference Estimation; reg clowbrth cafdcprc clphypc clbedspc clpcinc clpopul; *First Difference Estimation with quadratic term of afdcprc; reg clowbrth cafdcprc cafdcpsq clphypc clbedspc clpcinc clpopul; *Calculation of turning point; di -_b[cafdcprc]/(2*_b[cafdcpsq]); log close; exit;