What Is a Partial Correlation? Definition and Examples

Two measurements can rise and fall together simply because something else drives both of them. A partial correlation is a way of asking how strongly two things are linked once that shared influence is taken out of the picture.1Wikipedia. Partial correlation It can make a link shrink, vanish, or even show up more clearly than before, which is why researchers often trust it more than a plain correlation when other factors are in play.

What Partial Correlation Measures

A partial correlation gives both the strength and the direction of a straight-line relationship between two measured quantities.2Laerd Statistics. Partial Correlation using SPSS Statistics It does this while holding steady one or more other quantities, called control variables.2Laerd Statistics. Partial Correlation using SPSS Statistics The aim is to see the link between the two things after the effect of the others has been removed.1Wikipedia. Partial correlation Like an ordinary correlation, it runs from -1 to +1, and 0 means no straight-line link once the control variables are accounted for.

Take the classic example of ice cream sales and drownings. Both rise in summer, so their plain correlation looks strong. Hot weather drives both: more people swim, and more people buy ice cream. Hold temperature steady and the partial correlation drops near zero, so the link was carried by the weather.

That is the problem with a plain correlation. When two measurements are both tied to a third factor, the raw number mixes their own link with that shared tie.3PubMed Central. Partial correlation coefficient for a study with repeated measurements In Parkinson’s disease, for instance, thinking skills and verbal learning both track how far the disease has progressed, so their link is clearer once progression is controlled.3PubMed Central. Partial correlation coefficient for a study with repeated measurements

Nobody actually fixes the temperature in this kind of analysis. The adjustment is done mathematically on data that were already collected. It resembles comparing only days with the same temperature, except that all the data are used at once. The result answers a specific question: among cases alike on the control variable, do the two things still move together? Controlling for a variable can go three ways: the link may shrink or disappear, stay about the same, or grow or even flip sign, which suggests the third factor was hiding it.

A result is always stated with its controls attached: “the correlation between X and Y, controlling for Z, is 0.30.” Without the controls the number is almost meaningless, because a different set of controls gives a different value. The sign keeps its usual meaning. Positive means that, among cases alike on the controls, higher X goes with higher Y, and negative means higher X goes with lower Y. Size is judged as it is for an ordinary correlation: values near 1 or -1 mean the points hug a straight line tightly, and values near 0 mean little straight-line pattern.

You can also hold several factors steady together, such as age, income and education. The result is then the link between X and Y among people alike on all of them.

A Worked Example With Numbers

When only one factor is being controlled, the partial correlation can be built from the three plain correlations among the three variables.4NIST. PARTIAL RANK CORRELATION The formula subtracts the part of the X–Y link explained by each one’s link with Z, then rescales: r_XY.Z = (r_XY − r_XZ·r_YZ) / √((1 − r_XZ²)(1 − r_YZ²)).4NIST. PARTIAL RANK CORRELATION

Try made-up numbers. Suppose study hours and grades correlate at 0.6, and both correlate 0.5 with sleep. The top of the formula becomes 0.6 − 0.25 = 0.35. The bottom becomes √(0.75 × 0.75) = 0.75. The partial correlation is about 0.47, weaker than 0.6 but still real. So part of the study–grade link ran through sleep, though not all of it.

The pieces of the formula each have a job. The top starts with the plain X–Y correlation and subtracts r_XZ times r_YZ, the amount of link you would expect X and Y to have just from both being tied to Z. The bottom rescales the result. Each factor, 1 minus a squared correlation, measures how much of that variable’s spread is left after Z is accounted for, so the final number lands back between -1 and +1. If Z is unrelated to X or to Y, the product on top is near zero and the bottom is near 1, so the partial correlation is almost identical to the plain one. Controlling for an irrelevant variable changes very little.

To read a result, compare it to the plain correlation, not just to zero. A big drop points to the control variable as a shared driver.

Statistics tools have ready-made functions. In Python’s pingouin library, partial_corr takes the two variables and the one to control.5Machine Learning Plus. Partial Correlation It returns the partial correlation along with a p-value and a confidence interval. The control has to be an actual measurement, a column in the table next to the other two. Running the plain and partial correlations side by side on the same data is a quick way to see how much the control mattered.

In one tutorial example, the partial correlation after removing the control variable was about 0.91, a strong positive link.5Machine Learning Plus. Partial Correlation A high partial correlation still says nothing about why the two move together. It only says the straight-line pattern remains once that one factor is held steady.

How Partial Correlation Is Calculated

A simple way to compute it is to run two prediction equations and correlate what each leaves unexplained.1Wikipedia. Partial correlation First, predict X from the control variables. The gap between actual and predicted X is called the residual.6academicweb.nd.edu. What Is a Partial Correlation? Definition and Examples Then predict Y from the same control variables, without X, and keep its residual too.6academicweb.nd.edu. What Is a Partial Correlation? Definition and Examples The partial correlation is the plain correlation between those two residuals.6academicweb.nd.edu. What Is a Partial Correlation? Definition and Examples

A residual is the part of a score the control variable couldn’t predict. Positive residuals mean a case scored higher than its controls predicted, and negative ones mean lower. Correlating the residuals asks whether cases that beat the prediction on X also tend to beat it on Y, which compares people as if they were equal on the control.

With one control, this method and the short formula from the worked example give the same answer. The formula is a shortcut, while the leftovers method extends to many controls.

When there are many variables, all the partial correlations can be read off a single table derived from the data’s covariance.7PubMed Central. Back to the basics: Rethinking partial correlation network methodology Each pair’s partial correlation then controls for every other variable in the set at once.8Bioinformatics. GeneNetTools: tests for Gaussian graphical models with shrinkage Software inverts the covariance table in one step, then rescales each entry and flips its sign to get a partial correlation. That saves running separate leftover calculations for every pair.

Partial Versus Semi-Partial Correlation

Some authors use semi-partial and partial correlation to mean the same thing, but others draw a clear line.9Statistics How To. Partial Correlation & Semi-Partial: Definition & Example – Statistics How To In a semi-partial correlation, the control variables are removed from X but not from Y.6academicweb.nd.edu. What Is a Partial Correlation? Definition and Examples It correlates X’s residual with the original Y, rather than with Y’s residual.6academicweb.nd.edu. What Is a Partial Correlation? Definition and Examples In partial correlation, the controls are removed from both, as described in the previous section.6academicweb.nd.edu. What Is a Partial Correlation? Definition and Examples

Suppose X is hours studied, Y is exam score, and Z is prior knowledge. Partial correlation strips prior knowledge from both study hours and exam score before comparing them. Semi-partial correlation strips it only from study hours, then compares what is left of study hours with the raw exam score, which still contains the effect of prior knowledge. So the semi-partial answer is framed in terms of the whole spread of exam scores, while the partial answer covers only the spread that prior knowledge did not account for.

The two answer different questions. Partial asks whether X and Y are linked among cases equal on the controls. Semi-partial asks how much X uniquely adds to explaining Y overall. For the same data, the semi-partial is never larger in size than the partial, as long as the controls explain some of Y.

That makes semi-partial common when judging a predictor’s unique contribution in regression. There, the squared semi-partial correlation for a predictor tells you how much the share of Y’s variation explained by the model would drop if that predictor were removed. It fits the question “what does this predictor add that the others do not?”, while partial correlation speaks about a subgroup of cases alike on the controls. Because authors and software label them differently, check which residuals were used.

Where Partial Correlation Is Used

A common use is a network map where each variable is a point and each line is a partial correlation.8Bioinformatics. GeneNetTools: tests for Gaussian graphical models with shrinkage A missing line means two variables show no straight-line link once all the others are accounted for.8Bioinformatics. GeneNetTools: tests for Gaussian graphical models with shrinkage Using partial rather than plain correlation gives simpler maps that are easier to interpret.10PubMed Central. Learning Gaussian graphical models from correlated data If A drives B and B drives C, A and C correlate without a direct tie, and partial correlation removes that indirect line.

Thickness or color usually shows strength and sign. A missing line only means no straight-line direct link was detected with the data at hand, and a small sample can hide real ones.

These maps are often used as a first exploratory look at complex data.11PubMed. The Gaussian Graphical Model in Cross-Sectional and Time-Series Data They give researchers hypotheses about which variables to examine more closely, such as which symptom might connect two others. In psychology, network maps link symptoms or traits that remain associated after conditioning on all the others.12Nature Reviews Methods Primers. Network analysis of multivariate data in psychological science Lines do not show direction, so the map cannot say whether one variable influences the other. More targeted studies are needed for that.

In brain scans, partial correlation estimates how two brain regions relate after removing the influence of other regions.13PubMed Central. Estimation of functional connectivity in fMRI data using stability selection-based sparse partial correlation with elastic net penalty It comes closer than plain correlation to showing which regions directly interact.14PubMed. Partial correlation for functional brain interactivity investigation in functional MRI Two regions can rise and fall together because both are linked to a third region, which a plain correlation would show as a connection.

In genetics, it helps build networks of genes, proteins, and metabolites that capture direct links.15PubMed Central. Biological network inference using low order partial correlation In lung tissue from people with and without COPD, it picked out gene pairs that were co-expressed, and these were confirmed in independent samples.16PubMed Central. Partial correlation network analysis identifies coordinated gene expression within a regional cluster of COPD genome-wide association signals

In time-series forecasting, a version called the partial autocorrelation function helps choose how many past values a model should use.17Wikipedia. Partial autocorrelation function It asks how today relates to a past day, controlling for the days in between.

Variations for Ranked or Unusual Data

A rank version uses the order of values instead of the values themselves, applying the same one-control formula to Spearman rank correlations.4NIST. PARTIAL RANK CORRELATION Each variable is first replaced by ranks, with the lowest value as 1, the next as 2, and so on. Because only order matters, one extreme value has no more pull than the next value up. The method captures steady upward or downward trends even when they are curved, as long as the trend always goes in one direction. Rank-based definitions also work for any data that can be put in order, not just measurements.18PubMed Central. Covariate-Adjusted Spearman’s Rank Correlation with Probability-Scale Residuals

Robust versions resist distortion from a few extreme values.19Journal of Nonparametric Statistics. A robust partial correlation measure They limit the influence of unusual observations so the result reflects the bulk of the data.

Kernel partial correlation can detect curved, non-straight-line links after controlling for other variables.20Journal of Machine Learning Research. Kernel Partial Correlation Coefficient — a Measure of Conditional Dependence Such methods are more complex to run and interpret.

For choosing, use the standard version when relationships look roughly straight and the data lack extreme points. Use the rank version for survey ratings or skewed data like income. Consider a curve-capable method when a scatterplot clearly bends.

Limits and Common Mistakes

A link that survives control can still come from a factor no one measured. Controlling the wrong variable, such as one caused by both of the others, can even create a false link. Controls should be chosen for a reason, not just because they’re available.

The standard version detects only straight-line links. A U-shaped relationship can show a partial correlation near zero, so plotting the data before trusting the number is wise.

Errors in measuring the two main variables shrink the partial correlation even more than they shrink a plain correlation.21PubMed. Measurement error and its impact on partial correlation and multiple linear regression analyses When the control variables are also measured with error, the partial correlation can be pushed either up or down.21PubMed. Measurement error and its impact on partial correlation and multiple linear regression analyses A poorly measured control may fail to remove its influence fully, so part of the true factor’s influence stays in X and Y and the leftover link looks stronger than it should.

Like any estimate from a sample, a partial correlation comes with uncertainty, which researchers often express with Fisher’s z-based confidence intervals.7PubMed Central. Back to the basics: Rethinking partial correlation network methodology A partial correlation of 0.30 with an interval from 0.05 to 0.52 is much less certain than one with an interval from 0.25 to 0.35. Small samples give wide intervals, and each control variable added uses up some of the information in the data, so the estimate becomes less precise. When many partial correlations are tested at once, methods exist to keep the overall error rate in check.22Biometrika. Model selection for Gaussian concentration graphs