Forum Discussion
How to calculate Pearson correlation coefficient with 2-property arrays?
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.
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