# Cigarrette demand open cig_ch10.gdt # real avg price including sales tax genr lravgprs = log(avgprs/cpi) # real avg cig-specific tax genr rtax = tax / cpi # real average sales tax genr rtaxso = (taxs - tax)/cpi # log of consumption genr lpackpc = log(packpc) # real personal state income genr perinc = income / (pop*cpi) genr lperinc = log(perinc) ####################################### # restrict sample to 1995 observations smpl year=1995 --restrict # plain OLS ols lpackpc const lravgprs --robust ols lpackpc 0 lravgprs --robust # Tax as instrument: # First stage TSLS (to see relevance): ols lravgprs const rtaxso --robust eqnprint # TSLS tsls lpackpc const lravgprs ; const rtaxso --robust eqnprint ##### Including Income # plain OLS ols lpackpc const lravgprs lperinc --robust # do we get a similar coefficient? ols lpackpc const lravgprs --robust bols = $coeff(lravgprs) ols lpackpc const lravgprs lperinc --robust restrict --quiet b[lravgprs]- bols = 0 end restrict # not that different # TSLS - one IV tsls lpackpc const lravgprs lperinc ; const rtaxso lperinc --robust eqnprint # Get another IV (more efficient, test for exogeneity) # TSLS - 2 IV tsls lpackpc const lravgprs lperinc ; const rtaxso rtax lperinc --robust eqnprint # Relevant? ols lravgprs const rtaxso rtax lperinc --robust omit rtaxso rtax --wald # Exogenous? Sargan tsls lpackpc const lravgprs lperinc ; const rtaxso rtax lperinc --robust utsls = $uhat ols utsls const rtaxso rtax lperinc --robust # compute nR2 that distributes chi-square # with degrees of freedom equal to the additional instruments: 1 sartest = $T*$rsq pvalue X 1 sartest # J-statistic is m*F (number of instruments times the F for the H0 that # all the coeff on the instruments are zero omit rtaxso rtax Jst = 2*0.158816 # similar to nR2 # Hausman: ols lravgprs const rtaxso rtax lperinc --robust uhaus = $uhat ols lpackpc const lravgprs lperinc uhaus --robust # check output tsls lpackpc const lravgprs lperinc ; const rtaxso rtax lperinc --robust smpl full