Forum Discussion
How to calculate Pearson correlation coefficient with 2-property arrays?
But I found no one word on Chi-Square that p-value is Pearson correlation calculator. Correlation on this site is calculated here https://www.mathsisfun.com/data/correlation-calculator.html, explanation of it is at https://www.mathsisfun.com/data/correlation-calculator.html
The two links in your reply are the same. What was the second one supposed to be?
And it appears that I was mistaken that the calculator I was using was doing the Pearson coefficient. But it is doing some other kind of correlation coefficient that works on 2-property arrays, whereas apparently Pearson is always 1 or -1 for 2-property arrays. So my question becomes, is there a way to calculate that other correlation coefficient in Excel?
- SergeiBaklanMar 24, 2020Diamond Contributor
Sorry, the second link is https://www.mathsisfun.com/data/correlation.html, it just explains the formula.
I'm not a specialists in stats. You may check available functions here https://www.excelfunctions.net/excel-statistical-functions.html and here https://support.office.com/en-us/article/statistical-functions-reference-624dac86-a375-4435-bc25-76d659719ffd if something works with you.
- anMSuserMar 25, 2020Copper Contributor
Okay, I figured it out. SergeiBaklan was helpful in showing me that the calculation I need is not the same as the Pearson coefficient calculated by pearson(). Savia was helpful with his attached spreadsheet that showed that the calculation I need is performed by the function https://support.microsoft.com/en-us/office/chisq-test-function-2e8a7861-b14a-4985-aa93-fb88de3f260f. But that function is not helpful because it requires me to have a separate array of expected values.
I had already written a VBA function that calculates chi-squared by the https://www.mathsisfun.com/data/chi-square-test.html. Now I've found that the calculation I need, the one done by the https://www.mathsisfun.com/data/chi-square-calculator.html, is performed by the Excel function https://support.office.com/en-us/article/chisq-dist-rt-function-dc4832e8-ed2b-49ae-8d7c-b28d5804c0f2. For the two arguments of that function, the first one is the output of my VBA function (using the method at the first link above) and the second argument is 1 (the degrees of freedom = (rows - 1) * (columns - 1) = 1).
I have now confirmed that ChiSq.dist.RT() is producing the correct results. Thank you guys for leading me in a direction that allowed me to figure that out.
- SergeiBaklanMar 26, 2020Diamond Contributor
Good to know you found the solution, thank you for the update