
Learning how to do spatial analysis is one of the most powerful ways to improve your data analytics skills. By mastering this technique, you can take any kind of dataset that contains information about location and use it to gain insights about the subject matter.
Spatial datasets typically contain large amounts of information so analytical techniques such as k-means clustering or correlation functions may be adapted to run efficiently.
There are many applications where spatial analyses play an important role. For example, geographers often apply these methods to determine if there are significant clusters of the population in different areas or whether there is a positive or negative correlation between two variables depending on the context.
This article will go into some detail about what is needed to perform various types of spatial analysis using the free software package called QGIS. You will also learn how to readability compare maps with and without cluster markers and how to calculate local indicators of sprawl (LIBS) for a given area.
We will begin by looking at how to install QGS which comes preloaded with all the tools we need. Then, we will look at simple measures such as determining the centroid and radius of a cluster before moving on to more advanced statistical approaches.
Finally, we will discuss some popular applications of spatial analysis and how they fit into our overall goal of improving knowledge about populations and their environments.

First, you will need to make sure that you have installed the appropriate software for your computer. Most computers these days come with either Windows or macOS pre-installed so making sure that you have those is the first step! If you do not have one of these operating systems already, you can easily download them from Google or Microsoft.
After this, you will want to check if you already had access to the statistical software that you needed by running it in an internet browser before.

A scatterplot is one of the most fundamental ways to understand spatial data. You will probably start seeing them in almost every discipline that deals with spatiotemporal or geographical information.
A typical scatterplot consists of two sets of coordinates that describe both position and size. The positions can be distances, lengths, angles, or anything else that corresponds to where something is. For example, you could have a scatterplot showing the distance between each state and Mexico as a coordinate.
The sizes correspond to what element things are (states are large, countries are bigger than states, etc). This allows you to compare how close some places are to another country or measure how big some cities are compared to others.
Scatterplots typically show a correlation pattern. As the positions get closer together, the shapes become more similar and there are fewer differences in color. If they are far apart, then the colors get separated into different areas.
There are several rules of thumb for whether a pattern is significant or not.

A histogram is one of the most important tools for spatial data analysis. While not every dataset has a histogram, all datasets with more than discrete points need at least an informal histogram!
Histograms are very easy to make. All you have to do is pick an axis position, choose a bin size, and then plot your data points onto the axes using that bin as a scale.
When making a histogram it is extremely helpful to know what part of the graph denotes what. The number of bins should be proportional to the length of the longest dimension in the data set (the x-axis here would be latitude, so there should be many more bins in this coordinate system).
The y- or height value of each bar in the histogram corresponds to how often a specific range of values occurs in the dataset. For example, if your dataset includes numbers from zero to ten, then the highest bar in the histogram will be just above nine since only integers up to ten occur in the dataset twice.
Confidence intervals are an important part of any statistical analysis. They play a crucial role in determining whether or not your findings are reliable!
They help determine how much certainty you have in your conclusions. If a finding has a wide CI, then we don’t know if the result is accurate or not with 100% certainty.
This is what makes them different from significance tests like t-tests, where you can be more certain of your results.
With CIs, even if the mean is very close to the other group, there is still a range within which the true value lies, so we cannot say that one group is definitely better than another without calculating a CI first.
In this article, we will discuss how to calculate CIs for means and proportions using either parametric (e.g., Student's T) or nonparametric (e.g., Mann–Whitney U) methods.

The second major topic in spatial analysis is understanding what levels of statistical significance exist for each region or feature you find in your data.
There are two main reasons why you would want to know this. First, it helps determine if your findings are due to chance. If there’s a significant finding that seems too strong, then you may want to reconsider whether your hypothesis was accurate. Or perhaps you made a mistake in your calculations and your results are misleading.
The other reason is to identify which parts of your map are not reliable. For example, if there’s an area in your dataset with very low values (negative numbers), that might indicate something wrong happened during the collection of the data.
However, unless you have a good reason to believe that these negative numbers are correct, they shouldn’t be used as part of your analysis.
In either case, make sure to always use appropriate statistical significance tests when determining if any regions or features are important.

Correlation is an important concept to know when doing spatial analysis. It determines how likely it is that two things are connected or influenced by the same factor.
Correlations can be positive, negative, or zero- not necessarily dependent on whether one thing is bigger than another, but instead if they occur in close proximity to each other. Zero means there is no connection at all, while a very strong positive or negative correlation could indicate that something is influencing both of them.
There are many ways to determine correlations between different variables. The most straightforward way is using regression. This creates a line that predicts one variable as a function of the other. For example, if you wanted to predict average rainfall from average temperature, you would use a linear regression model where average rainfall = average temperature + some constant value.
The constant term is what we call the “slope” of the equation, as it tells us how much rain will increase with every degree of rise in temperature. In this case, the slope is positive, which indicates that as temperatures go up, precipitation goes up too!
Another method for determining correlations is through scatter plots and matrices. These diagrams show the relationship between two quantitative variables, so they must have numerical values. A Pearson product-moment correlation coefficient (or just plain ‘rho’ for short) computes the strength of the relation.

Regression is another way to perform analysis with spatial data. This article series will go into more detail about how to do this, but first, let’s review what we learned about correlation in our chapter on Descriptive Statistics.
We saw that correlation measures the strength of association between two variables and can have positive or negative values. A strong positive correlation means that as one variable increases so do the other, and vice versa.
A correlation coefficient greater than +1 indicates an increasing relationship, while a number less than -1 implies a decreasing relationship. The closer the numbers are to 0, the weaker the relationship.
When working with spatially-related data, it is important to remember that correlations measure linear relationships. That is, if area X has a high value and area Y has a low value, their correlation may be negative because they go against each other!
This isn’t always the case, however, and when it is, then we call this an inverse correlation. We looked at some examples of inverse correlations in our chapter on descriptive statistics.
Regression is also called “linear prediction.” Just like correlation, it predicts whether or not a dependent variable will increase given changes to an independent variable.
The difference comes down to what kind of predictions you make. With correlation, you are predicting whether or not both variables will be equal (zero).

Kriging is an interesting spatial statistical technique that goes beyond simple interpolation. When performing kriging, you not only include values at discrete points but also incorporate information about how close together these points are.
This additional information is referred to as “distance” or “adjacent pair distance” because it accounts for the size of each other point in your dataset. For example, if there were no data available within one mile of a given location, then a normal interpolator would use nearby locations as its estimate, which may be very inaccurate.
By incorporating this adjacent pair distance into our kriging formula, we get more accurate estimates.