From the course: Practical Python for Time Series Analysis

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Implement linear regression with statsmodels

Implement linear regression with statsmodels - Python Tutorial

From the course: Practical Python for Time Series Analysis

Implement linear regression with statsmodels

- [Instructor] These numbers are the result of the linear regression that interprets how much the relationship from the CPI, inflation, influences on the mortgage rate, MR. You'll get metrics such as the coefficient estimates or the R-squared that are very important to interpret the results, which I will explain in the following video. In this video, you will learn the steps to obtain these results, so that you can replicate it into any other practical case where you want to relate one variable to another by measuring which is the impact of an explanatory variable, in this case, it is the CPI, into a target variable, which in this case is the mortgage rate. Let's start by loading the data. We'll work with the biweekly data points of CPI and mortgage rate from 28 December, 2007 until the 8th of August, 2008. The first thing we do for a linear regression is to visualize the relationship, which we can do with the Plotly…

Contents