A scatter plot calculator takes pairs of values and tells you what a scatter plot of them would show: whether the dots rise or fall, how tightly they follow a line, and the equation of the line of best fit. Type your points, one per line, and press the button to get the correlation coefficient, the slope and intercept of the trend line, R² and a prediction for any x. It works in your browser, and the numbers it gives are the ones that you would read from the plot.
How to use the scatter plot calculator
- Type your data, one point per line, as x, y.
- Optionally enter an x value to predict y.
- Press Analyze.
- Read the pattern, the strength, the line and R².
What a scatter plot shows
The Wikipedia article on scatter plots describes it as a type of plot or mathematical diagram using Cartesian coordinates to display values for typically two variables for a set of data.[1] If the pattern of dots slopes from lower left to upper right, it indicates a positive correlation between the variables, and if it slopes from upper left to lower right, it indicates a negative correlation.[1] The page says that correlations may be positive, negative or null, which means uncorrelated.[1] The calculator reads the direction from the sign of the correlation coefficient r, and it calls the pattern flat when r is very close to 0.
The line of best fit
The article says that a line of best fit, also called a trendline, can be drawn to study the relationship between the variables, and that for a straight line the best-fit procedure is known as linear regression.[1] The calculator uses the least-squares line y = mx + b, where the slope is m = Sxy ÷ Sxx and the intercept is b = ȳ − m x̄. Here Sxy is the sum of the products of the deviations from the means, and Sxx is the sum of the squared deviations of x. These are the usual formulas, and the page does not write them out. The correlation coefficient is r = Sxy ÷ √(Sxx × Syy), which is always between −1 and 1, and R² is its square.
A worked example
Take the five points (1, 2), (2, 4), (3, 5), (4, 4) and (5, 5). The mean of x is 3 and the mean of y is 4. The deviations give Sxy = 6, Sxx = 10 and Syy = 6. The slope is 6 ÷ 10 = 0.6, and the intercept is 4 − 0.6 × 3 = 2.2, so the line is y = 0.6x + 2.2. The correlation is 6 ÷ √(10 × 6) ≈ 0.775, which is a strong positive relationship, and R² = 0.6, so the line explains 60 percent of the variation in y. For x = 6, the line predicts y = 5.8. Enter these five points to see these numbers.
How strong is the relationship
A common rule of thumb calls |r| below 0.3 weak, from 0.3 to 0.7 moderate and above 0.7 strong. The calculator uses it for its label. It is a guide and not a rule from the page, and what counts as strong depends on the field. In physics, a correlation of 0.9 may be disappointing. In social science, 0.5 may be remarkable. Always look at the data too, because a few unusual points can change r a lot, and two quite different patterns can have the same r.
Correlation is not causation
A strong correlation shows that two variables move together, not that one causes the other. Ice cream sales and swimming accidents both rise in summer, but one does not cause the other. A third variable, the heat, may affect both. Use the line for describing and predicting within the range of your data, and be careful about predicting far outside of it, where the trend may not continue.
Entering your data
Put each pair on its own line. You can separate x and y with a comma, a space, a tab or a semicolon, so you can copy two columns from a spreadsheet and paste them in. Decimals and negative numbers are fine. At least two points are needed, and the x values must not all be the same. If every y value is the same, the correlation is reported as 0 and the line is flat.
Outliers and clusters
A scatter plot is useful for spotting points that do not fit, called outliers, and groups of points that cluster. The numbers can hide these. If one point lies far from the others, it can pull the line and change r a lot. Try your data with and without a suspicious point, and see how the line changes. If the data form two clusters, the overall r may not describe either of them. In that case, analyze each cluster on its own.
Common mistakes
- Swapping x and y. The line of y on x is not the same as the line of x on y.
- Reading r as a percentage. R², not r, is the share of the variation explained.
- Predicting far outside the data. The trend may not continue.
- Assuming causation. Correlation alone does not show it.
What next
Use this often? Add Scatter Plot to your Home screen.
Frequently asked questions
What is a scatter plot calculator?
A tool that gives the numbers behind a scatter plot of paired data: the direction and strength of the pattern and the equation of the trend line.
How do I read a scatter plot?
If the dots slope from lower left to upper right, the correlation is positive. If they slope from upper left to lower right, it is negative.
What is the line of best fit?
The straight line that comes closest to the points in the least-squares sense. Its slope is Sxy ÷ Sxx.
What does R² mean?
The share of the variation in y that the line explains. R² = 0.6 means 60 percent.
Does a strong correlation prove causation?
No. Two variables can move together because of a third factor, or by chance.
Sources
Was this tool helpful?
What went wrong?
We only receive the reason you pick, never what you typed into the tool.
Thanks for your feedback.