document.write( "Question 1208428: Good afternoon, please help me solve this problem.
\n" ); document.write( "During the baking of a certain type of bread roll, each bread goes through a series of heat process. The length of time spent under this heat treatment is related to the lifespan of the bread rolls. A sample of eight bread rolls that underwent different baking times was selected and the life span (hours) of each roll was recorded as follows:\r
\n" ); document.write( "\n" ); document.write( "Length of time 18 13 18 15 10 12 8 4
\n" ); document.write( "Life span 23 20 18 16 14 11 10 7\r
\n" ); document.write( "\n" ); document.write( "a) Calculate the Pearson’s correlation coefficient and explain the result [10 Marks
\n" ); document.write( "
\n" ); document.write( "

Algebra.Com's Answer #846839 by math_tutor2020(3817)\"\" \"About 
You can put this solution on YOUR website!

\n" ); document.write( "Answer: 0.8703
\n" ); document.write( "This value is approximate.\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "Explanation\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "This value can be quickly calculated using technology.
\n" ); document.write( "Here are some options:
  • Use the LinReg command on a TI83 (or similar). Make sure that Diagnostic is set to \"on\".
  • Use the the CORREL command in a spreadsheet.
  • Input the data into the spreadsheet mode of GeoGebra. Refer to this video for an example.
  • Search out \"pearson correlation coefficient calculator\" to find many free tools online. Two search results I found were this and this (among many other results).
  • Use a programming language such as R or Python.
  • There are many other technology options. I encourage the student to explore his/her favorite.
If you aren't allowed to use a specialized correlation coefficient calculator, then check out any of the three methods shown below.\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "----------------------------------------------------------------------------------------
\n" ); document.write( "Method 1\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "Define the following
\n" ); document.write( "x = length of baking time (in minutes)
\n" ); document.write( "y = life span (in hours)\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "The given table is
\n" ); document.write( "\n" ); document.write( "\n" ); document.write( "
x18131815101284
y232018161411107
\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "There are n = 8 columns of values.
\n" ); document.write( "In other words, there are 8 pairs of (x,y) values.\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "Add up the x values and divide by n = 8 to find the sample mean of the x values.
\n" ); document.write( "xbar = sample mean of x values = x with a horizontal bar over top
\n" ); document.write( "xbar = (sum of x values)/(number of x values)
\n" ); document.write( "xbar = (18+13+18+15+10+12+8+4)/8
\n" ); document.write( "xbar = 98/8
\n" ); document.write( "xbar = 12.25
\n" ); document.write( "If you are using spreadsheet software, then the function you can use is called Average\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "Apply the same idea to the y values.
\n" ); document.write( "ybar = (sum of y values)/(number of y values)
\n" ); document.write( "ybar = (23+20+18+16+14+11+10+7)/8
\n" ); document.write( "ybar = 119/8
\n" ); document.write( "ybar = 14.875\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "Introduce a new row labeled xy. This is the product of the x and y values.
\n" ); document.write( "For example, we'll have x*y = 18*23 = 414 as the first entry of this row.
\n" ); document.write( "\n" ); document.write( "\n" ); document.write( "
x18131815101284
y232018161411107
xy4142603242401401328028

\n" ); document.write( "Add up the items in this new row to get Sum(xy) = 414+260+324+240+140+132+80+28 = 1618
\n" ); document.write( "Spreadsheet software is strongly recommended.\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "The last two things we need are:
\n" ); document.write( "SD(x)
\n" ); document.write( "SD(y)
\n" ); document.write( "which represent the sample standard deviations of the x and y values respectively.\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "You could find these by hand (see part d of this page) but I'll use technology to speed things up.
\n" ); document.write( "SD(x) = 4.862392
\n" ); document.write( "SD(y) = 5.409978
\n" ); document.write( "These values are approximate. I rounded each to 6 decimal places.
\n" ); document.write( "Make sure you use the sample standard deviation and NOT the population standard deviation.\r
\n" ); document.write( "
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "Let's calculate the correlation coefficient.
\n" ); document.write( "\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "Many textbooks will round to 4 decimal places. If your teacher instructs otherwise, then be sure to follow said instructions.\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "----------------------------------------------------------------------------------------
\n" ); document.write( "Method 2\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "Return back to this table.
\n" ); document.write( "\n" ); document.write( "\n" ); document.write( "
x18131815101284
y232018161411107
xy4142603242401401328028
\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "Let's introduce rows labeled x^2 and y^2.
\n" ); document.write( "As their name suggests, we'll square each value.
\n" ); document.write( "Eg: x^2 = 18^2 = 324
\n" ); document.write( "\n" ); document.write( "\n" ); document.write( "
x18131815101284
y232018161411107
xy4142603242401401328028
x^23241693242251001446416
y^252940032425619612110049
\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "Define the following
\n" ); document.write( "A = sum of the x values = 98
\n" ); document.write( "B = sum of the y values = 119
\n" ); document.write( "C = sum of the xy values = 1618
\n" ); document.write( "D = sum of the x^2 values = 1366
\n" ); document.write( "E = sum of the y^2 values = 1975
\n" ); document.write( "Spreadsheet software can quickly compute each of these.\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "We can now compute the correlation coefficient.
\n" ); document.write( "\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "----------------------------------------------------------------------------------------
\n" ); document.write( "Method 3\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "Let's return back to the original table.
\n" ); document.write( "\n" ); document.write( "\n" ); document.write( "
x18131815101284
y232018161411107
\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "Recall these previous calculations
\n" ); document.write( "xbar = 12.25
\n" ); document.write( "SD(x) = 4.862392\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "We'll use them to determine the z score of each x value.
\n" ); document.write( "For instance, if x = 18, then,
\n" ); document.write( "z = (x-xbar)/( SD(x) )
\n" ); document.write( "z = (18-12.25)/( 4.862392 )
\n" ); document.write( "z = 1.182545545485
\n" ); document.write( "z = 1.182546
\n" ); document.write( "Repeat similar calculations for the other x values. This new row will be labeled Zx to indicate the z scores of the x values.
\n" ); document.write( "\n" ); document.write( "\n" ); document.write( "
x18131815101284
y232018161411107
Zx1.1825460.1542451.1825460.565565-0.462735-0.051415-0.874055-1.696696
\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "For the y values we have
\n" ); document.write( "ybar = 14.875
\n" ); document.write( "SD(y) = 5.409978 (approximate)
\n" ); document.write( "Here's what it looks like to introduce the z scores for the y values.
\n" ); document.write( "\n" ); document.write( "\n" ); document.write( "
x18131815101284
y232018161411107
Zx1.1825460.1542451.1825460.565565-0.462735-0.051415-0.874055-1.696696
Zy1.5018550.9473240.5776360.207949-0.161738-0.716269-0.901113-1.455644

\n" ); document.write( "As mentioned earlier, spreadsheet software is strongly recommended.\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "The next thing we'll do is multiply each Zx and Zy value to form a new row.
\n" ); document.write( "Example: 1.182546*1.501855 = 1.776013 approximately
\n" ); document.write( "\n" ); document.write( "\n" ); document.write( "
x18131815101284
y232018161411107
Zx1.1825460.1542451.1825460.565565-0.462735-0.051415-0.874055-1.696696
Zy1.5018550.9473240.5776360.207949-0.161738-0.716269-0.901113-1.455644
Zx*Zy1.7760130.146120.6830810.1176090.0748420.0368270.7876222.469785

\n" ); document.write( "The decimal values are approximate.\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "The values in that bottom row add to 6.091899 which is also approximate.\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "We can finally calculate the r value.
\n" ); document.write( "r = Sum(Zx*Zy)/(n-1)
\n" ); document.write( "r = 6.091899/(8-1)
\n" ); document.write( "r = 0.870271285714
\n" ); document.write( "r = 0.8703\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "Other methods are possible.
\n" ); document.write( "I'll let the student explore them.\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "----------------------------------------------------------------------------------------\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "Further Reading
\n" ); document.write( "https://www.statology.org/pearson-correlation-coefficient/
\n" ); document.write( "https://statisticsbyjim.com/basics/correlation-coefficient-formula/
\n" ); document.write( "https://www.statisticshowto.com/probability-and-statistics/correlation-coefficient-formula/
\n" ); document.write( "https://www.howtoexcel.org/correlation-coefficient/\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "More Practice
\n" ); document.write( "https://www.algebra.com/algebra/homework/word/evaluation/Evaluation_Word_Problems.faq.question.1196643.html
\n" ); document.write( "
\n" ); document.write( "
\n" );