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

  • Problem with instruments in the spivregress

    Dear All,

    I am estimating a spatial IV model using the files that you can download from here. They include the data file and the shp.dta file.

    I generate a simple distance matrix:

    spset, modify coordsys(latlong, kilometers)
    spmatrix create idistance dW, replace
    Then, I would like to estimate the following model:

    spivregress yp9500 (pc_culture=pc_institutions literacy1880) urb_rate1850 school countryname*, het dvarlag(dW)
    Unfortunately, I get the following error message:

    equation not identified; must have at least as many instruments not in the regression as there are
    instrumented variables
    I cannot understand why, since the two instruments are not included in the set of regressors of the main equation. Even worse, the estimation of the following model is fine:

    spivregress yp9500 (pc_culture=pc_institutions) urb_rate1850 school countryname*, het dvarlag(dW)

    But, if I try to estimate:

    spivregress yp9500 (pc_culture=literacy1880) urb_rate1850 school countryname*, het dvarlag(dW)

    I get the same error message as before. So, apparently, the problem is with that variable. But it does not appear elsewhere in the estimation. Moreover, I checked if by chance it was a duplication of any other variable used in the analysis, but this is not the case. So, do you have any explanation about this issue? It is really puzzling.


    if I do not consider any spatial correlation and I estimate:

    ivreg2 yp9500 (pc_culture=litt) pc_institutions urb_rate1850 school, r first
    The estimation goes through with the (correct) specification that the equation is exactly identified.This leads me to think that possibly it is a problem with spivregress? But which kind of problem?

    Thanks in advance


    I tried to estimate the above model using spivreg, rather than spivregress. Still I receive an error message, about missing values in the variable. In fact for the variable literacy I have 67 observations rather than 69. Could be this the reason of the error message above?
    Last edited by Dario Maimone Ansaldo Patti; 27 Apr 2019, 18:31.

  • #2
    You didn't get a quick response. You'll increase your chances of a useful response by following the FAQ on asking questions - provide Stata code in code delimiters, readable Stata output, and sample data using dataex.

    It is hard to diagnose such problems when we can't replicate them. It is likely that the problem has to do with missing data in literacy1880 or that it is colinear with something else in the model.


    • #3
      Thanks. Actually, the problem was with the two missing values. Once I substituted a value in the cells it worked fine. Hence I was able to find the correct values of the variable literacy1880 and it worked.