Calculate the regression equations of X on Y and Y on X from the following data:

X |
10 | 12 | 13 | 17 | 18 |

Y |
5 | 6 | 7 | 9 | 13 |

#### Solution

X = x_{i} |
Y = y_{i} |
`"x"_"i"^2` |
`"y"_"i"^2` |
x_{i} y_{i} |

10 | 5 | 100 | 25 | 50 |

12 | 6 | 144 | 36 | 72 |

13 | 7 | 169 | 49 | 91 |

17 | 9 | 289 | 81 | 153 |

18 | 13 | 324 | 169 | 234 |

70 |
40 |
1026 |
360 |
600 |

From the table, we have,

n = 5, ∑ x_{i} = 70, ∑ y_{i} = 40, ∑ x_{i} y_{i} = 600, `sum"x"_"i"^2 = 1026`, `sum"y"_"i"^2 = 360

`bar"x" = sum"x"_"i"/"n" = 70/5 = 14`,

`bar"y" = sum"y"_"i"/"n" = 40/5 = 8`

Now, for regression equation of X on Y

`"b"_"XY" = (sum"x"_"i" "y"_"i" - "n" bar "x" bar "y")/(sum "y"_"i"^2 - "n" bar"y"^2)`

`= (600 - 5 xx 14 xx 8)/(360 - 5(8)^2) = (600 - 560)/(360 - 320) = 40/40 = 1`

Also, `"a"' = bar"x" - "b"_"XY" bar"y" = 14 - 1(8) = 14 - 8 = 6`

∴ The regression equation of X on Y is

X = a' + b_{XY}Y

∴ X = 6 + Y

Now, for regression equation of Y on X

`"b"_"YX" = (sum"x"_"i" "y"_"i" - "n" bar "x" bar "y")/(sum "x"_"i"^2 - "n" bar"x"^2)`

`= (600 - 5(14)(8))/(1026 - 5(14)^2) = (600- 560)/(1026 - 980) = 40/46 = 0.87`

Also, a = `bar"y" - "b"_"YX" bar"x"`

`= 8 - 0.87 xx 14 = 8 - 12.18 = - 4.18`

∴ The regression equation of Y on X is

Y = a + b_{YX} X

∴ Y = - 4.18 + 0.87X