Data Science

How do I choose between Pearson and Spearman correlation for non-linear data sets in R?

SA Asked by Sarah Jenkins · 14-03-2023
0 upvotes 14,298 views 0 comments
The question

I am currently working on a data science project involving consumer behavior trends. I noticed my variables aren't showing a linear relationship. Should I stick with Pearson correlation, or is it safer to use Spearman rank correlation for non-normal distributions? I want to ensure my statistical analysis is robust before I present these findings to the stakeholders. 

3 answers

0
EM
Answered on 18-03-2023

If you are dealing with non-linear relationships or data that isn't normally distributed, Spearman is definitely the way to go. Pearson measures linear strength, so if your data curves or contains significant outliers, it will give you a misleading coefficient. Spearman works on the rank of the values rather than the raw numbers, making it a non-parametric powerhouse for monotonic relationships. In my experience with market research, using Spearman saved us from misinterpreting a crucial trend in customer acquisition costs that didn't follow a straight line. 

0
MI
Answered on 20-03-2023

That is a great question, but have you checked if your data is actually monotonic? Spearman is great, but if the relationship isn't consistently increasing or decreasing, even rank correlation might fail you. What does your scatter plot look like? 

S 22-03-2023

Michael, the scatter plot shows a clear upward curve, but it definitely levels off at the higher end of the spectrum. Based on that, I think a monotonic assumption holds true, but I was worried about the heteroscedasticity affecting the P-values in a standard linear regression model.

0
DA
Answered on 25-03-2023

I always recommend Spearman for non-normal data because it is far less sensitive to outliers than Pearson. It provides a more honest view of the association between variables.

EM 27-03-2023

I agree with David. In most real-world data science scenarios, data is rarely "perfectly" normal, so leaning on non-parametric tests like Spearman is a safer statistical bet.

Share your thoughts

Your email address will not be published. Required fields are marked (*)

Professional Counselling Session

Still have questions?
Schedule a free counselling session

Our experts are ready to help you with any questions about courses, admissions, or career paths. Get personalized guidance from industry professionals.

Request a Call Back

Search Online

We Accept

We Accept

Follow Us

"PMI®", "PMBOK®", "PMP®", "CAPM®" and "PMI-ACP®" are registered marks of the Project Management Institute, Inc. | "CSM", "CST" are Registered Trade Marks of The Scrum Alliance, USA. | COBIT® is a trademark of ISACA® registered in the United States and other countries.

Book Free Session