From the course: Spatial Machine Learning and Statistics in Python

Unlock this course with a free trial

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

Running OLS regression on spatial data

Running OLS regression on spatial data - Python Tutorial

From the course: Spatial Machine Learning and Statistics in Python

Running OLS regression on spatial data

- [Instructor] Regression analysis, including ordinarily least squares, or OLS, is a fundamental statistical tool set for understanding and quantifying the relationship between variables. It allows us to make predictions and infer causal relationships by examining how changes in the independent variable affect the dependent variable. In this video, we will demonstrate how to perform OLS regression on spatial data. First, let's import our go-to packages, and make sure that we have the latest version of the European dataset loaded in this notebook. This data frame should contain the local Moran's statistics as well as the x and y centroid coordinates. Then, let's import the stats model library, which we are going to use to do the regression. We can quickly check the version we are using here, and in case you do not have it installed yet, you can easily install it by just running the usual pip install command. Next, let's prepare the data for regression by first picking the target…

Contents