Why do R and statsmodels give slightly different ANOVA results?

限于喜欢 提交于 2019-12-01 05:45:59

Looks like "Diet" only has one degree of freedom in the statsmodels call which means it was probably treated as a continuous variable whereas in R it has 3 degrees of freedom so it probably was a factor/discrete random variable.

To make ols() treat "Diet" as a categorical random variable, use

cw_lm=ols('weight ~ C(Diet) + Time', data=cw).fit()
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!