statsmodels / statsmodels

Statsmodels: statistical modeling and econometrics in Python
http://www.statsmodels.org/devel/
BSD 3-Clause "New" or "Revised" License
10.11k stars 2.88k forks source link

Stepwise linear regression with AIC? #4328

Open KathyGCY opened 6 years ago

KathyGCY commented 6 years ago

What is the Python statsmodels equivalent for R step() function of stepwise regression with AIC as criteria?

I found a stepwise regression with p-value as criteria, is there something similar, but with AIC?

I'm also okay with other python packages.

josef-pkt commented 6 years ago

I don't know of any function.

My guess is that something like this loop can be adjusted to use aic instead of https://planspace.org/20150423-forward_selection_with_statsmodels/ link from #1809