Filter löschen
Filter löschen

Plot best-fit Spearman rank correlation curve

25 Ansichten (letzte 30 Tage)
David
David am 14 Feb. 2019
Beantwortet: Jeff Miller am 12 Dez. 2020
Dear Matlab community,
I'm evaluating one-variable Spearman rank correlation, simply by invoking:
[rho, pval] = corr(x, y, 'type', 'Spearman');
which works all fine. However, I now thought I'd like to plot my points as a scatter plot, overlaid with the rank correlation best-fit that gives the rho and pval from above. I.e:
plot(x,y,'o')
and then a line representing the Spearman rank best-fit. However I seem to fail in understanding how to get this line or equation.
It might be a newbie statistics question, but does anyone know how I could get this line?
Thanks

Antworten (2)

Anwar S
Anwar S am 12 Dez. 2020
Please check the function:
corrplot

Jeff Miller
Jeff Miller am 12 Dez. 2020
Tricky question, because the whole point of the Spearman correlation is that the x/y relationship might be nonlinear. Maybe use loess? You might find the discussion here helpful.

Kategorien

Mehr zu Linear and Nonlinear Regression finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by