Relative Content

Tag Archive for loopsstatsmodels

Using a for loop to iterate through a df to make comparison between models (OLS and anova_lm with statsmodel)

Hi guys I’m on my way with ISLP and I’m learning alot.
I’m doing an exercise (cap 3, 9, i) that asks to see if there is a relation between the predictors and the model using anova_lm.
I don’ t get the point to do such thing instead of an F and anyway with a full model one would get the point. Anyway I’m wondering if I could loop through the columns and make for each loop a comparison between the null model and the fitted model with one predictor.