Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Pearson correlation

alteryx_user
7 - Meteor

Hi,

I tried comparing R's Pearson product-moment correlation result with Alteryx's. I find a difference in the values. Can someone clarify the reason for the difference?

 

Dataset: mpg.csv (attached)

mpgmatrix (attached)

R code:

cor(mpgmatrix$mpg, mpgmatrix$weight, method="pearson")

(find correlation between mpg and weight)

R result:

cor
-0.9892536

Alteryx result:

-0.83

 

Pearson Correlation Analysis
Full Correlation Matrix
 mpgweight
mpg1.00000-0.83508
weight-0.835081.00000
2 REPLIES 2
BrandonB
Alteryx
Alteryx

Hi @alteryx_user 

 

I am seeing the same result using the dataset that you provided with both the association analysis tool and the R tool within alteryx, reading the data in as doubles. Would you mind sharing your completed R script? I have attached my workflow to this post as well. 

 

file 1.pngfile 2.png

BrandonB
Alteryx
Alteryx

I just ran the same code in RStudio and got the same value so it would appear that Alteryx and RStudio are matching

 

 

R Output.png

Labels