0

I tried PYSAL library in python for Basic OLS method, I followed official documentation from pysal library and for some reason summary for OLS can be shown it says 'str' object has no attribute 'summary'

YVar='cena'
XVars = ["km", "stari", "diesel"]

Y=data[YVar].as_matrix().reshape((len(data),1))
X=data[XVars].as_matrix()


ols=ps.model.spreg.OLS(Y,X,name_y=YVar, name_x=XVars,nonspat_diag=True, white_test=True)
# till here it works perfectly



print("ols".summary())
Thomas Kyle
  • 101
  • 1
  • 8

1 Answers1

0

You want to print ols variable, but you are trying to print "ols" as a text string. Quotation marks should not be there.

print(ols.summary())
martinfleis
  • 7,124
  • 2
  • 22
  • 30