pombreda / pysal

Automatically exported from code.google.com/p/pysal
Other
0 stars 0 forks source link

spreg.OLS summary bug #162

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Running the attached script will reproduce the bug.

Error Message:

In [5]: run trend_surface
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/Users/serge/Dropbox/spatialEconometrics/spatialinterpolation/trend_surface.py 
in <module>()
     39 XMAT.append(XY)
     40 XMAT = np.array(XMAT).T
---> 41 ols2 = pysal.spreg.OLS(z, XMAT)
     42 
     43 

/Users/serge/Dropbox/pysal/src/pysal/trunk/pysal/spreg/ols.pyc in 
__init__(self, y, x, w, constant, name_y, name_x, name_ds, vm, pred)
    420         self.name_x = USER.set_name_x(name_x, x, constant)
    421         USER.DiagnosticBuilder.__init__(self, x=x, constant=constant, w=w,\
--> 422                                             vm=vm, pred=pred)
    423 
    424 def _test():

/Users/serge/Dropbox/pysal/src/pysal/trunk/pysal/spreg/user_output.pyc in 
__init__(self, x, constant, w, vm, pred, instruments)
    148 
    149         #part 5: summary output

--> 150         self.summary = summary_results(self, w, vm, pred, instruments)
    151 
    152 def set_name_ds(name_ds):

/Users/serge/Dropbox/pysal/src/pysal/trunk/pysal/spreg/user_output.pyc in 
summary_results(reg, w, vm, pred, instruments)
    414         strSummary += "SPECIFICATION ROBUST TEST\n"
    415         strSummary += "TEST                  DF          VALUE            PROB\n"
--> 416         strSummary += "%-22s%2d       %12.6f        %9.7f\n\n" % 
('White',reg.white['df'],reg.white['wh'],reg.white['pvalue'])
    417 
    418     # spatial diagonostics

TypeError: string indices must be integers, not str
WARNING: Failure executing file: <trend_surface.py>

Original issue reported on code.google.com by sjsrey on 19 Jul 2011 at 5:00

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by sjsrey on 19 Jul 2011 at 5:01

GoogleCodeExporter commented 9 years ago

Original comment by sjsrey on 20 Jul 2011 at 11:09