To test for a linear relationship, we can calculate the correlation coefficient (r). Using the given data:
X: 24, 32, 15, 30, 26, 20, 28, 32
Y: 60, 98, 36, 84, 78, 50, 82, 104
First, we need to calculate the means of X and Y:
mean(X) = (24 + 32 + 15 + 30 + 26 + 20 + 28 + 32) / 8 = 26.25
mean(Y) = (60 + 98 + 36 + 84 + 78 + 50 + 82 + 104) / 8 = 73.625
Next, we can calculate the different components needed to find r:
1. Calculate the deviations from the means for X (x - mean(X)) and Y (y - mean(Y)).
2. Multiply the deviations for X and Y (x - mean(X))(y - mean(Y)).
3. Square the deviations for X and Y (x - mean(X))^2 and (y - mean(Y))^2.
Using these calculations, we get:
-----------------------------------------------------------------
| X | Y | x - mean(X) | y - mean(Y) | (x - mean(X))(y - mean(Y)) | (x - mean(X))^2 | (y - mean(Y))^2 |
-----------------------------------------------------------------
| 24 | 60 | -2.25 | -13.625 | 30.703125 | 5.0625 | 185.765625 |
| 32 | 98 | 5.75 | 24.375 | 140.15625 | 33.0625 | 594.765625 |
| 15 | 36 | -11.25 | -37.625 | 423.28125 | 126.5625 | 1417.265625 |
| 30 | 84 | 3.75 | 10.375 | 38.90625 | 14.0625 | 107.515625 |
| 26 | 78 | -0.25 | 4.375 | -1.09375 | 0.0625 | 19.140625 |
| 20 | 50 | -6.25 | -23.625 | 147.65625 | 39.0625 | 558.765625 |
| 28 | 82 | 1.75 | 8.375 | 14.65625 | 3.0625 | 69.765625 |
| 32 | 104 | 5.75 | 30.375 | 175.40625 | 33.0625 | 922.515625 |
-----------------------------------------------------------------
Now, we can summarize the calculations:
sum(x - mean(X))(y - mean(Y)) = 30.703125 + 140.15625 + 423.28125 + 38.90625 - 1.09375 + 147.65625 + 14.65625 + 175.40625 = 970.76953125
sum(x - mean(X))^2 = 5.0625 + 33.0625 + 126.5625 + 14.0625 + 0.0625 + 39.0625 + 3.0625 + 33.0625 = 254.0625
sum(y - mean(Y))^2 = 185.765625 + 594.765625 + 1417.265625 + 107.515625 + 19.140625 + 558.765625 + 69.765625 + 922.515625 = 3875.390625
Finally, we can calculate the correlation coefficient (r):
r = sum(x - mean(X))(y - mean(Y)) / sqrt(sum(x - mean(X))^2 * sum(y - mean(Y))^2)
= 970.76953125 / sqrt(254.0625 * 3875.390625)
= 970.76953125 / sqrt(984010.625)
≈ 970.76953125 / 992.00737719
≈ 0.978914
To test for a linear relationship, we need to calculate the value of the test statistic, which is the square of the correlation coefficient:
test statistic = r^2 = (0.978914)^2 ≈ 0.957108
Therefore, the value of the test statistic if we want to test for a linear relationship is approximately 0.957108.
Given the information on home size (X) in ten squared metres and the sale price (Y) in R 10000 of houses in Bloemfontein:
X
24
32
15
30
26
20
28
32
Y
60
98
36
84
78
50
82
104
Calculate the value of the test statistic if we want to test for a linear relationship.
6
8
10
12
14
1 answer