我的问题是用一个logistic模型来测试两个二元因素及其在因变量上的相互作用。当我不包括交互项时,模型就起作用了,当我包含交互项时,我得到了
"PerfectSeparationError: Perfect separation detected, results not available"
对于logistic回归,已经有一个关于完全分离的问题得到了解答,但这个问题特别涉及到模型中带有交互项的完全分离误差。在
这是我的数据 Dataframe
我的代码:
endog_cols = df.columns[1:3]
exog_cols = df.columns[4:8]
logit2 = sm.GLM(df[endog_cols], df[exog_cols], family = sm.families.Binomial()).fit()
目前没有回答
相关问题 更多 >
编程相关推荐