Announcement

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

  • Why can't "spautoreg" ("spweight") handle spatial weighting matrix greater than "11,000 by 11,000" in dimension like "spreg" ("spmat")?

    I'm estimating a cross-section spatial model.

    Now the problem is that I have 15,054 observations and need to create a 15,054 by 15,054 weighting matrix (inverse distance based) for both the spatial lag and spatial error terms. Using "spmat" which is associated with "spreg" will create the 15,054 by 15,054 matrix fine, (strangely Stata only allows up to 11,000 variables?? that the matsize limit is only 11,000), but running the spreg gs2sls with both "elmat" and "dlmat" (i.e. implementing the Cliff-Ord model) will froze the Stata program for hours and hours and hours... to the point where I don' think the program is actually calculating anything !

    A suggestion from Stata programmers is that I band the matrix (truncate some of the values, so it reduces the size of the matrix to only 3723 by 15,054), that solves the frozen situation, but it's not very ideal, and "spreg" doesn't provide enough basic statistical information, such as the R-squared, F-test and pre-estimation spatial autocorrelation tests such as the Moran's I and the Lagrange Multiplier test for the spatial errors...

    Now, that's why I want to switch to "spautoreg", but first off, I can't even create a spatial weighting matrix using "spweight" which is assocaited with "spautoreg", because it returns a ridiculous error message that reads:

    "Current Matrix Size = (11000)
    matsize must be >= Sample Size (15054)
    matsize must be between 10 and 11000"

    Using the one I obtained from "spmat" is out of the question, since it's not compatiable with "spautoreg", only usable with "spreg".

    Are there any other spatial regression package I can use? I believe "spregsac" "spregsam" "spregpdm" etc are in the same family of "spautoreg" since they are created by the same person.

    I'm using Stata 11.2 SE with 16 GB RAM at the moment, but switching to Stata 12.2 SE doesn't help either... I have Stata 13.1 IC too, but obviously it only makes the matter worse...

    Thank you very much for your help in advance !
    Last edited by catnipcraze; 16 Apr 2014, 04:59.

  • #2
    spautoreg is user-written from SSC, as you are explained to explain in the Advice Guide. Its author is not obviously active here, so you may need to approach him directly for support.

    It's a long complicated program and its help is densely written too, but there is an easy guess: despite its use of Mata for various one-off calculations, the program relies on holding spatial information in a Stata matrix and so the limit on matrix size in Stata can bite, and it is biting you.

    I don't have a solution for you beyond your writing a lot of code.

    Whatever may be accepted or admired habits elsewhere that you work, on Statalist we ask for use of full real names. If you didn't see that advice, you didn't try hard to understand what is requested of posters; if you saw and decided to ignore it, that attitude is likely to be returned.

    Comment

    Working...
    X