使用“ statsmodels.sandbox.sysreg.SUR”在python中看似无关的回归时出错

时间:2019-05-31 14:15:13

标签: regression statsmodels sys

虽然python中的类(statsmodels.sandbox.sysreg.SUR(sys,sigma = None,dfk = None))代码,输出显示错误,指出{ValueError:无法将大小为616的序列复制到尺寸为5的数组轴}

请帮助我编码时出错。

我使用hrean','vacas','sicve','inur','penin'来估计SUR模型,因为内生变量和外生变量是'euc','tene','tenesq','unn' ,'eer','eersq','sth','nrtht','nrten','mard','whe','me','cot'

import pandas as pd
import numpy as np
import statsmodels.api as sm
from statsmodels.sandbox.sysreg import SUR

#Load the data FRINGE.dta
df = pd.read_stata("C:/Users/~/RINE.dta")

# add constant value
df['cot']=1

endog = df[['hrean','vacas', 'sicve', 'inur', 'penin']]
exog = df[['euc','tene','tenesq','unn','eer','eersq',
           'sth','nrtht','nrten','mard','whe', 'me','cot']]
sys = [endog,exog]

reg1 = SUR(sys).fit

“我正在收到如下所述的价值错误消息。”

“ ValueError:无法将大小为616的序列复制到维度为5的数组轴上”

0 个答案:

没有答案