This is an interactive visual calculator.
Click here to switch to a Manual Data Entry (X's and Y's) ➚Tap/Click a point to remove it.
Tap anywhere on the plot to add data points (within the range X: -10 to 10, Y: -10 to 10). Tap an existing point to remove it. When ready, tap "Calculate" to see results.
Points: 0
Add points and calculate to see results.
Equation:
Slope (b):
Intercept (a):
| Point | X Value | Y Value | Predicted Y | Residual |
|---|
Pearson's correlation coefficient measures the strength and direction of the linear relationship between two continuous variables, ranging from -1 (perfect negative) to 1 (perfect positive), with 0 indicating no linear relationship.
The regression line describes the relationship as a straight line. The slope (b) shows how much y changes for each one-unit increase in x, and the intercept (a) is the estimated value of y when x = 0. For each point you plot, the tool also calculates the predicted y value and the residual — the difference between the actual and predicted value.
The t-statistic tests whether the observed correlation is likely due to chance, using the formula t = r × √((n-2) / (1 - r²)). A p-value below 0.05 is generally considered statistically significant.
Try plotting points roughly along a rising diagonal, e.g. (-8,-6), (-4,-3), (0,0), (4,3), (8,6). You'll get r close to 1, a near-perfect positive correlation, with a regression line that closely fits all the points and a very small p-value.
x <- c(-8, -4, 0, 4, 8)
y <- c(-6, -3, 0, 3, 6)
cor.test(x, y, method = "pearson")
model <- lm(y ~ x)
summary(model)
Correlation: Analyze → Correlate → Bivariate, add both variables, check Pearson.
Regression: Analyze → Regression → Linear, set y as Dependent and x as Independent.
Correlation: Regression → Correlation Matrix, drag in both variables, check Pearson's r.
Regression: Regression → Linear Regression, set y as Dependent Variable and x as Covariate.