QUESTION IMAGE
Question
candice runs a bakery whose menu lists the number of calories in each item. she wondered whether this information affects which pastries are purchased, so she collected some sales data to find out. candice kept track of how many calories each pastry has, x, and how many times that pastry had been purchased in the last week, y. calories: 104, 144, 146, 174, 254, 266 sales: 101, 235, 167, 125, 400, 342 round your answer to the nearest thousandth. find the correlation coefficient, r, of the data described below.
Step1: Recall correlation coefficient formula
The formula for the Pearson - correlation coefficient $r$ is $r=\frac{n(\sum xy)-(\sum x)(\sum y)}{\sqrt{[n\sum x^{2}-(\sum x)^{2}][n\sum y^{2}-(\sum y)^{2}]}}$. First, we need to calculate the sums: $\sum x$, $\sum y$, $\sum xy$, $\sum x^{2}$, $\sum y^{2}$, where $x$ is the number of calories and $y$ is the number of sales.
Let $x = [104,144,146,174,254,266]$ and $y=[101,235,167,125,400,342]$.
$\sum x=104 + 144+146+174+254+266 = 1088$.
$\sum y=101 + 235+167+125+400+342 = 1370$.
Step2: Calculate $\sum xy$
$xy=[104\times101,144\times235,146\times167,174\times125,254\times400,266\times342]$
$xy = [10504,33840,24382,21750,101600,90972]$
$\sum xy=10504 + 33840+24382+21750+101600+90972=283048$.
Step3: Calculate $\sum x^{2}$
$x^{2}=[104^{2},144^{2},146^{2},174^{2},254^{2},266^{2}]$
$x^{2}=[10816,20736,21316,30276,64516,70756]$
$\sum x^{2}=10816+20736+21316+30276+64516+70756 = 218416$.
Step4: Calculate $\sum y^{2}$
$y^{2}=[101^{2},235^{2},167^{2},125^{2},400^{2},342^{2}]$
$y^{2}=[10201,55225,27889,15625,160000,116964]$
$\sum y^{2}=10201+55225+27889+15625+160000+116964 = 385904$.
Step5: Substitute into the formula
$n = 6$.
$n\sum xy=6\times283048 = 1698288$.
$(\sum x)(\sum y)=1088\times1370 = 1490560$.
$n\sum x^{2}=6\times218416=1310496$.
$(\sum x)^{2}=1088^{2}=1183744$.
$n\sum y^{2}=6\times385904 = 2315424$.
$(\sum y)^{2}=1370^{2}=1876900$.
The numerator $n(\sum xy)-(\sum x)(\sum y)=1698288 - 1490560=207728$.
The denominator:
$\sqrt{(1310496 - 1183744)(2315424 - 1876900)}=\sqrt{126752\times438524}$
$=\sqrt{55599194048}\approx235795.04$.
$r=\frac{207728}{235795.04}\approx0.881$.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
$r\approx0.881$