I fitted two regression models, One with only 1 predictor and the another with 3 predictors. Now I want to compare these two models. How can I do that? I know how to do it in R but not sure how to do it in python. Here is the code in R for comparing the two models -
anova(albumSales.2, albumSales.3)
Result -
Model 1: sales ~ adverts
Model 2: sales ~ adverts + airplay + attract
Res.Df RSS Df Sum of Sq F Pr(>F)
1 198 862264
2 196 434575 2 427690 96.447 < 2.2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>
Based on the above result we can see that albumSales.3 significantly improved the fit of the model to the data compared to albumSales.2, F(2, 196) = 96.44, p < .001.
How can I do it in python?