correlation coefficient when I have totals for each data pair

G

Guest

Let's say a customer can eat 1,2, or 3 burgers and 1,2, or 3 sodas. I have counted like this

1 burgers , 1 soda : 10 peopl
1 burgers , 2 sodas: 5 peopl
1 burders, 3 sodas : 1 perso
...
3 burgers , 3 sodas: 15 peopl

How can I figure out the correlation coefficient of burgers and sodas? The correl() function expects each customer to be on its own line, whereas I have sums. In my actual case, the sums are thousands large

Do I have to work it out laboriously by hand?
 
J

Jerry W. Lewis

assuming the ranges I refer to as burgers, sodas, and people contain
only the numeric values; your formula would be

=(SUM(people)*SUMPRODUCT(burgers,sodas,people)-SUMPRODUCT(burgers,people)*SUMPRODUCT(sodas,people))
/SQRT((SUM(people)*SUMPRODUCT(burgers^2,people)-SUMPRODUCT(burgers,people)^2)*(SUM(people)*
SUMPRODUCT(sodas^2,people)-SUMPRODUCT(sodas,people)^2))

Jerry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top