本文介绍了Python 中的逐步回归的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

如何在python中执行逐步回归?SCIPY 中有 OLS 的方法,但我无法逐步进行.在这方面的任何帮助将是一个很大的帮助.谢谢.

How to perform stepwise regression in python? There are methods for OLS in SCIPY but I am not able to do stepwise. Any help in this regard would be a great help. Thanks.

我正在尝试构建线性回归模型.我有 5 个自变量并使用前向逐步回归,我的目标是选择变量以使我的模型具有最低的 p 值.以下链接解释了目标:

I am trying to build a linear regression model. I have 5 independent variables and using forward stepwise regression, I aim to select variables such that my model has the lowest p-value. Following link explains the objective:

https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=4&ved=0CEAQFjAD&安培; URL = HTTP%3A%2F%2Fbusiness.fullerton.edu%2Fisds%2Fjlawrence%2FStat网上通%2FExcel%2520Notes%2FExcel%2520Notes%2520-%2520STEPWISE%2520REGRESSION.doc&安培; EI = YjKsUZzXHoPwrQfGs4GQCg&安培; USG = AFQjCNGDaQ7qRhyBaQCmLeO4OD2RVkUhzw&安培;bvm=bv.47244034,d.bmk

再次感谢.

推荐答案

Trevor Smith 和我用 statsmodels 为线性回归编写了一个小前向选择函数:http://planspace.org/20150423-forward_selection_with_statsmodels/ 您可以轻松修改它以最小化 p 值,或者只需要多做一点工作即可根据 beta p 值进行选择.

Trevor Smith and I wrote a little forward selection function for linear regression with statsmodels: http://planspace.org/20150423-forward_selection_with_statsmodels/ You could easily modify it to minimize a p-value, or select based on beta p-values with just a little more work.

这篇关于Python 中的逐步回归的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-07 18:37