Covariance Correlation Ee2A30
1. **Problem Statement:** Given five observations for two variables $x$ and $y$:
$x$: 4, 6, 11, 3, 16
$y$: 50, 50, 40, 60, 30
Compute the sample covariance and sample correlation coefficient.
2. **Formulas and Important Rules:**
- Sample covariance formula:
$$\text{Cov}(x,y) = \frac{1}{n-1} \sum_{i=1}^n (x_i - \bar{x})(y_i - \bar{y})$$
- Sample correlation coefficient formula:
$$r = \frac{\text{Cov}(x,y)}{s_x s_y}$$
where $s_x$ and $s_y$ are the sample standard deviations of $x$ and $y$ respectively.
- Mean of $x$:
$$\bar{x} = \frac{1}{n} \sum_{i=1}^n x_i$$
- Mean of $y$:
$$\bar{y} = \frac{1}{n} \sum_{i=1}^n y_i$$
3. **Calculate Means:**
$$\bar{x} = \frac{4 + 6 + 11 + 3 + 16}{5} = \frac{40}{5} = 8$$
$$\bar{y} = \frac{50 + 50 + 40 + 60 + 30}{5} = \frac{230}{5} = 46$$
4. **Calculate Deviations and Products:**
| $x_i$ | $y_i$ | $x_i - \bar{x}$ | $y_i - \bar{y}$ | $(x_i - \bar{x})(y_i - \bar{y})$ |
|-------|-------|-----------------|-----------------|-------------------------------|
| 4 | 50 | 4 - 8 = -4 | 50 - 46 = 4 | (-4)(4) = -16 |
| 6 | 50 | 6 - 8 = -2 | 50 - 46 = 4 | (-2)(4) = -8 |
| 11 | 40 | 11 - 8 = 3 | 40 - 46 = -6 | (3)(-6) = -18 |
| 3 | 60 | 3 - 8 = -5 | 60 - 46 = 14 | (-5)(14) = -70 |
| 16 | 30 | 16 - 8 = 8 | 30 - 46 = -16 | (8)(-16) = -128 |
Sum of products:
$$-16 - 8 - 18 - 70 - 128 = -240$$
5. **Calculate Sample Covariance:**
$$\text{Cov}(x,y) = \frac{-240}{5 - 1} = \frac{-240}{4} = -60$$
6. **Calculate Sample Standard Deviations:**
Calculate $s_x$:
$$\sum (x_i - \bar{x})^2 = (-4)^2 + (-2)^2 + 3^2 + (-5)^2 + 8^2 = 16 + 4 + 9 + 25 + 64 = 118$$
$$s_x = \sqrt{\frac{118}{4}} = \sqrt{29.5} \approx 5.431$$
Calculate $s_y$:
$$\sum (y_i - \bar{y})^2 = 4^2 + 4^2 + (-6)^2 + 14^2 + (-16)^2 = 16 + 16 + 36 + 196 + 256 = 520$$
$$s_y = \sqrt{\frac{520}{4}} = \sqrt{130} \approx 11.402$$
7. **Calculate Sample Correlation Coefficient:**
$$r = \frac{-60}{5.431 \times 11.402} = \frac{-60}{61.91} \approx -0.969$$
**Interpretation:**
- The sample covariance is negative, indicating that as $x$ increases, $y$ tends to decrease.
- The correlation coefficient is approximately $-0.969$, which is very close to $-1$, indicating a strong negative linear relationship between $x$ and $y$.
**Final Answers:**
Sample covariance = $-60$
Sample correlation coefficient = $-0.969$