Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 73330

predict following suest not working?

$
0
0
Hi,

I'm trying to ensure that I'm using suest correctly by comparing it to sureg, and have one problem and a couple of questions.

(Note that *later* I will be replacing the regress commands below with tobit and poisson regressions, and allowing them to have independent overlapping samples; but I *first* need to ensure that I'm using the suest command correctly for OLS regression with a simple balanced panel.)

My code is:

Code:
sureg (dv1 iv1a iv1b iv1c iv1d iv1e iv1f iv1g iv1h) (dv2 iv2a iv2b iv2c iv2d iv2e iv2f iv2g), corr noci

regress dv1 iv1a iv1b iv1c iv1d iv1e iv1f iv1g iv1h, noci
estimates store est_dv1_ols

regress dv2 iv2a iv2b iv2c iv2d iv2e iv2f iv2g, noci
estimates store est_dv2_ols

suest est_dv1_ols est_dv2_ols, noci vce(robust)
predict prd_dv1_olssue, equation(#1)
generate rsd_dv1_olssue = dv1 - prd_dv1_olssue
predict prd_dv2_olssue, equation(#2)
generate rsd_dv2_olssue = dv2 - prd_dv2_olssue

pwcorr rsd_dv1_olssue rsd_dv2_olssue

But the third last command [predict... equation(#2)] returns a single value for all observations.

Can anyone see what I might be doing wrong in that particular command? (There is no error response following the command.)

Also, can anyone confirm that the final pwcorr command *should* give the same correlation coefficient (r) between the DV residuals as provided by the corr option on sureg? (It doesn't right now, probably because of the problematic predict command.)

And finally, can anyone confirm that adding the corr option to the pwcorr command would be incorrect (and would give a different p-value than provided by the corr option on sureg), because the correct p-value invovles the "Breusch-Pagan test of independence" (a chi-squared test with test statistic of N*r^2 with one degree of freedom, as per p10 at http://faculty.arts.ubc.ca/dwhistler/326UBC/chap15.pdf).

(Note that calculating the residuals directly from the regress commands does give the same correlation coefficient as in sureg, and also gives the expected *different* p-value.)

Thanks,
=Peter



Viewing all articles
Browse latest Browse all 73330

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>