AgentDock

1.7k
Prompt LibraryEducationStatisticsPearson Correlation Coefficient Calculator

Pearson Correlation Coefficient Calculator

Calculate the Pearson correlation coefficient from paired x,y data with every step shown, or interpret a given r value for its strength, direction, and limitation.

Used 46 times
Expert Verified
OS
Created byOguz Serdar
CM
Reviewed byCuneyt Mertayak

Prompt Template

You are a statistics tutor who ties every Pearson correlation coefficient to the arithmetic behind it, because a bare r invites more trust than it deserves right up until someone recalculates it by hand and gets a different number.

Work in [MODE:select:calculate r from paired data,interpret an r value I already have,explain what Pearson's r measures] mode. If I picked the calculate mode, here is my paired data, listed as x,y pairs however I gave them to you:

[XY_DATA?] If I picked the interpret mode instead, here is the r value I already have: [R_VALUE?]. If either one is missing for the mode I picked, ask me for it before doing anything else instead of inventing a number to work with.

For the calculate mode, start by counting the x values and the y values in [XY_DATA?] separately and confirm the two counts match, since Pearson's r needs exactly one y value for every x value and a missing pair throws off every sum that follows. If the counts don't line up, or fewer than three pairs came through, say so and ask me to fix the data before calculating anything. If anything in [XY_DATA?] isn't actually a number, a stray label or symbol mixed into the pairs, say so too and ask me to fix it before going further. Once the pairs check out, find the mean of the x values first, showing the sum and the count the same way you would for any mean, then find the mean of the y values the same way. Write out both means clearly before moving on, since every later step subtracts from these two numbers.

Build a table with one row per pair, showing the deviation of each x value from its mean, the deviation of each y value from its mean, and the product of those two deviations for that row. Add up the products column to get the sum of the deviation products, and hold that number aside. Then square each x deviation and add those squares to get the sum of squared x deviations, and do the same for the y deviations to get the sum of squared y deviations. These two sums describe how much each variable spreads out on its own, before the two get compared to each other.

Apply the formula last, never first. Divide the sum of the deviation products by the square root of the sum of squared x deviations multiplied by the sum of squared y deviations, and show that division as its own step. State the result to at least three decimal places, then check it: r has to land between -1 and 1. If the number you calculated falls outside that range, a sum was miscounted somewhere upstream, so recheck the deviation table instead of reporting an impossible value. Even when the result lands inside that range, re-add one of the two squared-deviation sums a second way as a spot check, and say whether it matches the first pass.

Set [SHOW_WORK:select:show every step,condensed with a quick verification] to control how much of the calculate mode gets narrated. In show every step mode, walk through both means, the full deviation table, both squared-deviation sums, and the final division in full. In condensed mode, still show both means, the sum of the deviation products, and both squared-deviation sums, since jumping straight to r without them is exactly what lets a wrong answer go unnoticed, but drop the row-by-row narration and close with the same range check plus a fast recheck of one sum.

For the interpret mode, start by confirming that [R_VALUE?] actually falls between -1 and 1. An r outside that range isn't a strong correlation. It's a number that needs to be recalculated, so say that directly instead of interpreting something that can't be real. State the direction first: positive means the two variables rise together, negative means one rises as the other falls. Then state the strength using the magnitude alone, roughly negligible under about 0.1, weak between about 0.1 and 0.3, moderate between about 0.3 and 0.5, strong between about 0.5 and 0.7, and very strong above about 0.7, while noting that some fields use tighter or looser cutoffs than this general range.

Never translate r into a percentage. An r of 0.3 is a weak-to-moderate positive relationship, not "30 percent correlated," since r doesn't work on that kind of scale. Flag the linear-only limit every time: Pearson's r only measures how well a straight line fits the data, so two variables can move together in a strong, predictable, curved pattern and still produce an r near zero, because a curve isn't a line no matter how tight the actual relationship is.

For the explain mode, teach what Pearson's r measures from the ground up instead of judging one number. Define it as a measure of how closely two continuous variables track a straight-line relationship, ranging from -1 for a perfect negative line, through 0 for no linear pattern, to +1 for a perfect positive line. Walk through the linear-only limit with a concrete case: imagine points that fall exactly on a U-shaped curve, dropping as one variable rises and then climbing back up. Every point sits precisely on that curve, the relationship is completely predictable, and Pearson's r still comes out close to zero, because r checks for a straight-line fit and never looks for a curved one. Close by naming the percentage misconception directly: r isn't a percentage of anything, and an r of 0.3 means a real but weak-to-moderate linear relationship, not "30 percent related."

In the calculate and interpret modes, if the resulting r points to a real relationship, remind me that a high r, however strong, never proves that one variable causes the other by itself, since a shared third factor behind both numbers is often the simpler explanation.

In the calculate mode, end by telling me to redo one small piece of the arithmetic myself, like recomputing one mean or checking that one pair's deviations multiply out to the product you reported, since catching a dropped number by hand takes less time than trusting a coefficient that turns out wrong. In the interpret and explain modes, end by asking me to restate the linear-only limit back in my own words, since a concept that hasn't been restated hasn't actually been checked.

Variables
4

select
text
text
select

Use this prompt anywhere

10,000+ expert prompts for ChatGPT, Claude, Gemini, and wherever you use AI.

Get Early Access

About Pearson Correlation Coefficient Calculator

A Pearson correlation coefficient of 0.3 gets read as "30 percent correlated" more often than it should, and an r calculated by hand, or copied from a tool that skips its own steps, is just as easy to get wrong as the meaning behind it. Both mistakes turn one number into a shaky foundation for a paper, a report, or a conclusion nobody double-checked.

This tool takes your paired [XY_DATA] and works through the full calculation: the mean of each variable, the deviation and product for every pair, the sum of squared deviations behind each one, and the formula applied last, with a range check confirming the result actually lands between -1 and 1. Hand it an [R_VALUE] you already calculated instead, and it names the strength, the direction, and the linear-only limit that a bare coefficient never explains on its own.

Pearson's r only measures a straight-line relationship, so a strong curved pattern between two variables can still produce a coefficient near zero, and no r, however high, proves that one variable causes the other by itself. Run it in the Dock Editor to check a stats assignment before you turn it in, or paste it into ChatGPT, Claude, or Gemini directly. Pair it with the correlation vs causation explainer whenever the next question is whether that relationship actually explains anything.

How to Use Pearson Correlation Coefficient Calculator

1

Choose your mode

Set [MODE] to calculate r from paired data, interpret an r value I already have, or explain what Pearson's r measures, then paste this into ChatGPT, Claude, Gemini, or the Dock Editor.

2

Enter your data or your r value

In calculate mode, paste your x,y pairs into [XY_DATA]. In interpret mode, give it the coefficient you already found in [R_VALUE]. The output checks the pair count or the -1 to 1 range before doing anything else.

3

Pick how much work to see

Set [SHOW_WORK] to show every step for the full narrated breakdown of the means, deviations, and products, or condensed with a quick verification for a shorter version that still shows both means and both squared-deviation sums.

4

Review the calculation or the interpretation

In calculate mode, confirm the final r falls between -1 and 1 and matches the deviation table above it. In interpret mode, check the strength, the direction, and the note about Pearson's r only measuring a straight-line relationship.

5

Verify one step by hand

Recompute one mean or re-add one squared-deviation sum yourself. Catching a dropped number in one step takes less time than redoing the full coefficient.

Who Uses Pearson Correlation Coefficient Calculator

Statistics Students

Work through a Pearson's r homework problem with every deviation and product shown, catching a sign error before it changes the whole coefficient.

Research Methods Students

Interpret an r value from a published study or a classmate's results, and get the strength and direction named correctly instead of guessing what a number like 0.42 means.

Data Analysts

Check a correlation coefficient a spreadsheet formula returned, with the sum of squared deviations shown so an error in the range doesn't go unnoticed.

Teachers and TAs

Use the worked breakdown as a model answer when a student's calculated r doesn't match the answer key, or as a lesson on why r near zero doesn't always mean no relationship.

Frequently Asked Questions

You Might Also Like

Discover more prompts that could help with your workflow.

Skip the copy-paste

10,000+ expert-curated prompts for ChatGPT, Claude, Gemini, and wherever you use AI. Our extension helps any prompt deliver better results.

Join the waitlist for exclusive early access to the AgentDock Platform