{"id":67009,"date":"2026-10-13T11:35:10","date_gmt":"2026-10-13T08:35:10","guid":{"rendered":"https:\/\/wpcalc.com\/en\/?p=67009"},"modified":"2026-10-13T11:35:10","modified_gmt":"2026-10-13T08:35:10","slug":"partial-correlation-calculator","status":"publish","type":"post","link":"https:\/\/wpcalc.com\/en\/statistics\/partial-correlation-calculator\/","title":{"rendered":"Partial Correlation Calculator"},"content":{"rendered":"<section class=\"not-prose calculator-box\" aria-labelledby=\"calculator-title\"><div class=\"flex items-baseline sm:items-center justify-between gap-2 sm:gap-3\"><div class=\"flex flex-col sm:flex-row sm:items-center gap-2\"><span class=\"icon icon-calculator text-primary-700! text-base! dark:text-primary-300!\" aria-hidden=\"true\"><\/span><h2 id=\"calculator-title\" class=\"text-lg font-display font-bold\">Find the Relationship After Controlling for a Third Variable<\/h2><\/div><div class=\"calcdash-favorite group\">\n  <button type=\"button\" class=\"favorite\" id=\"favorite\" data-favorite-id=\"67009\" data-favorite-title=\"Partial Correlation\" data-favorite-url=\"https:\/\/wpcalc.com\/en\/statistics\/partial-correlation-calculator\/\" data-favorite-excerpt=\"Calculate the partial correlation between two variables while controlling for a third. Enter three paired data columns or three pairwise Pearson correlations, and get the partial correlation coefficient with interpretation.\" aria-label=\"Add to Favorites\" data-favorite-icon=\"icon icon-wpcalc-regression-plot\">\n    <span class=\"icon icon-shape-star-empty\" aria-hidden=\"true\"><\/span>\n  <\/button>\n  <div class=\"calcdash-favorite__tip\" aria-hidden=\"true\">\n   <span class=\"favorite-tooltip\" id=\"favorite-tooltip\"><\/span>\n  <\/div>\n  <span class=\"sr-only\" role=\"status\" id=\"favorite-status\"><\/span>\n<\/div><\/div><form action=\"https:\/\/wpcalc.com\/en\/statistics\/partial-correlation-calculator\/\" method=\"POST\" class=\"calculator\" id=\"calculator-67009\" data-post=\"67009\"><fieldset class=\"fieldset-input is-1\"><legend class=\"sr-only\">Input Fields<\/legend><div class=\"field\" id=\"input-1\"><label for=\"field-1\">Input method<\/label><div class=\"grid grid-cols-1\"><select id=\"field-1\" name=\"input_method\"><option value=\"data\" selected>Three paired data columns<\/option><option value=\"coefficients\">Three pairwise correlations<\/option><\/select><svg class=\"pointer-events-none col-start-1 row-start-1 mr-2 size-5 self-center justify-self-end text-gray-500 sm:size-4\" viewBox=\"0 0 16 16\" fill=\"currentColor\" aria-hidden=\"true\" data-slot=\"icon\">\n              <path fill-rule=\"evenodd\" d=\"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z\" clip-rule=\"evenodd\" \/>\n            <\/svg><\/div><\/div><div class=\"is-single field\" id=\"input-2\"><span class=\"font-semibold\">Paired data<\/span><\/div><div class=\"field\" id=\"input-3\"><label for=\"field-3\">Variable X<\/label><textarea id=\"field-3\" name=\"variable_x\">1; 2; 3; 4; 1; 2; 3; 4<\/textarea><\/div><div class=\"field\" id=\"input-4\"><label for=\"field-4\">Variable Y<\/label><textarea id=\"field-4\" name=\"variable_y\">3; 3; 5; 9; 4; 8; 10; 10<\/textarea><\/div><div class=\"field\" id=\"input-5\"><label for=\"field-5\">Control variable Z<\/label><textarea id=\"field-5\" name=\"control_variable_z\">0; 0; 0; 0; 1; 1; 1; 1<\/textarea><\/div><div class=\"is-single field\" id=\"input-6\"><span class=\"font-semibold\">Pairwise correlations<\/span><\/div><div class=\"field has-term\" id=\"input-7\"><label for=\"field-7\">Correlation of X and Y<\/label><div class=\"term\">rXY<\/div>  <div class=\"absolute bottom-0 left-16 top-8 w-2 h-0.5 bg-blue-500\"><\/div><input type=\"number\" name=\"correlation_of_x_and_y\" id=\"field-7\" min=\"-1\" max=\"1\" step=\"0.01\" value=\"0.7\"\/><\/div><div class=\"field has-term\" id=\"input-8\"><label for=\"field-8\">Correlation of X and Z<\/label><div class=\"term\">rXZ<\/div>  <div class=\"absolute bottom-0 left-16 top-8 w-2 h-0.5 bg-blue-500\"><\/div><input type=\"number\" name=\"correlation_of_x_and_z\" id=\"field-8\" min=\"-1\" max=\"1\" step=\"0.01\" value=\"0.4\"\/><\/div><div class=\"field has-term\" id=\"input-9\"><label for=\"field-9\">Correlation of Y and Z<\/label><div class=\"term\">rYZ<\/div>  <div class=\"absolute bottom-0 left-16 top-8 w-2 h-0.5 bg-blue-500\"><\/div><input type=\"number\" name=\"correlation_of_y_and_z\" id=\"field-9\" min=\"-1\" max=\"1\" step=\"0.01\" value=\"0.3\"\/><\/div><\/fieldset><div class=\"buttons\"><button type=\"submit\" data-text=\"Re-Calculate\" id=\"calculate-button\" data-post=\"67009\">Calculate<\/button><button type=\"reset\">Reset<\/button><\/div><div class=\"field is-checkbox hidden!\" id=\"field-auto-calc\"><input type=\"checkbox\" id=\"auto-calc\"><label for=\"auto-calc\">Calculate automatically<\/label><small>If enabled, the result will update automatically when you change any value.<\/small><\/div><div class=\"fieldset-result is-hidden\" aria-labelledby=\"result-title\" aria-live=\"polite\" role=\"region\"> <h3 class=\"result-title bg-gradient-to-r from-primary-50 to-gray-50 dark:from-primary-900 dark:to-gray-800\" id=\"result-title\"><span class=\"icon icon-s-pulse\" aria-hidden=\"true\"><\/span> Partial Correlation Results<\/h3><div class=\"result-box\"><div class=\"field-result\" id=\"output-1\"><span class=\"field-title\"><span>Partial correlation of X and Y, controlling for Z<\/span><span class=\"result-term\">rXY\u00b7Z<\/span><\/span><span class=\"field-value\" id=\"result-1\"><\/span><button type=\"button\" class=\"copy-result\" data-tooltip=\"Copy Result\" aria-label=\"Copy Result\"><span class=\"copy-icon icon icon-document-copy\" aria-hidden=\"true\"><\/span><\/button><\/div><div class=\"field-result\" id=\"output-2\"><span class=\"field-title\"><span>Correlation of X and Y<\/span><span class=\"result-term\">rXY<\/span><\/span><span class=\"field-value\" id=\"result-2\"><\/span><button type=\"button\" class=\"copy-result\" data-tooltip=\"Copy Result\" aria-label=\"Copy Result\"><span class=\"copy-icon icon icon-document-copy\" aria-hidden=\"true\"><\/span><\/button><\/div><div class=\"field-result\" id=\"output-3\"><span class=\"field-title\"><span>Correlation of X and Z<\/span><span class=\"result-term\">rXZ<\/span><\/span><span class=\"field-value\" id=\"result-3\"><\/span><button type=\"button\" class=\"copy-result\" data-tooltip=\"Copy Result\" aria-label=\"Copy Result\"><span class=\"copy-icon icon icon-document-copy\" aria-hidden=\"true\"><\/span><\/button><\/div><div class=\"field-result\" id=\"output-4\"><span class=\"field-title\"><span>Correlation of Y and Z<\/span><span class=\"result-term\">rYZ<\/span><\/span><span class=\"field-value\" id=\"result-4\"><\/span><button type=\"button\" class=\"copy-result\" data-tooltip=\"Copy Result\" aria-label=\"Copy Result\"><span class=\"copy-icon icon icon-document-copy\" aria-hidden=\"true\"><\/span><\/button><\/div><div class=\"field-result\" id=\"output-5\"><span class=\"field-title\"><span>Paired observations<\/span><span class=\"result-term\">n<\/span><\/span><span class=\"field-value\" id=\"result-5\"><\/span><button type=\"button\" class=\"copy-result\" data-tooltip=\"Copy Result\" aria-label=\"Copy Result\"><span class=\"copy-icon icon icon-document-copy\" aria-hidden=\"true\"><\/span><\/button><\/div><div class=\"field-result is-column\" id=\"output-6\"><span class=\"field-title\"><span>Interpretation<\/span><\/span><span class=\"field-value\" id=\"result-6\"><\/span><button type=\"button\" class=\"copy-result\" data-tooltip=\"Copy Result\" aria-label=\"Copy Result\"><span class=\"copy-icon icon icon-document-copy\" aria-hidden=\"true\"><\/span><\/button><\/div><\/div><div class=\"result-actions\"><button type=\"button\" class=\"copy-link\"><svg viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M12.232 4.232a2.5 2.5 0 0 1 3.536 3.536l-1.225 1.224a.75.75 0 0 0 1.061 1.06l1.224-1.224a4 4 0 0 0-5.656-5.656l-3 3a4 4 0 0 0 .225 5.865.75.75 0 0 0 .977-1.138 2.5 2.5 0 0 1-.142-3.667l3-3Z\"\/><path d=\"M11.603 7.963a.75.75 0 0 0-.977 1.138 2.5 2.5 0 0 1 .142 3.667l-3 3a2.5 2.5 0 0 1-3.536-3.536l1.225-1.224a.75.75 0 0 0-1.061-1.06l-1.224 1.224a4 4 0 1 0 5.656 5.656l3-3a4 4 0 0 0-.225-5.865Z\"\/><\/svg><span class=\"copy-link__text\">Copy link to this calculation<\/span><\/button><span class=\"sr-only\" role=\"status\" id=\"copy-link-status\"><\/span><\/div><\/div><a href=\"#respond\" class=\"hidden transition-opacity duration-300 opacity-0 w-50 text-sm justify-center items-center gap-2 px-4 py-2 rounded bg-gray-200 text-gray-700 hover:bg-gray-300\" id=\"leave-comment\"><span class=\"icon icon-comments\" aria-hidden=\"true\"><\/span>Leave a Comment<\/a><\/form><\/section><section id=\"calc-reactions\" class=\"not-prose hidden my-12 bg-gradient-to-r from-primary-50 to-gray-50 border border-indigo-100 rounded-xl px-6 py-4 shadow-sm\" data-post=\"67009\" aria-live=\"polite\" aria-labelledby=\"calc-reactions-title\"><p id=\"calc-reactions-title\" class=\"text-sm text-gray-500 text-center mb-2\">How did this result make you feel?<\/p><div role=\"group\" aria-labelledby=\"calc-reactions-title\" class=\"grid grid-cols-3 sm:flex sm:flex-row sm:justify-around gap-4 sm:items-center sm:flex-wrap\"><button type=\"button\" aria-pressed=\"false\" class=\"reaction-btn flex flex-col items-center gap-1 text-sm text-gray-700 hover:text-primary-600 cursor-pointer transition-transform hover:scale-105\" data-reaction=\"like\"><span class=\"reaction-count\" data-reaction-count=\"like\">0<\/span><span class=\"reaction text-3xl\" aria-hidden=\"true\">\ud83d\ude00 <\/span><span class=\"reaction-description font-medium\">Like <\/span><\/button><button type=\"button\" aria-pressed=\"false\" class=\"reaction-btn flex flex-col items-center gap-1 text-sm text-gray-700 hover:text-primary-600 cursor-pointer transition-transform hover:scale-105\" data-reaction=\"helpful\"><span class=\"reaction-count\" data-reaction-count=\"helpful\">0<\/span><span class=\"reaction text-3xl\" aria-hidden=\"true\">\ud83d\udca1 <\/span><span class=\"reaction-description font-medium\">Helpful <\/span><\/button><button type=\"button\" aria-pressed=\"false\" class=\"reaction-btn flex flex-col items-center gap-1 text-sm text-gray-700 hover:text-primary-600 cursor-pointer transition-transform hover:scale-105\" data-reaction=\"confused\"><span class=\"reaction-count\" data-reaction-count=\"confused\">0<\/span><span class=\"reaction text-3xl\" aria-hidden=\"true\">\ud83d\ude15 <\/span><span class=\"reaction-description font-medium\">Confused <\/span><\/button><button type=\"button\" aria-pressed=\"false\" class=\"reaction-btn flex flex-col items-center gap-1 text-sm text-gray-700 hover:text-primary-600 cursor-pointer transition-transform hover:scale-105\" data-reaction=\"disappointed\"><span class=\"reaction-count\" data-reaction-count=\"disappointed\">0<\/span><span class=\"reaction text-3xl\" aria-hidden=\"true\">\ud83d\ude1e <\/span><span class=\"reaction-description font-medium\">Disappointed <\/span><\/button><button type=\"button\" aria-pressed=\"false\" class=\"reaction-btn flex flex-col items-center gap-1 text-sm text-gray-700 hover:text-primary-600 cursor-pointer transition-transform hover:scale-105\" data-reaction=\"inaccurate\"><span class=\"reaction-count\" data-reaction-count=\"inaccurate\">0<\/span><span class=\"reaction text-3xl\" aria-hidden=\"true\">\u274c <\/span><span class=\"reaction-description font-medium\">Inaccurate <\/span><\/button><\/div><div id=\"reaction-message\" class=\"hidden mt-8 rounded-md border border-primary-100 bg-white\/50 backdrop-blur-sm px-4 py-2 text-sm text-center shadow-sm\"><\/div><\/section><div class=\"calcdash-ad not-prose calcdash-ad--calc_result calcdash-ad--in-article\"><ins class=\"adsbygoogle\" style=\"display:block\" data-ad-client=\"ca-pub-1721569815777345\" data-ad-slot=\"6317458308\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\"><\/ins><script>(adsbygoogle = window.adsbygoogle || []).push({});<\/script><\/div>\n<style id=\"wpcoderpro-inline-1\">.formula-box {\r\n\tborder-bottom: none !important;\r\n}<\/style><section class=\"formula-box\" aria-labelledby=\"formula-title\">\r\n\t<div id=\"formula-title\" class=\"not-prose font-display mb-4\"><span class=\"icon icon-formula\" aria-hidden=\"true\"><\/span><h2>Partial Correlation Formula<\/h2><\/div>\r\n\t<figure class=\"not-prose formula\">\r\n\t\t<figcaption class=\"formula-title\">Formula<\/figcaption>\r\n\t\t<div class=\"text-base text-gray-800\" id=\"formula\">\n\\[ r_{XY \\cdot Z} = \\frac{r_{XY} - r_{XZ}\\, r_{YZ}}{\\sqrt{\\left(1 - r_{XZ}^{2}\\right)\\left(1 - r_{YZ}^{2}\\right)}} \\]<\/div>\r\n\t<\/figure>\r\n\t<\/p>\n<p><strong>Where:<\/strong><\/p>\n<ul>\n<li>\\(r_{XY \\cdot Z}\\) \u2014 partial correlation of X and Y, controlling for Z<\/li>\n<li>\\(r_{XY}\\) \u2014 Pearson correlation between X and Y<\/li>\n<li>\\(r_{XZ}\\) \u2014 Pearson correlation between X and Z<\/li>\n<li>\\(r_{YZ}\\) \u2014 Pearson correlation between Y and Z<\/li>\n<\/ul>\n<p>The formula removes the part of the X\u2013Y relationship that is explained by their separate linear associations with Z. The result lies between \u22121 and 1, just like an ordinary correlation coefficient.<\/p>\n<p>\r\n<\/section>\n<style id=\"wpcoderpro-inline-459\">.calculation-box {\r\n\tborder-bottom: none !important;\r\n}<\/style><section id=\"calculation\" class=\"calculation-box\" aria-labelledby=\"calculation-title\">\r\n\t<div id=\"calculation-title\" class=\"not-prose font-display\"><span class=\"icon icon-unordered-list\" aria-hidden=\"true\"><\/span><h2>Partial Correlation \u2013 Calculation Example<\/h2><\/div>\r\n\r\n<\/p>\n<p><strong>Example:<\/strong> eight observations with X = 1; 2; 3; 4; 1; 2; 3; 4, Y = 3; 3; 5; 9; 4; 8; 10; 10 and a binary control variable Z = 0; 0; 0; 0; 1; 1; 1; 1 (the calculator's default values).<\/p>\n<p>First compute the three pairwise Pearson correlations:<\/p>\n<p>\\[ r_{XY} = 0.7785, \\qquad r_{XZ} = 0.0000, \\qquad r_{YZ} = 0.5222 \\]<\/p>\n<p>Then apply the partial correlation formula:<\/p>\n<p>\\[ r_{XY \\cdot Z} = \\frac{0.7785 - (0)(0.5222)}{\\sqrt{(1 - 0^{2})(1 - 0.5222^{2})}} = \\frac{0.7785}{0.8528} \\approx 0.9129 \\]<\/p>\n<p><strong>Result:<\/strong> the partial correlation is approximately <strong>0.9129<\/strong>. Controlling for Z strengthens the X\u2013Y association from 0.78 to 0.91, because Z is related to Y but not to X in this dataset.<\/p>\n<p>\n\r\n<\/section>\n<h2>How to Use the Calculator<\/h2>\n<ol>\n<li>Choose the <strong>Input method<\/strong>: \u201cThree paired data columns\u201d if you have raw measurements, or \u201cThree pairwise correlations\u201d if you already know the three Pearson coefficients.<\/li>\n<li>With raw data, paste the values into <strong>Variable X<\/strong>, <strong>Variable Y<\/strong> and <strong>Control variable Z<\/strong>. Separate values with spaces, semicolons or new lines; decimal commas are accepted. Keep all three columns in the same observation order and of equal length (4 to 2,000 values).<\/li>\n<li>With coefficients, enter <strong>Correlation of X and Y<\/strong>, <strong>Correlation of X and Z<\/strong> and <strong>Correlation of Y and Z<\/strong>, each between \u22121 and 1.<\/li>\n<li>Read the result: the partial correlation of X and Y controlling for Z, the three pairwise correlations, the number of paired observations (data mode), and a plain-language interpretation.<\/li>\n<\/ol>\n<h2>What Is Partial Correlation?<\/h2>\n<p>A partial correlation measures the strength of the linear relationship between two variables after removing the influence of one or more control variables. In the one-control-variable case handled by this calculator, it answers the question: <em>how strongly are X and Y related once the variation each of them shares with Z has been factored out?<\/em><\/p>\n<p>This matters because an ordinary correlation can be misleading. Two variables may appear correlated simply because both are driven by a third variable \u2014 a classic confounding situation. For example, ice cream sales and drowning incidents correlate over the year, but both are driven by temperature. Partial correlation helps you see whether a direct association remains after accounting for the shared cause.<\/p>\n<p>The result is interpreted like any correlation coefficient: values near +1 or \u22121 indicate a strong positive or negative linear association, values near 0 indicate little or no association. A partial correlation can be larger or smaller in magnitude than the raw correlation. It becomes larger when Z masks part of the true relationship (as in the example above), and smaller when the raw correlation was mostly an artifact of Z.<\/p>\n<p>Note that partial correlation, like any correlation, measures <em>association<\/em>, not causation. Removing Z's linear influence reduces one possible source of spurious association, but it cannot establish the direction of causality or rule out other confounders. For modelling several predictors jointly, the <a href=\"https:\/\/wpcalc.com\/en\/statistics\/multiple-linear-regression-calculator\/\">multiple linear regression calculator<\/a> is a natural next step.<\/p>\n<h2>Assumptions, Limitations and Tips<\/h2>\n<ul>\n<li><strong>Linearity.<\/strong> The formula is based on Pearson correlation, so it captures only linear relationships. If associations are monotonic but curved, consider rank-based measures such as the <a href=\"https:\/\/wpcalc.com\/en\/statistics\/spearman-rank-correlation-calculator\/\">Spearman rank correlation<\/a>.<\/li>\n<li><strong>One control variable.<\/strong> This calculator controls for a single variable Z. With several controls, the same idea generalizes via the precision (inverse correlation) matrix, but the arithmetic becomes matrix-based.<\/li>\n<li><strong>Consistent coefficients.<\/strong> In coefficient mode, the three correlations must be mutually compatible \u2014 the calculator rejects combinations that cannot form a valid correlation matrix.<\/li>\n<li><strong>Undefined cases.<\/strong> The result is undefined when X or Y is perfectly (or nearly perfectly) correlated with Z, because the denominator approaches zero.<\/li>\n<li><strong>Sample size.<\/strong> Small samples produce unstable estimates. With few observations, a partial correlation of moderate size can easily arise by chance; a <a href=\"https:\/\/wpcalc.com\/en\/statistics\/statistical-power-calculator\/\">statistical power<\/a> check helps you judge whether your sample can detect the effect you expect.<\/li>\n<li><strong>Complete pairs.<\/strong> Each row must contain a value for X, Y and Z. Missing values in one column break the pairing, so clean your data first.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Calculate the partial correlation between two variables while controlling for a third. Enter three paired data columns or three pairwise Pearson correlations, and get the partial correlation coefficient with interpretation.<\/p>\n","protected":false},"author":3168,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[74],"tags":[78],"class_list":["post-67009","post","type-post","status-publish","format-standard","hentry","category-statistics","tag-correlation-regression"],"acf":[],"_links":{"self":[{"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/posts\/67009","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/users\/3168"}],"replies":[{"embeddable":true,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/comments?post=67009"}],"version-history":[{"count":2,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/posts\/67009\/revisions"}],"predecessor-version":[{"id":67048,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/posts\/67009\/revisions\/67048"}],"wp:attachment":[{"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/media?parent=67009"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/categories?post=67009"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/tags?post=67009"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}