필터 지우기
필터 지우기

Plot best-fit Spearman rank correlation curve

조회 수: 25 (최근 30일)
David
David 2019년 2월 14일
답변: Jeff Miller 2020년 12월 12일
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

답변 (2개)

Anwar S
Anwar S 2020년 12월 12일
Please check the function:
corrplot

Jeff Miller
Jeff Miller 2020년 12월 12일
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.

카테고리

Help CenterFile Exchange에서 Linear and Nonlinear Regression에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by