Fit a straight line \(Y = a + bX\) by the method of least squares to:
| x | 0 | 1 | 2 | 3 | 4 |
|---|---|---|---|---|---|
| y | 1 | 1.8 | 3.3 | 4.5 | 6.3 |
To fit a straight line to bivariate data by the method of least squares.
Applying it:
Blank working table (fill in xy and x², then total):
| x | y | xy | x² |
|---|---|---|---|
| 0 | 1 | ||
| 1 | 1.8 | ||
| 2 | 3.3 | ||
| 3 | 4.5 | ||
| 4 | 6.3 | ||
| Σ |
\(n = 5\); \(\sum x = 10,\ \sum y = 16.9,\ \sum xy = 47.1,\ \sum x^2 = 30\).
\(b = \dfrac{5(47.1) - (10)(16.9)}{5(30) - 10^2} = \dfrac{235.5 - 169}{150 - 100} = \dfrac{66.5}{50} = 1.33\).
\(a = \dfrac{16.9}{5} - 1.33(2) = 3.38 - 2.66 = 0.72\).
The fitted least-squares line is \(Y = 0.72 + 1.33\,X\).
Fit a second-degree parabola \(Y = a + bX + cX^2\) by the method of least squares to:
| x | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| y | 2 | 5 | 10 | 17 | 26 |
To fit a second-degree polynomial (parabola) to data by the method of least squares.
Applying it:
Blank working table (fill in the product columns and total):
| x | y | x² | x³ | x⁴ | xy | x²y |
|---|---|---|---|---|---|---|
| 1 | 2 | |||||
| 2 | 5 | |||||
| 3 | 10 | |||||
| 4 | 17 | |||||
| 5 | 26 | |||||
| Σ | 60 |
\(\sum x = 15,\ \sum x^2 = 55,\ \sum x^3 = 225,\ \sum x^4 = 979,\ \sum y = 60,\ \sum xy = 240,\ \sum x^2 y = 1034\).
Normal equations:
Solving gives \(a = 1,\ b = 0,\ c = 1\) (the equations are satisfied exactly: \(5+55 = 60\), \(15+225 = 240\), \(55+979 = 1034\)).
The fitted parabola is \(Y = 1 + X^2\) — an exact fit, since the data were generated by \(1 + X^2\).
Fit (Type I) \(Y = a\,b^X\) and (Type II) \(Y = a\,e^{bX}\) by least squares to:
| x | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| y | 3 | 9 | 27 | 81 | 243 |
To fit exponential curves by linearising them with logarithms and applying least squares.
Applying it:
Blank working table (fill in log y and x·log y, then total):
| x | y | log y | x · log y | x² |
|---|---|---|---|---|
| 1 | 3 | 1 | ||
| 2 | 9 | 4 | ||
| 3 | 27 | 9 | ||
| 4 | 81 | 16 | ||
| 5 | 243 | 25 | ||
| Σ | 55 |
\(\log y\): 0.477, 0.954, 1.431, 1.908, 2.386; \(\sum \log y = 7.157\); \(\sum x = 15\), \(\sum x^2 = 55\).
\(\sum x\log y = 1(0.477) + 2(0.954) + 3(1.431) + 4(1.908) + 5(2.386) = 26.24\).
\(B = \dfrac{5(26.24) - 15(7.157)}{5(55) - 15^2} = \dfrac{131.2 - 107.36}{50} = 0.477\), so \(b = 10^{0.477} = 3\).
\(A = \dfrac{7.157}{5} - 0.477(3) = 1.431 - 1.431 = 0\), so \(a = 10^{0} = 1\).
Type II: \(b = \ln 3 = 1.0986\), \(a = 1\).
Type I: \(Y = 1 \cdot 3^{X} = 3^{X}\). Type II: \(Y = e^{1.0986\,X}\) (the same curve written with base \(e\)).
Fit a power curve \(Y = a\,X^{b}\) by least squares to:
| x | 1 | 2 | 3 | 4 |
|---|---|---|---|---|
| y | 2 | 16 | 54 | 128 |
To fit a power curve by taking logarithms of both variables and applying least squares.
Applying it:
Blank working table (fill in the log columns and products, then total):
| x | y | log x | log y | (log x)² | log x · log y |
|---|---|---|---|---|---|
| 1 | 2 | ||||
| 2 | 16 | ||||
| 3 | 54 | ||||
| 4 | 128 | ||||
| Σ |
\(\log x\): 0, 0.301, 0.477, 0.602; \(\log y\): 0.301, 1.204, 1.732, 2.107.
\(\sum \log x = 1.380,\ \sum \log y = 5.344,\ \sum(\log x)^2 = 0.681,\ \sum(\log x)(\log y) = 2.458\).
\(b = \dfrac{4(2.458) - (1.380)(5.344)}{4(0.681) - 1.380^2} = \dfrac{9.832 - 7.375}{2.724 - 1.904} = \dfrac{2.457}{0.820} = 3.0\).
\(\log a = \dfrac{5.344}{4} - 3\!\left(\dfrac{1.380}{4}\right) = 1.336 - 1.035 = 0.301\), so \(a = 10^{0.301} = 2\).
The fitted power curve is \(Y = 2\,X^{3}\) — an exact fit, since the data were generated by \(2X^3\).
For the bivariate data below, compute the correlation coefficient and the two regression lines:
| x | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| y | 2 | 3 | 5 | 4 | 6 |
To compute Karl Pearson's correlation coefficient and the two regression lines for ungrouped data.
Applying it:
Blank working table (fill in the product columns and total):
| x | y | xy | x² | y² |
|---|---|---|---|---|
| 1 | 2 | |||
| 2 | 3 | |||
| 3 | 5 | |||
| 4 | 4 | |||
| 5 | 6 | |||
| Σ |
\(n = 5\); \(\sum x = 15,\ \sum y = 20,\ \sum xy = 69,\ \sum x^2 = 55,\ \sum y^2 = 90\).
\(r = \dfrac{5(69) - (15)(20)}{\sqrt{[5(55) - 225][5(90) - 400]}} = \dfrac{345 - 300}{\sqrt{50 \times 50}} = \dfrac{45}{50} = 0.9\).
\(b_{yx} = 45/50 = 0.9\), \(b_{xy} = 45/50 = 0.9\); with \(\bar x = 3,\ \bar y = 4\):
\(r = 0.9\) (strong positive correlation). Regression lines: \(Y = 0.9X + 1.3\) and \(X = 0.9Y - 0.6\). Check: \(\sqrt{b_{yx}\,b_{xy}} = \sqrt{0.81} = 0.9 = r\) ✓.
Bivariate frequency table (X = age in years, Y = weight in kg):
| X \ Y | 40–50 | 50–60 | 60–70 | Total |
|---|---|---|---|---|
| 20–30 | 2 | 5 | 3 | 10 |
| 30–40 | 1 | 10 | 9 | 20 |
| 40–50 | 0 | 5 | 15 | 20 |
| Total | 3 | 20 | 27 | 50 |
Compute the correlation coefficient.
To compute Karl Pearson's correlation coefficient for a bivariate frequency distribution using step deviations.
Applying it:
Blank working table (mid-points \(x = 25, 35, 45\Rightarrow u=-1,0,1\); \(y = 45, 55, 65\Rightarrow v=-1,0,1\); fill in the product columns and total):
| u | v | f | fu | fv | fu² | fv² | fuv |
|---|---|---|---|---|---|---|---|
| −1 | −1 | 2 | |||||
| −1 | 0 | 5 | |||||
| −1 | 1 | 3 | |||||
| 0 | −1 | 1 | |||||
| 0 | 0 | 10 | |||||
| 0 | 1 | 9 | |||||
| 1 | −1 | 0 | |||||
| 1 | 0 | 5 | |||||
| 1 | 1 | 15 | |||||
| Σ | 50 |
| u | v | f | fu | fv | fu² | fv² | fuv |
|---|---|---|---|---|---|---|---|
| −1 | −1 | 2 | −2 | −2 | 2 | 2 | 2 |
| −1 | 0 | 5 | −5 | 0 | 5 | 0 | 0 |
| −1 | 1 | 3 | −3 | 3 | 3 | 3 | −3 |
| 0 | −1 | 1 | 0 | −1 | 0 | 1 | 0 |
| 0 | 0 | 10 | 0 | 0 | 0 | 0 | 0 |
| 0 | 1 | 9 | 0 | 9 | 0 | 9 | 0 |
| 1 | −1 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 5 | 5 | 0 | 5 | 0 | 0 |
| 1 | 1 | 15 | 15 | 15 | 15 | 15 | 15 |
| Σ | 50 | 10 | 24 | 30 | 30 | 14 |
\(r = \dfrac{50(14) - (10)(24)}{\sqrt{[50(30) - 10^2][50(30) - 24^2]}} = \dfrac{700 - 240}{\sqrt{(1400)(924)}} = \dfrac{460}{1137.4} = 0.40\).
\(r = 0.40\) — a moderate positive correlation between age and weight.
For the bivariate frequency table of Experiment 6, compute the means, standard deviations and the two regression lines.
To obtain the regression lines of a bivariate frequency distribution from the correlation coefficient and the marginal standard deviations.
Applying it:
Blank working table (fill in each quantity from the Experiment 6 sums):
| Quantity | Value |
|---|---|
| \(\bar x\), \(\bar y\) | |
| \(\sigma_x\), \(\sigma_y\) | |
| \(r\) | |
| \(b_{yx}\), \(b_{xy}\) |
With \(A = 35,\ B = 55,\ h_x = h_y = 10,\ N = 50\) and the sums \(\sum fu = 10,\ \sum fv = 24,\ \sum fu^2 = 30,\ \sum fv^2 = 30\):
\(\bar x = 35 + 10(10/50) = 37\); \(\bar y = 55 + 10(24/50) = 59.8\).
\(\sigma_x = 10\sqrt{30/50 - (10/50)^2} = 10\sqrt{0.56} = 7.48\); \(\sigma_y = 10\sqrt{30/50 - (24/50)^2} = 10\sqrt{0.3696} = 6.08\).
With \(r = 0.40\): \(b_{yx} = 0.40(6.08/7.48) = 0.33\); \(b_{xy} = 0.40(7.48/6.08) = 0.50\).
\(\bar x = 37,\ \bar y = 59.8,\ \sigma_x = 7.48,\ \sigma_y = 6.08,\ r = 0.40\). The regression lines are \(Y - 59.8 = 0.33(X - 37)\) and \(X - 37 = 0.50(Y - 59.8)\).
Given the simple (zero-order) correlations \(r_{12} = 0.8,\ r_{13} = 0.5,\ r_{23} = 0.4\), compute the partial correlations \(r_{12.3},\ r_{13.2}\) and the multiple correlation \(R_{1.23}\).
To compute partial and multiple correlation coefficients from the zero-order correlations.
Applying it:
Blank working table (fill in each coefficient):
| Coefficient | Value |
|---|---|
| \(r_{12.3}\) | |
| \(r_{13.2}\) | |
| \(R_{1.23}\) |
\(r_{12.3} = \dfrac{0.8 - (0.5)(0.4)}{\sqrt{(1 - 0.25)(1 - 0.16)}} = \dfrac{0.6}{\sqrt{0.75 \times 0.84}} = \dfrac{0.6}{0.7937} = 0.756\).
\(r_{13.2} = \dfrac{0.5 - (0.8)(0.4)}{\sqrt{(1 - 0.64)(1 - 0.16)}} = \dfrac{0.18}{\sqrt{0.36 \times 0.84}} = \dfrac{0.18}{0.5499} = 0.327\).
\(R_{1.23}^2 = \dfrac{0.64 + 0.25 - 2(0.8)(0.5)(0.4)}{1 - 0.16} = \dfrac{0.89 - 0.32}{0.84} = 0.679\), so \(R_{1.23} = 0.824\).
\(r_{12.3} = 0.756,\ r_{13.2} = 0.327,\ R_{1.23} = 0.824\). The two predictors together explain about 67.9 % of the variation in \(X_1\).
Distribution by smoking and lung cancer in 200 individuals:
| Cancer (B) | No Cancer (β) | Total | |
|---|---|---|---|
| Smoker (A) | 60 | 40 | 100 |
| Non-smoker (α) | 20 | 80 | 100 |
| Total | 80 | 120 | 200 |
Compute Yule's coefficient of association \(Q\) and the coefficient of colligation \(\omega\).
To measure the association between two attributes using Yule's \(Q\) and the coefficient of colligation.
Applying it:
Blank working table (fill in the products and coefficients):
| Quantity | Value |
|---|---|
| \((AB)(\alpha\beta)\) | |
| \((A\beta)(\alpha B)\) | |
| \(Q\) | |
| \(\omega\) |
\((AB) = 60,\ (A\beta) = 40,\ (\alpha B) = 20,\ (\alpha\beta) = 80\); so \((AB)(\alpha\beta) = 4800\) and \((A\beta)(\alpha B) = 800\).
\(Q = \dfrac{4800 - 800}{4800 + 800} = \dfrac{4000}{5600} = 0.714\).
\(\omega = \dfrac{\sqrt{4800} - \sqrt{800}}{\sqrt{4800} + \sqrt{800}} = \dfrac{69.28 - 28.28}{69.28 + 28.28} = \dfrac{41.00}{97.56} = 0.420\).
Check: \(2\omega/(1 + \omega^2) = 0.840/1.176 = 0.714 = Q\) ✓.
\(Q = 0.714\) and \(\omega = 0.420\) — a strong positive association between smoking and lung cancer.