Announcement

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

  • OLS with Conley Spatial standard errors

    Hi everyone,

    I desperately need some help here.
    I am using x_ols to get corrected standard errors for spatial dependence which works fine.
    But I also need adjusted R-squared which is not part of the output. In "ereturn list", e(r2_a) gives a very large number which is far away from the true one (I know this because this is a replication of a famous published paper).
    What about Wald test? I feel that "test" command after x_ols doesn't work right because the result is not different from the test after ordinary ols.

    Any advice?

  • #2
    OK. I figured it out. Just in case someone has the same problem:

    For R-squared, I simply used those from ordinary OLS regressions because Conley's x_ols only changes standard errors, not coefficients (therefore, not predicted values).

    For Wald test, I did it manually after the regression with this coding:

    matrix b = e(b)'
    matrix V = cov_dep
    *Because according to the code, "There will also be a matrix cov_dep, the corrected variance-covariance matrix"
    matrix R=(1,-1,0,0,0,0,0,0,0)
    *Well, I am testing the equality of the first and second coefficients in my regression
    matrix r=(0)
    matrix W=(R*b-r)'*invsym(R*V*R')*(R*b-r)
    scalar wald=W[1,1]
    display "Wald test statistic: " wald " with p-value: " chi2tail(rowsof(R),wald)
    display "F statistic: " wald " with p-value: " Ftail(rowsof(R), e(df_r),wald)
    *The ftail is the one we usually get with "test" command

    Comment

    Working...
    X