Is Spearman correlation never greater than Pearson correlation?
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
2
down vote
favorite
If Spearman correlation is Pearson correlation, but on ranks of the data - does it mean that absolute Spearman will always be lower or equal to absolute Pearson correlation, but never greater? Is it possible to have variables that show greater absolute Spearman than absolute Pearson?
Example:
# Spearman == Pearson
# We're correlating ranked variables from the beginning
foo <- 1:1e3
bar <- 1:1e3
sapply(c("pearson", "spearman"), function(x) abs(cor(foo, bar, method = x)))
# Spearman < Pearson
foo <- rnorm(1e3)
bar <- rnorm(1e3)
sapply(c("pearson", "spearman"), function(x) abs(cor(foo, bar, method = x)))
correlation pearson-r spearman-rho
add a comment |Â
up vote
2
down vote
favorite
If Spearman correlation is Pearson correlation, but on ranks of the data - does it mean that absolute Spearman will always be lower or equal to absolute Pearson correlation, but never greater? Is it possible to have variables that show greater absolute Spearman than absolute Pearson?
Example:
# Spearman == Pearson
# We're correlating ranked variables from the beginning
foo <- 1:1e3
bar <- 1:1e3
sapply(c("pearson", "spearman"), function(x) abs(cor(foo, bar, method = x)))
# Spearman < Pearson
foo <- rnorm(1e3)
bar <- rnorm(1e3)
sapply(c("pearson", "spearman"), function(x) abs(cor(foo, bar, method = x)))
correlation pearson-r spearman-rho
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
If Spearman correlation is Pearson correlation, but on ranks of the data - does it mean that absolute Spearman will always be lower or equal to absolute Pearson correlation, but never greater? Is it possible to have variables that show greater absolute Spearman than absolute Pearson?
Example:
# Spearman == Pearson
# We're correlating ranked variables from the beginning
foo <- 1:1e3
bar <- 1:1e3
sapply(c("pearson", "spearman"), function(x) abs(cor(foo, bar, method = x)))
# Spearman < Pearson
foo <- rnorm(1e3)
bar <- rnorm(1e3)
sapply(c("pearson", "spearman"), function(x) abs(cor(foo, bar, method = x)))
correlation pearson-r spearman-rho
If Spearman correlation is Pearson correlation, but on ranks of the data - does it mean that absolute Spearman will always be lower or equal to absolute Pearson correlation, but never greater? Is it possible to have variables that show greater absolute Spearman than absolute Pearson?
Example:
# Spearman == Pearson
# We're correlating ranked variables from the beginning
foo <- 1:1e3
bar <- 1:1e3
sapply(c("pearson", "spearman"), function(x) abs(cor(foo, bar, method = x)))
# Spearman < Pearson
foo <- rnorm(1e3)
bar <- rnorm(1e3)
sapply(c("pearson", "spearman"), function(x) abs(cor(foo, bar, method = x)))
correlation pearson-r spearman-rho
correlation pearson-r spearman-rho
asked 2 days ago
PoGibas
6118
6118
add a comment |Â
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
10
down vote
accepted
Simple example in which Spearman correlation is greater than Pearson correlation:
x = 1:10; y = x^2
cor(x,y, meth = "p")
[1] 0.9745586
cor(x,y, meth = "s")
[1] 1
You're saying - non linear will give greater correlation in Spearman?
â PoGibas
yesterday
3
Yes, as long as the nonlinear function $y = f(x)$ is increasing. (Or, if you're interested in absolute values, decreasing also works.) Spearman only looks at the ranks (relative orders).
â BruceET
yesterday
add a comment |Â
up vote
2
down vote
Using your own example we can see there is no particular bias for two independent normal distributions:
library(tidyverse)
d <- data_frame(
x = replicate(1e4, rnorm(1e3), FALSE),
y = replicate(1e4, rnorm(1e3), FALSE),
pearson = map2_dbl(x, y, cor, method = 'pearson'),
spearman = map2_dbl(x, y, cor, method = 'spearman'),
p_min_s = pearson - spearman
)
qplot(d$p_min_s, xlab = c('pearson - spearman'))
add a comment |Â
up vote
1
down vote
Several Pearson & Spearman correlation values are compared here.
New contributor
We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.
This link may perish at some point, which would make this answer less than useful.
â Axeman
yesterday
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
10
down vote
accepted
Simple example in which Spearman correlation is greater than Pearson correlation:
x = 1:10; y = x^2
cor(x,y, meth = "p")
[1] 0.9745586
cor(x,y, meth = "s")
[1] 1
You're saying - non linear will give greater correlation in Spearman?
â PoGibas
yesterday
3
Yes, as long as the nonlinear function $y = f(x)$ is increasing. (Or, if you're interested in absolute values, decreasing also works.) Spearman only looks at the ranks (relative orders).
â BruceET
yesterday
add a comment |Â
up vote
10
down vote
accepted
Simple example in which Spearman correlation is greater than Pearson correlation:
x = 1:10; y = x^2
cor(x,y, meth = "p")
[1] 0.9745586
cor(x,y, meth = "s")
[1] 1
You're saying - non linear will give greater correlation in Spearman?
â PoGibas
yesterday
3
Yes, as long as the nonlinear function $y = f(x)$ is increasing. (Or, if you're interested in absolute values, decreasing also works.) Spearman only looks at the ranks (relative orders).
â BruceET
yesterday
add a comment |Â
up vote
10
down vote
accepted
up vote
10
down vote
accepted
Simple example in which Spearman correlation is greater than Pearson correlation:
x = 1:10; y = x^2
cor(x,y, meth = "p")
[1] 0.9745586
cor(x,y, meth = "s")
[1] 1
Simple example in which Spearman correlation is greater than Pearson correlation:
x = 1:10; y = x^2
cor(x,y, meth = "p")
[1] 0.9745586
cor(x,y, meth = "s")
[1] 1
answered yesterday
BruceET
2,940418
2,940418
You're saying - non linear will give greater correlation in Spearman?
â PoGibas
yesterday
3
Yes, as long as the nonlinear function $y = f(x)$ is increasing. (Or, if you're interested in absolute values, decreasing also works.) Spearman only looks at the ranks (relative orders).
â BruceET
yesterday
add a comment |Â
You're saying - non linear will give greater correlation in Spearman?
â PoGibas
yesterday
3
Yes, as long as the nonlinear function $y = f(x)$ is increasing. (Or, if you're interested in absolute values, decreasing also works.) Spearman only looks at the ranks (relative orders).
â BruceET
yesterday
You're saying - non linear will give greater correlation in Spearman?
â PoGibas
yesterday
You're saying - non linear will give greater correlation in Spearman?
â PoGibas
yesterday
3
3
Yes, as long as the nonlinear function $y = f(x)$ is increasing. (Or, if you're interested in absolute values, decreasing also works.) Spearman only looks at the ranks (relative orders).
â BruceET
yesterday
Yes, as long as the nonlinear function $y = f(x)$ is increasing. (Or, if you're interested in absolute values, decreasing also works.) Spearman only looks at the ranks (relative orders).
â BruceET
yesterday
add a comment |Â
up vote
2
down vote
Using your own example we can see there is no particular bias for two independent normal distributions:
library(tidyverse)
d <- data_frame(
x = replicate(1e4, rnorm(1e3), FALSE),
y = replicate(1e4, rnorm(1e3), FALSE),
pearson = map2_dbl(x, y, cor, method = 'pearson'),
spearman = map2_dbl(x, y, cor, method = 'spearman'),
p_min_s = pearson - spearman
)
qplot(d$p_min_s, xlab = c('pearson - spearman'))
add a comment |Â
up vote
2
down vote
Using your own example we can see there is no particular bias for two independent normal distributions:
library(tidyverse)
d <- data_frame(
x = replicate(1e4, rnorm(1e3), FALSE),
y = replicate(1e4, rnorm(1e3), FALSE),
pearson = map2_dbl(x, y, cor, method = 'pearson'),
spearman = map2_dbl(x, y, cor, method = 'spearman'),
p_min_s = pearson - spearman
)
qplot(d$p_min_s, xlab = c('pearson - spearman'))
add a comment |Â
up vote
2
down vote
up vote
2
down vote
Using your own example we can see there is no particular bias for two independent normal distributions:
library(tidyverse)
d <- data_frame(
x = replicate(1e4, rnorm(1e3), FALSE),
y = replicate(1e4, rnorm(1e3), FALSE),
pearson = map2_dbl(x, y, cor, method = 'pearson'),
spearman = map2_dbl(x, y, cor, method = 'spearman'),
p_min_s = pearson - spearman
)
qplot(d$p_min_s, xlab = c('pearson - spearman'))
Using your own example we can see there is no particular bias for two independent normal distributions:
library(tidyverse)
d <- data_frame(
x = replicate(1e4, rnorm(1e3), FALSE),
y = replicate(1e4, rnorm(1e3), FALSE),
pearson = map2_dbl(x, y, cor, method = 'pearson'),
spearman = map2_dbl(x, y, cor, method = 'spearman'),
p_min_s = pearson - spearman
)
qplot(d$p_min_s, xlab = c('pearson - spearman'))
answered yesterday
Axeman
1659
1659
add a comment |Â
add a comment |Â
up vote
1
down vote
Several Pearson & Spearman correlation values are compared here.
New contributor
We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.
This link may perish at some point, which would make this answer less than useful.
â Axeman
yesterday
add a comment |Â
up vote
1
down vote
Several Pearson & Spearman correlation values are compared here.
New contributor
We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.
This link may perish at some point, which would make this answer less than useful.
â Axeman
yesterday
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Several Pearson & Spearman correlation values are compared here.
New contributor
Several Pearson & Spearman correlation values are compared here.
New contributor
New contributor
answered yesterday
gunes
3285
3285
New contributor
New contributor
We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.
We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.
This link may perish at some point, which would make this answer less than useful.
â Axeman
yesterday
add a comment |Â
This link may perish at some point, which would make this answer less than useful.
â Axeman
yesterday
This link may perish at some point, which would make this answer less than useful.
â Axeman
yesterday
This link may perish at some point, which would make this answer less than useful.
â Axeman
yesterday
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstats.stackexchange.com%2fquestions%2f366326%2fis-spearman-correlation-never-greater-than-pearson-correlation%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password