Editverse Free Calculator
Partial Correlation Calculator
Measure the association between two variables after removing the influence of one or more others — the partial correlation coefficient with its p-value — and copy the exact R command behind the result. A full interpretation guide follows below. Validated against R 4.3.3.
In Simple Words
A partial correlation measures how strongly two variables are related once the effect of one or more control variables is held constant. It strips out shared influence from a confounder, revealing whether a relationship survives after that variable is accounted for.
For example, height and reading ability correlate in children — but mostly because both rise with age. Partialling out age usually shrinks that correlation toward zero, showing the original link was largely confounded. Partial correlation makes that adjustment explicit and quantifies what remains.
When to Use Partial Correlation
Use partial correlation when you suspect a third variable is inflating or masking the relationship between two others, and you want the association net of that confounder. It is the correlational analogue of an adjusted coefficient in multiple regression.
Remember that partial correlation controls statistically, not experimentally — it cannot prove causation, and an uncontrolled confounder can still drive the result. Report it with its confidence interval and state exactly which variables were partialled out. For the simple two-variable case with no controls, use our correlation calculator instead. Unsure which fits? Our Test Selector can help.
Expected: 3 columns: Variable X | Variable Y | Control variable Z
Drop a CSV here or click to choose. Parsed in your browser: nothing is uploaded.
Expected: 3 columns: Variable X | Variable Y | Control variable Z
x <- c({x})
y <- c({y})
z <- c({z})
rx <- resid(lm(x ~ z)); ry <- resid(lm(y ~ z))
r <- cor(rx, ry)
t <- r * sqrt((length(x) - 3) / (1 - r^2))
c(partial_r = r, t = t, p = 2 * pt(-abs(t), length(x) - 3))User guide
When to use. Estimate the association between X and Y after removing the linear effect of a third variable Z (a confounder).
Assumptions. Linear relationships; approximately normal variables; Z is measured without error.
Common mistakes. Partial correlation does not prove Z is a confounder or that X causes Y. For several covariates use multiple regression.
Worked example
Click Load example data above, then Run Analysis to see a fully worked result with figure, formula and interpretation for this test.
References
- Kim S. ppcor: an R package for a fast calculation to semi-partial correlation coefficients. Commun Stat Appl Methods. 2015;22(6):665-674.
Worked Examples
Example 1 — Removing a confounder
Two variables correlate at r = 0.60. After partialling out a third variable related to both, the partial correlation drops to 0.18. Most of the original association was carried by the confounder; only a weak direct relationship remains once it is controlled.
Example 2 — A relationship that survives
If the same r = 0.60 falls only to 0.52 after controlling for the third variable, the association is largely independent of that confounder. The relationship is robust to this particular adjustment, though other unmeasured variables could still play a role.
Assumptions to Check
Linear relationships. Partial correlation captures linear association after adjustment. Curved relationships are not represented and may need transformation or a different method.
Continuous, roughly normal variables. The usual partial correlation and its test assume approximately normal, continuous variables; for ranked or non-normal data a rank-based partial correlation is more appropriate.
The right control variables. The result is only as good as the variables you partial out. Omitting a relevant confounder leaves it in the estimate; controlling for a variable on the causal path can remove real effect.
Common Mistakes
Reading partial correlation as proof of causation
Statistical control is not experimental control. A surviving partial correlation is consistent with a direct effect but does not establish one.
Controlling for a mediator
Partialling out a variable that lies on the causal pathway between the two of interest can wrongly erase a genuine effect. Choose control variables on substantive, not automatic, grounds.
Omitting a key confounder
Partial correlation only adjusts for the variables you include. A relationship that looks direct may still be driven by an unmeasured confounder.
Using Pearson-based partial correlation on non-normal data
For skewed or ordinal variables, the normal-theory test is unreliable. Use a rank-based partial correlation instead.
Frequently Asked Questions
How is partial correlation different from ordinary correlation?
Ordinary correlation measures the raw association between two variables; partial correlation measures it after removing the linear influence of one or more control variables.
Can partial correlation prove that a confounder explains a relationship?
It can show the association largely disappears after adjustment, which is suggestive, but it cannot prove causation or rule out other unmeasured confounders.
What is semi-partial (part) correlation?
Semi-partial correlation removes the control variable’s influence from only one of the two variables, whereas partial correlation removes it from both.
Does the result match R and SPSS?
Yes. The calculator uses the standard partial-correlation formula and significance test and shows the R command (ppcor::pcor) so you can reproduce the coefficient and p-value.
Related Calculators
References
- Kim S. P-value calculation methods for semi-partial correlation coefficients. Commun Stat Appl Methods. 2022;29(3):397–402. PMID 35756137.
- Epskamp S, Fried EI. A tutorial on regularized partial correlation networks. Psychol Methods. 2019;23(4):617–634. PMID 29595293.
- Cohen J, Cohen P, West SG, Aiken LS. Applied Multiple Regression/Correlation Analysis for the Behavioral Sciences. 3rd ed. Mahwah, NJ: Erlbaum; 2003.
Need This Analysis Done for Your Manuscript?
Our PhD biostatisticians model adjusted associations — partial correlations and multivariable regression with confidence intervals — and deliver publication-ready tables with reproducible R output.
