Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • predict following suest not working?

    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



  • #2
    I've found the problem: That predict... equation(#2) line should be predict... equation(#3).

    Depending on the estimation commands used (the regress commands in this example), suest produces more than one 'equation' for each regress model.

    In this case, suest provides an est_dv1_ols_mean equation (which is equation #1) and an est_dv1_ols_lnvarequation (which is equation #2) for the est_dv1_ols part of the suest call, and two corresponding equations (#3 & #4) for the est_dv2_ols part.

    My predict prd_dv2_olssue, equation(#2) code referred to the est_dv1_ols_lnvar equation, where I needed the est_dv2_ols_mean equation.

    The two predict commands would be more explicitly written, using the equation names (rather than #'s) as:
    Code:
    predict prd_dv2_olssue, equation(est_dv1_ols_mean)
    predict prd_dv2_olssue, equation(est_dv2_ols_mean)
    And using these does produce the same correlation coefficient in the final pwcorr command as was obtained from the sureg command's corr option (but, yes, not the same p-value).

    Of note, when I then go on to implement this for my tobit and poisson versions, the tobit part of suest also produces 2 equations (est_dv1_tob_mean and est_dv1_tob_sigma), but the poisson part only produces one (est_dv2_poi_mean). So if I'd arbitrarily used the Poisson model as the first, my predict calls would have been for #1 and #2 (not #1 and #3)... so, better to use the explicit equation names, rather than the #'s).

    All this points out that I don't yet understand what the second equation in the suest following regress (or following tobit) results actually means.

    (And, further, why the suest command provides the same coefficient estimates as the regress commands, and not those from the sureg. This seems to indicate that post-estimation suest following regress doesn't actually do the same thing as non-post-estimation/'direct-estimation' sureg... which means my suest following tobit and poisson isn't equivalent to a 'direct' version (like sureg).)

    If anyone can comment on this, I'd be grateful!

    Thanks,
    =Peter

    Comment

    Working...
    X