Dear Roger,
thanks for the quick response. I ran debug as you advised, and got this

Browse[1]> cor(Zp)
            Rho (Intercept)         Pop        PctA       AgeA       EducA
Rho           1          NA          NA          NA         NA          NA
(Intercept)  NA           1          NA          NA         NA          NA
Pop          NA          NA  1.00000000  0.06233083 0.02604018 -0.08305616
PctA         NA          NA  0.06233083  1.00000000 0.21103112 -0.21089741
AgeA         NA          NA  0.02604018  0.21103112 1.00000000  0.09762170
EducA        NA          NA -0.08305616 -0.21089741 0.09762170  1.00000000
IncMed       NA          NA -0.19474344 -0.00996023 0.03553646  0.47054366
PctOM        NA          NA  0.21678235 -0.06551557 0.08429103 -0.26513718
                 IncMed       PctOM
Rho                  NA          NA
(Intercept)          NA          NA
Pop         -0.19474344  0.21678235
PctA        -0.00996023 -0.06551557
AgeA         0.03553646  0.08429103
EducA        0.47054366 -0.26513718
IncMed       1.00000000 -0.47546336
PctOM       -0.47546336  1.00000000
Warning messages:
1: In lag.listw(listw, y) : NAs in lagged values
2: In cor(Zp) : the standard deviation is zero


I am trying to figure out what went wrong, but I am not that familiar with
mechanics of stsls. Please let me know if you have any quick
recommendations.

Best regards,
adam


On Thu, Apr 23, 2009 at 7:29 AM, Roger Bivand <Roger.Bivand@nhh.no> wrote:

> On Wed, 22 Apr 2009, Adam Okulicz-Kozaryn wrote:
>
>  Hello,
>> i am trying to run  stsls from spdep, and I am getting error:
>>
>> Error in solve.default(ZpZp) :
>>  system is computationally singular: reciprocal condition number = 0
>>
>> I would get the same error in lagsarlm, but I can fix it by setting
>>
>
> I don't think that this is the same problem. In the *sarlm case, the
> problem is only in computing the asymptotic covariance matrix, and occurs
> when the scaling of rho or lambda and the betas varies a lot.
>
> Here it is occurring in the middle of TSLS, and suggests that there are
> colinearities around at the second stage, probably between yendp, the fitted
> endogenous lagged y and X (yendp fitted using X and WX). Setting the
> tolerance for solve will not help here at all. If you like, set
> debug(spdep:::tsls) and before running solve(ZpZp), eyeball the values going
> into Zp (cor(Zp) for example, or pairs(Zp)).
>
> Hope this helps,
>
> Roger
>
>
>
>> tot.solve=1e-12
>>
>> as suggested here
>>
>> http://www.nabble.com/Error-in-spdep%3A-system-is-computationally-singular-tt19880274.html#a19896513
>>
>> I cannot do that in stsls. I already rescaled variables to similar scale.
>> Is
>> there any way to fix that?
>> best,
>> adam
>>
>>
>>
>>
> --
> Roger Bivand
> Economic Geography Section, Department of Economics, Norwegian School of
> Economics and Business Administration, Helleveien 30, N-5045 Bergen,
> Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
> e-mail: Roger.Bivand@nhh.no
>
>


-- 
Adam Okulicz-Kozaryn
Postdoctoral Fellow
Institute for Quantitative Social Science at Harvard University (IQSS)
Harvard - MIT Data Center (HMDC)
CGIS South Bldg S306
1730 Cambridge Street, Cambridge, MA 02138

972 408 6919
adam.okulicz.kozaryn@gmail.com
people.hmdc.harvard.edu/~akozyarn

	[[alternative HTML version deleted]]

