Skip to content
All apps

Spray a Point Cloud

About this app

Spray, erase or place points one by one: quadrants show the covariance as signed rectangles, plus r, Spearman, R², two regression lines and examples where r misleads (U shape, outlier, two groups).

Pearson, Spearman and their limits

Pearson’s correlation coefficient r = sₓᵧ / (sₓ · sᵧ) measures the strength of the linear relationship between two variables. It is dimensionless, lies between −1 and +1 and reaches ±1 exactly when all points lie on a straight line; the coefficient of determination is R² = r². A common rule of thumb calls |r| from 0.8 strong and from 0.5 moderate. Spearman’s rank coefficient is the Pearson correlation of the ranks. It captures monotonic relationships and is less sensitive to outliers.

What you see

With the spray, erase and point tools you build your own point cloud; spray radius and density are adjustable. The centroid splits the cloud into four quadrants whose signed rectangles add up to the covariance. You can show the regression lines y(x) and x(y) and a spread ellipse. The values panel lists covariance, Pearson r, Spearman rₛ, R², slope and intercept with a short interpretation. Nine preset clouds range from strong and weak through U shape, two groups and outlier to engine and income data.

Things to try

Load the U shape: r is close to 0 even though the points closely follow a curve. With the outlier preset, the app shows what r would be without that single point, while Spearman stays stable. With two groups, a high r arises purely from the distance between the groups. Stretch or squeeze y about ȳ: the slope changes, r does not. Also watch how the two regression lines spread apart when the correlation is weak.

Frequently asked questions

What does the correlation coefficient r measure?
Pearson’s correlation coefficient measures how strongly two variables are linearly related. Values near +1 mean a rising linear relationship, near −1 a falling one, and values around 0 no linear relationship. Other kinds of dependence, such as a U shape, are not captured by r.
When should you use Spearman instead of Pearson?
Spearman is suitable when the relationship is monotonic but not necessarily linear, when there are outliers, or when only ranks are available. The Spearman coefficient is the Pearson correlation computed on ranks. A single extreme value only occupies one rank and distorts the result less.
Does r = 0 mean there is no relationship?
No, r = 0 only means there is no linear relationship. Points on a symmetric parabola can depend on each other closely and still give r ≈ 0. That is why it is always worth looking at the scatter plot.
What can I try in this app?
You spray, erase or place individual points and see all statistics immediately. Nine preset clouds show typical cases where r misleads. Regression lines, quadrant colours and the spread ellipse can be switched on, and y can be stretched or squeezed about ȳ.

Subject: Probability & statistics

More from Probability & statistics

A VisuApp by heyprof: interactive, free in your browser, no sign-up. What is a VisuApp? · All apps