Stepwise , Forward and Backward

31 views
Skip to first unread message

econometrician

unread,
Feb 6, 2021, 10:10:19 AMFeb 6
to pystatsmodels
I would like to know if there is a package to develop Stepwise , Forward and Backward
linear regression models ?
Thanks 
Jorge

josef...@gmail.com

unread,
Feb 6, 2021, 10:37:03 AMFeb 6
to pystatsmodels
I don't know of any.
There are recipes floating around on stackoverflow, and IIRC in our
issues, but no ready made functions in a package, AFAIK.


Stepwise selection doesn't have a good reputation, the properties of
it are not very good.
A better alternative is to use penalized estimation that includes
variable selection like LASSO.

The two related version that I worked on are ultrahigh screening and
all subset regression.
Neither, are in the public part of statsmodels.

Ultrahigh screening is when we have potentially many more variables
than observations, and combines forward selection of several variables
at the same time, with variable dropping based on SCAD penalization.
It has been in statsmodels for some time but still without official
model, https://github.com/statsmodels/statsmodels/blob/master/statsmodels/base/tests/test_screening.py

If we have only a small number of explanatory variables, then we can
compute regression for all subsets of variables and choose with aic,
bic or similar.
Efficient code for that is still waiting in a PR.

Josef
> --
> You received this message because you are subscribed to the Google Groups "pystatsmodels" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pystatsmodel...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pystatsmodels/31f135a0-f489-495c-a1c6-8c6494d14aadn%40googlegroups.com.

Michael Baudin

unread,
Feb 6, 2021, 1:23:46 PMFeb 6
to pystatsmodels

econometrician

unread,
Feb 7, 2021, 4:44:26 AMFeb 7
to pystatsmodels
The openturns does not have any example.

Michael Baudin

unread,
Feb 7, 2021, 6:06:39 AMFeb 7
to pystatsmodels
Hi!

This is true, sorry! To solve this, I created an issue at:


Please let the discussion continue there: i would not want to intrude within a forum for which OpenTURNS is off-topic.

Best regards,

Michaël

Jorge Ribeiro

unread,
Feb 7, 2021, 6:21:16 AMFeb 7
to pystat...@googlegroups.com
Let me explain the problem:
I am a SAS user with 30 years of modelling experience, and 3 months using Python, which I am impressed with.
I need to write a chapter of a book to use Stepwise, Forward and Backward selection method.
I can include openturns in my book if someone helps me.
I have done everything in R and SAS and I can share the code and data sets.
Thanks
Jorge







--
You received this message because you are subscribed to the Google Groups "pystatsmodels" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pystatsmodel...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages