* * Dougherty, Introduction to Econometrics, 4th ed * Example from Section 3.3 * Multiple linear regression * open data eaef21c.xls data(format=xls,org=columns) 1 540 id female male ethblack ethhisp ethwhite age s educprof educphd educmast \$ educba educaa educhsd educdo single married divorced faithn faithp faithc faithj faitho asvab01 asvab02 \$ asvab03 asvab04 asvab05 asvab06 asvabc height weight85 weight02 sm sf siblings library pov78 earnings \$ hours tenure exper collbarg catgov catpri catse urban regne regnc regw regs * linreg(smpl=(collbarg==1)) earnings # constant s exper linreg(smpl=(collbarg==0)) earnings # constant s exper * * Multiplicative decomposition of standard errors for slope coefficients * * cmom(center) computes the sums of squared (on the diagonal) and cross * (off-diagonal) deviations of the variables. Dividing by the number of * observations gives the mean squares and covariances. That's saved into CX. * %CVTOCORR converts that to correlations, which is saved into RX This includes * the CONSTANT in the list even though the mean square is zero and the * correlations are undefined so the position matches up with the regression. * cmom(center,smpl=(collbarg==1)) # constant s exper * compute cx=%cmom/%nobs compute rx=%cvtocorr(cx) * linreg(smpl=(collbarg==1)) earnings # constant s exper * disp "Su" sqrt(%seesq) "n" %nobs "msd" cx(2,2) "r" rx(2,3) "s.e." %stderrs(2) disp "Su" sqrt(%seesq) "n" 1.0/sqrt(%nobs) "msd" 1.0/sqrt(cx(2,2)) "r" 1.0/sqrt(1-rx(2,3)^2) * * Same thing for the other subsample * cmom(center,smpl=(collbarg==0)) # constant s exper * compute cx=%cmom/%nobs compute rx=%cvtocorr(cx) * linreg(smpl=(collbarg==0)) earnings # constant s exper * disp "Su" sqrt(%seesq) "n" %nobs "msd" cx(2,2) "r" rx(2,3) "s.e." %stderrs(2) disp "Su" sqrt(%seesq) "n" 1.0/sqrt(%nobs) "msd" 1.0/sqrt(cx(2,2)) "r" 1.0/sqrt(1-rx(2,3)^2)