I am working with a data set with 78 variables and I want to do a backward elimination. I can do this easily in R (except for when there are categorical variables in with more than 53 levels), but I cannot locate a function to do that in python.
So, is there a way I can write a loop or something the can go through the p-values after the regression model is fitted and then return those variables that are not statistically significant?
Alternatively, I want to know how I can get the results from the sm.OLS summary into a dataframe so I can sort out variables with undesirable p-values on my own.
I searched for backward elimination for python, but I kept getting no results. I have tried a few methods of obtaining the data frame I mentioned. I can get the p-values, but now labels.