【发布时间】:2020-11-23 14:46:23
【问题描述】:
我正在尝试使用 statsmodels 运行聚类线性回归:
import statsmodels.formula.api as smf
mod = smf.OLS("C(cured) ~ Loan_term + Loan_Amount + Loan_APR + Loan_Term + Client_Age + Total_Income", data=df)
我收到以下错误:
ValueError: endog has evaluated to an array with multiple columns that has shape (17314,2). This occurs when the variable converted to endog is non-numeric (eg. bool or str).
用更少的变量尝试了同样的事情,什么也没有。因变量是一个虚拟变量,所以我把它作为分类变量,我认为这没问题,但无论如何我在没有它的情况下尝试了它,并且出现了同样的错误。 我真的不知道这个错误指的是什么。有人知道这里发生了什么吗?
【问题讨论】:
标签: python statistics regression statsmodels