@ program to replicate Table 6 of Green and Krasno (1988) @ @ AJPS; analysis of effects of $ in House elections @ @ Four Analysis are included here: @ @ #1: OLS, linear model @ @ #2: 2sls, linear model @ @ #3: OLS, interactions & log of challenger spending @ @ #4: 2sls, interactions & log of challenger spending @ @ Note problems with standard errors for 2sls estimates @ @ of effects of exogenous variables. Green generated the @ @ estimates using LS in two sequential regressions and @ @ used the Hout (_Soc. Methods and Research_) method for @ @ correcting standard errors, but only for the endogenous @ @ regressor "ie". Consequently, the SE's for incumbent @ @ expenditures are right, but the rest are a bit off. @ @ Luckily, nothing of substance was affected by this mistake.@ load cong78[236,9]=update78.data; @-----------------------------------------------------------@ @ uncomment the selif command to run analysis for subgroups @ @-----------------------------------------------------------@ e1=cong78[.,5] .lt 10000; e2=(cong78[.,5] .ge 10000) .and (cong78[.,5] .lt 100000); e3=(cong78[.,5] .ge 100000); @cong78=selif(cong78,e1);@ cv = cong78[.,3]/10; p = cong78[.,4]; p=(p-2)*-1; q=cong78[.,5] .le 1000; v= { 1000 }; newce=recode(cong78[.,5],q,v); logce=ln(newce) - ln(1000); ce = cong78[.,5]/1000; ie = cong78[.,6]/1000; cpq = cong78[.,7] -1; cps = cong78[.,8]/10; iet1= cong78[.,9]/1000; xcps=logce.*cps; xcpq=logce.*cpq; call ols(0,cv,cps~ce~ie~p~cpq); @---------------------------------------------------@ @ 2sls estimates and standard errors @ @---------------------------------------------------@ z=ones(rows(p),1)~cps~ce~iet1~p~cpq; x=ones(rows(p),1)~cps~ce~ie~p~cpq; y=cv; b_iv=inv(z'x)*z'y; print "b_2sls: ones(rows(p),1)~cps~ce~ie~p~cpq"; print "estimates and standard errors"; resid=cv-(ones(rows(p),1)~cps~ce~ie~p~cpq)*b_iv; s2=(1/(rows(resid)-cols(z)))*resid'resid; se_b_iv=sqrt(diag(s2*inv(z'x)*z'z*inv(z'x))); print b_iv~se_b_iv; call ols(0,cv,cps~logce~ie~p~cpq~xcps~xcpq); @---------------------------------------------------@ @ 2sls estimates and standard errors @ @---------------------------------------------------@ z=ones(rows(p),1)~cps~logce~iet1~p~cpq~xcps~xcpq; x=ones(rows(p),1)~cps~logce~ie~p~cpq~xcps~xcpq; y=cv; b_iv=inv(z'x)*z'y; print "b_2sls: ones(rows(p),1)~cps~logce~ie~p~cpq~xcps~xcpq"; print "estimates and standard errors"; resid=cv-(ones(rows(p),1)~cps~logce~ie~p~cpq~xcps~xcpq)*b_iv; s2=(1/(rows(resid)-cols(z)))*resid'resid; se_b_iv=sqrt(diag(s2*inv(z'x)*z'z*inv(z'x))); print b_iv~se_b_iv; /* library pgraph; graphset; _plctrl = -1; xy(ce,cpq); */