From the course: Python Data Analysis
Unlock the full course today
Join today to access over 24,500 courses taught by industry experts.
Solution: Gapminder model fit - Python Tutorial
From the course: Python Data Analysis
Solution: Gapminder model fit
- [Instructor] Okay, so we need to find a model for the babies_per_woman variable that has a sufficiently high explanatory power as measured by the F statistic. Let's set up a formula. We'll use the region and age5_surviving. I define a model, fit it, and return the resulting object. Test. Okay, this is almost right. The F value is not quite there, so this may take some experimentation. We could add a second explanatory variable, but the result is actually worse. In fact, we find that using a different function of the age5_surviving variable is just what we need. How about the second power, the square? Perfect.