Reputation: 275
I used the statsmodels.formula.api
as below to calculate P-values. But apparently, this is not working in the new versions of the library. Do you know an alternative tool?
import statsmodels.formula.api as sm
# ...
regressor_OLS = sm.OLS(Y, x).fit()
Error:
AttributeError: module 'statsmodels.formula.api' has no attribute 'OLS'
Upvotes: 1
Views: 252
Reputation: 582
try changing
regressor_OLS = sm.OLS(Y, x).fit()
to
regressor_OLS = sm.OLS(endog=Y, exog=x).fit()
Upvotes: 0