Probability and Statistics 201-SN1-RE • CEGEP, Montreal

Corrected exercises: linear regression and the chi-square test of independence (201-SN1-RE)

Here are ten corrected exercises on the relationship between two variables, element 4 of the CEGEP Probability and Statistics course 201-SN1-RE, preceded by twelve direct calculations.

What the set covers, the traps it targets

They cover the scatter plot, covariance, the linear correlation coefficient rr, the least-squares regression line, the coefficient of determination r2r^{2}, prediction by interpolation or extrapolation, influential points and residual analysis, then, for two qualitative variables, the contingency table, expected counts and the chi-square test of independence.

As the course specification requires, the formulas are proved: the least-squares line and the fact that −1≤r≤1-1\le r\le 1 (exercise 2), the invariance of rr under a change of units (exercise 1), the product of the slopes of the two regression lines (exercise 3), the formula for expected counts (exercise 4), the P-value with two degrees of freedom by an integral (exercise 5) and the proportionality of the chi-square statistic to the sample size (exercise 7).

By the end, you can carry out a regression and a chi-square test on science data: the speed of sound, a spring, an absorbance calibration, hydrangeas and soil pH, common milkweed germination, climate and latitude, garter snakes, and a complete study of the salamanders of a forest (exercise 10). The pitfalls covered: reading rr as a percentage (exercises 3 and 8), extrapolating outside the range (exercises 3, 6 and 10), judging a point on rr alone (exercise 6), trusting r2r^{2} without looking at the residuals (exercise 9), testing a table whose expected counts are too small (exercise 7) and taking a failure to reject for a proof of independence (exercises 7 and 8).

The thread of the set: a measure of association answers the question of its own model, and no other. rr and r2r^{2} measure alignment on a line, the chi-square statistic the departure from independence. We look at the data before the number, and we conclude without going beyond the study design or the measured range: the word “effect” is allowed only if the factor was assigned at random (exercise 5).

  • 11 corrected exercises • 110 points • 180 minutes
  • Self-checking, 118 answers
  • Calculator
Start exercise 0.1 The chapter sheet

Course recap

  • • WORKING SUMS: Sxx=∑(xi−x‾)2=∑xi2−(∑xi)2nS_{xx}=\sum (x_{i}-\overline{x})^{2}=\sum x_{i}^{2}-\dfrac{(\sum x_{i})^{2}}{n}, Sxy=∑(xi−x‾)(yi−y‾)=∑xiyi−∑xi∑yinS_{xy}=\sum (x_{i}-\overline{x})(y_{i}-\overline{y})=\sum x_{i}y_{i}-\dfrac{\sum x_{i}\sum y_{i}}{n}, and likewise SyyS_{yy}. Sample covariance: sxy=Sxyn−1s_{xy}=\dfrac{S_{xy}}{n-1}, which depends on the units.
  • • LEAST-SQUARES LINE y^=ax+b\hat{y}=ax+b: it minimizes ∑(yi−axi−b)2\sum (y_{i}-ax_{i}-b)^{2}, the sum of the squared VERTICAL deviations; a=SxySxxa=\dfrac{S_{xy}}{S_{xx}} and b=y‾−ax‾b=\overline{y}-a\overline{x}, so it passes through (x‾,y‾)(\overline{x}, \overline{y}). The sum of the residuals ei=yi−y^ie_{i}=y_{i}-\hat{y}_{i} is zero.
  • • CORRELATION: r=SxySxxSyy=sxysxsyr=\dfrac{S_{xy}}{\sqrt{S_{xx}S_{yy}}}=\dfrac{s_{xy}}{s_{x}s_{y}}, with no unit, between −1-1 and 11; it measures alignment on a line, nothing else. DETERMINATION: r2=1−Smin⁡Syyr^{2}=1-\dfrac{S_{\min}}{S_{yy}}, the share of the variation in yy explained by the linear relationship.
  • • PREDICTION: interpolation within the range of the observed xx values; extrapolation beyond it, not guaranteed. A point far from x‾\overline{x} has high leverage: it can rotate the line without lowering rr. Look at the scatter plot and the residuals before concluding.
  • • CHI-SQUARE TEST OF INDEPENDENCE: H0H_{0}: the two qualitative variables are independent. Eij=LiCjnE_{ij}=\dfrac{L_{i}C_{j}}{n} (L for the row total, C for the column total), χ2=∑(O−E)2E\chi^{2}=\sum\dfrac{(O-E)^{2}}{E} computed on COUNTS, (ℓ−1)(c−1)(\ell-1)(c-1) degrees of freedom. Conditions: independent observations and every E≥5E\ge 5, otherwise combine neighbouring categories.
  • • CONCLUDING: reject H0H_{0} if χ2\chi^{2} exceeds the given critical value. A rejection establishes an association, a CAUSE only if the factor was assigned at random; a failure to reject does not prove independence. χ2\chi^{2} grows with nn: it measures the evidence, not the strength of the relationship.

Calculations: working sums, the line, coefficients and chi-square

Exercise 0.1: Regression and chi-square: twelve direct calculations

12 answers to check

For each line, compute the requested quantity, without interpreting. Notation for the chapter: Sxy=∑(xi−x‾)(yi−y‾)=∑xiyi−∑xi∑yinS_{xy}=\sum (x_{i}-\overline{x})(y_{i}-\overline{y})=\sum x_{i}y_{i}-\frac{\sum x_{i}\sum y_{i}}{n}, Sxx=∑xi2−(∑xi)2nS_{xx}=\sum x_{i}^{2}-\frac{(\sum x_{i})^{2}}{n}, least-squares line y^=ax+b\hat{y}=ax+b with a=SxySxxa=\frac{S_{xy}}{S_{xx}} and b=y‾−ax‾b=\overline{y}-a\overline{x}, correlation coefficient r=SxySxxSyyr=\frac{S_{xy}}{\sqrt{S_{xx}S_{yy}}}, residual e=y−y^e=y-\hat{y}. For a contingency table, E=L×CnE=\frac{L\times C}{n} (L for the row total, C for the column total) and χ2=∑(O−E)2E\chi^{2}=\sum\frac{(O-E)^{2}}{E}.

  • a) n=6n=6, ∑x=24\sum x=24, ∑y=90\sum y=90, ∑xy=402\sum xy=402: compute SxyS_{xy}.
  • b) n=5n=5, ∑x=20\sum x=20, ∑x2=110\sum x^{2}=110: compute SxxS_{xx}.
  • c) Sxy=42S_{xy}=42, Sxx=30S_{xx}=30, Syy=70S_{yy}=70: compute rr.
  • d) r=−0.83r=-0.83: compute the coefficient of determination r2r^{2}.
  • e) Sxy=−54S_{xy}=-54, Sxx=36S_{xx}=36: compute the slope aa.
  • f) a=2.4a=2.4, x‾=5\overline{x}=5, y‾=18.5\overline{y}=18.5: compute the intercept bb.
  • g) y^=0.36x+2.1\hat{y}=0.36x+2.1: compute the predicted value for x=12.5x=12.5.
  • h) y^=1.8x+4\hat{y}=1.8x+4: compute the residual of the point (6,13.2)(6, 13.2).
  • i) Row total 6060, column total 4545, n=180n=180: compute the expected count EE of the cell.
  • j) O=22O=22, E=15E=15: compute the contribution (O−E)2E\frac{(O-E)^{2}}{E} of the cell.
  • k) Contingency table with 33 rows and 44 columns: give the number of degrees of freedom.
  • l) χ2=7.1\chi^{2}=7.1 with 44 degrees of freedom, critical value 9.4889.488 at the 5%5\% significance level: what is the decision?

Type your answers, the page tells you right or wrong 0/12

a)
b)
c)
d)
e)
f)
g)
h)
i)
j)
k)
l)
Show the solution

Answers

  • a) Sxy=42S_{xy}=42
  • b) Sxx=30S_{xx}=30
  • c) r≈0.917r\approx 0.917
  • d) r2≈0.689r^{2}\approx 0.689
  • e) a=−1.5a=-1.5
  • f) b=6.5b=6.5
  • g) y^=6.6\hat{y}=6.6
  • h) e=−1.6e=-1.6
  • i) E=15E=15
  • j) ≈3.27\approx 3.27
  • k) 66 degrees of freedom
  • l) 7.1<9.4887.1<9.488: do not reject H0H_{0}
a)
Sxy=402−24×906=402−360=42\displaystyle S_{xy}=402-\dfrac{24\times 90}{6}=402-360=42
b)
Sxx=110−2025=110−80=30\displaystyle S_{xx}=110-\dfrac{20^{2}}{5}=110-80=30
c)
r=4230×70=422100≈0.917\displaystyle r=\dfrac{42}{\sqrt{30\times 70}}=\dfrac{42}{\sqrt{2100}}\approx 0.917
d)
r2=(−0.83)2=0.6889≈0.689\displaystyle r^{2}=(-0.83)^{2}=0.6889\approx 0.689

The sign disappears: the coefficient of determination does not give the direction of the relationship.

e)
a=−5436=−1.5\displaystyle a=\dfrac{-54}{36}=-1.5
f)
b=18.5−2.4×5=6.5\displaystyle b=18.5-2.4\times 5=6.5

The line passes through the mean point (5,18.5)(5, 18.5): that is exactly what this formula says.

g)
y^=0.36×12.5+2.1=4.5+2.1=6.6\displaystyle \hat{y}=0.36\times 12.5+2.1=4.5+2.1=6.6
h)

y^=1.8×6+4=14.8\hat{y}=1.8\times 6+4=14.8, so e=13.2−14.8=−1.6e=13.2-14.8=-1.6

The point lies below the line.

i)
E=60×45180=15\displaystyle E=\dfrac{60\times 45}{180}=15
j)
(22−15)215=4915≈3.27\displaystyle \dfrac{(22-15)^{2}}{15}=\dfrac{49}{15}\approx 3.27
k)

(3−1)(4−1)=6(3-1)(4-1)=6 degrees of freedom.

l)

7.1<9.4887.1<9.488: the statistic does not fall in the critical region, so we do not reject H0H_{0}.

We write: at the 5% level, the data do not allow us to conclude that there is a relationship. We do not write that the variables are independent.

Tick the exercises you have done or want to review: a free account, no password, keeps your ticks and your right answers from one visit to the next, tells you which chapter to tackle next and lets you ask for the exercise you are missing. Create your space, an email is enough.

Part A: the basics (/50)

Exercise 1: Scatter plot, covariance and correlation coefficient: the speed of sound

11 answers to check

In the physics lab, the speed vv of sound is measured in the air of a resonance tube, the air being brought in turn to six temperatures TT. The measurements are rounded to the nearest metre per second.

The figure shows the scatter plot.

TT (°C)−10-10001010151525253030
vv (m/s)325325331331338338340340346346350350
−15−10−55101520253035320325330335340345350355T (°C)v (m/s)
  • a) Describe the scatter plot: direction, form and strength of the relationship, and whether or not there is an isolated point.
  • b) Compute the means T‾\overline{T} and v‾\overline{v}, then the covariance sTv=1n−1∑(Ti−T‾)(vi−v‾)s_{Tv}=\frac{1}{n-1}\sum (T_{i}-\overline{T})(v_{i}-\overline{v}). State its unit.
  • c) Compute the standard deviations sTs_{T} and svs_{v}, then the correlation coefficient r=sTvsT svr=\frac{s_{Tv}}{s_{T}\,s_{v}}. Interpret it.
  • d) The units are changed: T′=αT+βT'=\alpha T+\beta and v′=γv+δv'=\gamma v+\delta, with α>0\alpha>0 and γ>0\gamma>0. Prove that sT′v′=αγ sTvs_{T'v'}=\alpha\gamma\, s_{Tv} and that the correlation coefficient is unchanged.
  • e) The temperature is now expressed in kelvins and the speed in kilometres per hour. Compute the new covariance and the new correlation coefficient.
  • f) Another team instead records the temperature as the gap below 3030 °C, θ=30−T\theta=30-T. What is the correlation coefficient between θ\theta and vv?

Type your answers, the page tells you right or wrong 0/11

a)
b)
c)
e)
f)
Show the solution

Answers

  • a) Increasing, linear, very strong, no isolated point
  • b) T‾≈11.67\overline{T}\approx 11.67 °C, v‾≈338.33\overline{v}\approx 338.33 m/s, sTv≈139.33s_{Tv}\approx 139.33 °C·m/s
  • c) sT≈15.06s_{T}\approx 15.06 °C, sv≈9.27s_{v}\approx 9.27 m/s, r≈0.9987r\approx 0.9987: very strong increasing linear relationship
  • d) sT′v′=αγ sTvs_{T'v'}=\alpha\gamma\,s_{Tv}, sT′=αsTs_{T'}=\alpha s_{T}, sv′=γsvs_{v'}=\gamma s_{v}, so r′=rr'=r
  • e) sT′v′≈501.6s_{T'v'}\approx 501.6 K·km/h; r′≈0.9987r'\approx 0.9987
  • f) r≈−0.9987r\approx -0.9987
a)

The points rise from left to right: the relationship is increasing.

They lie almost exactly on a line: the form is linear and the relationship very strong.

No point stands apart from the group, either horizontally or vertically.

This description is written BEFORE any calculation: it is what then justifies a linear correlation coefficient.

b)

T‾=706≈11.67\overline{T}=\dfrac{70}{6}\approx 11.67 °C and v‾=20306≈338.33\overline{v}=\dfrac{2030}{6}\approx 338.33 m/s.

STv=∑Tivi−∑Ti∑vin=24,380−70×20306≈696.67\displaystyle S_{Tv}=\sum T_{i}v_{i}-\dfrac{\sum T_{i}\sum v_{i}}{n}=24{,}380-\dfrac{70\times 2030}{6}\approx 696.67

sTv=696.675≈139.33s_{Tv}=\dfrac{696.67}{5}\approx 139.33, in degrees Celsius metres per second.

The positive sign confirms the increasing direction. The value 139 says nothing about the strength of the relationship: it depends on the units, as question e shows.

Pitfall: dividing by n=6n=6 gives 116.1116.1. The question defines the sample covariance with n−1n-1.

c)

sT=STTn−1=1133.335≈15.06s_{T}=\sqrt{\dfrac{S_{TT}}{n-1}}=\sqrt{\dfrac{1133.33}{5}}\approx 15.06 °C and sv=429.335≈9.27s_{v}=\sqrt{\dfrac{429.33}{5}}\approx 9.27 m/s.

r=139.3315.06×9.27≈0.9987\displaystyle r=\dfrac{139.33}{15.06\times 9.27}\approx 0.9987

The coefficient is positive and very close to 1: the measurements lie almost perfectly on an increasing line.

It measures alignment, and only that: it does not say by how much the speed increases per degree; that is the role of the slope.

d)

Ti′−T′‾=α(Ti−T‾)T'_{i}-\overline{T'}=\alpha(T_{i}-\overline{T}) and vi′−v′‾=γ(vi−v‾)v'_{i}-\overline{v'}=\gamma(v_{i}-\overline{v}): the constants β\beta and δ\delta disappear from the deviations from the mean.

sT′v′=1n−1∑α(Ti−T‾) γ(vi−v‾)=αγ sTv\displaystyle s_{T'v'}=\dfrac{1}{n-1}\sum \alpha(T_{i}-\overline{T})\,\gamma(v_{i}-\overline{v})=\alpha\gamma\,s_{Tv}

Likewise sT′=∣α∣ sT=αsTs_{T'}=|\alpha|\,s_{T}=\alpha s_{T} and sv′=γsvs_{v'}=\gamma s_{v}, since α>0\alpha>0 and γ>0\gamma>0.

r′=αγ sTvαsT γsv=r\displaystyle r'=\dfrac{\alpha\gamma\,s_{Tv}}{\alpha s_{T}\,\gamma s_{v}}=r

The correlation coefficient has no unit: changing units does not change how the points are aligned.

e)

Kelvins: T′=T+273.15T'=T+273.15, so α=1\alpha=1. Kilometres per hour: v′=3.6 vv'=3.6\,v, so γ=3.6\gamma=3.6.

sT′v′=1×3.6×139.33≈501.6s_{T'v'}=1\times 3.6\times 139.33\approx 501.6, in kelvin kilometres per hour.

r′=r≈0.9987\displaystyle r'=r\approx 0.9987

The covariance was multiplied by 3.6 although the relationship did not change: it therefore cannot be used to say whether a relationship is strong.

f)

θ=−T+30\theta=-T+30: this is a change of units with α=−1<0\alpha=-1<0.

The proof in d then gives sθv=−sTvs_{\theta v}=-s_{Tv} and sθ=∣−1∣ sT=sTs_{\theta}=|-1|\,s_{T}=s_{T}, hence r=−0.9987r=-0.9987.

Pitfall: believing that the strength of the relationship has changed. Only the direction is reversed, because θ decreases when the temperature rises.

Exercise 2: Proving the formulas of the least-squares line: the spring

7 answers to check

We have nn points (xi,yi)(x_{i}, y_{i}), the xix_{i} not all equal. For a line y=ax+by=ax+b, the vertical deviation of point ii is ei=yi−(axi+b)e_{i}=y_{i}-(ax_{i}+b), and we write S(a,b)=∑ei2S(a,b)=\sum e_{i}^{2}. The least-squares line is the one that makes S(a,b)S(a,b) minimal. Notation: Sxx=∑(xi−x‾)2S_{xx}=\sum (x_{i}-\overline{x})^{2}, Syy=∑(yi−y‾)2S_{yy}=\sum (y_{i}-\overline{y})^{2}, Sxy=∑(xi−x‾)(yi−y‾)S_{xy}=\sum (x_{i}-\overline{x})(y_{i}-\overline{y}) and r=SxySxxSyyr=\frac{S_{xy}}{\sqrt{S_{xx}S_{yy}}}.

Application: a spring is hung and its length LL is measured under six forces FF. The figure shows the scatter plot, an arbitrary line and its vertical deviations.

FF (N)001122334455
LL (cm)12.012.014.114.115.915.918.218.219.819.822.022.0
1234561012141618202224eᵢy = ax + b, a and b chosen freelyF (N)L (cm)
  • a) Fix aa. Show that SS is a quadratic polynomial in bb, minimal for b=y‾−ax‾b=\overline{y}-a\overline{x}. Deduce that the least-squares line passes through the mean point (x‾,y‾)(\overline{x}, \overline{y}).
  • b) Show that with this choice of bb, S=Syy−2aSxy+a2SxxS=S_{yy}-2aS_{xy}+a^{2}S_{xx}.
  • c) Deduce that SS is minimal for a=SxySxxa=\frac{S_{xy}}{S_{xx}}, that this minimum equals Syy(1−r2)S_{yy}(1-r^{2}), and then that −1≤r≤1-1\le r\le 1.
  • d) Compute SxxS_{xx}, SxyS_{xy}, then the equation of the least-squares line of LL as a function of FF.
  • e) Interpret the slope and the intercept in the context of the spring, then deduce the spring constant kk in N/m.
  • f) Compute SyyS_{yy}, then the minimum sum of squared deviations Syy(1−r2)S_{yy}(1-r^{2}).

Type your answers, the page tells you right or wrong 0/7

d)
e)
f)
Show the solution

Answers

  • a) SS is minimal for b=y‾−ax‾b=\overline{y}-a\overline{x}, so y‾=ax‾+b\overline{y}=a\overline{x}+b: the line passes through (x‾,y‾)(\overline{x}, \overline{y})
  • b) S=Syy−2aSxy+a2SxxS=S_{yy}-2aS_{xy}+a^{2}S_{xx}
  • c) a=SxySxxa=\frac{S_{xy}}{S_{xx}}, Smin⁡=Syy(1−r2)≥0S_{\min}=S_{yy}(1-r^{2})\ge 0, so r2≤1r^{2}\le 1
  • d) Sxx=17.5S_{xx}=17.5, Sxy=34.7S_{xy}=34.7; L^≈1.983F+12.04\hat{L}\approx 1.983F+12.04
  • e) Unstretched length ≈12.0\approx 12.0 cm; 1.981.98 cm per newton; k≈50.4k\approx 50.4 N/m
  • f) Syy=68.9S_{yy}=68.9; Smin⁡≈0.095S_{\min}\approx 0.095 cm²
a)

Let ui=yi−axiu_{i}=y_{i}-ax_{i}, fixed numbers since aa is fixed. Then S=∑(ui−b)2=nb2−2b∑ui+∑ui2S=\sum (u_{i}-b)^{2}=nb^{2}-2b\sum u_{i}+\sum u_{i}^{2}.

This is a quadratic polynomial in bb with leading coefficient n>0n>0: its parabola opens upward, and its minimum is at the vertex.

dSdb=2nb−2∑ui=0  ⟺  b=∑uin=y‾−ax‾\displaystyle \dfrac{dS}{db}=2nb-2\sum u_{i}=0\iff b=\dfrac{\sum u_{i}}{n}=\overline{y}-a\overline{x}

With this bb, ax‾+b=y‾a\overline{x}+b=\overline{y}: the mean point (x‾,y‾)(\overline{x}, \overline{y}) is on the line, whatever aa is, and therefore also on the optimal line.

b)

With b=y‾−ax‾b=\overline{y}-a\overline{x}, each deviation can be rewritten ei=(yi−y‾)−a(xi−x‾)e_{i}=(y_{i}-\overline{y})-a(x_{i}-\overline{x}).

ei2=(yi−y‾)2−2a(xi−x‾)(yi−y‾)+a2(xi−x‾)2\displaystyle e_{i}^{2}=(y_{i}-\overline{y})^{2}-2a(x_{i}-\overline{x})(y_{i}-\overline{y})+a^{2}(x_{i}-\overline{x})^{2}

Summing: S=Syy−2aSxy+a2SxxS=S_{yy}-2aS_{xy}+a^{2}S_{xx}.

c)

SS is now a quadratic polynomial in aa, with leading coefficient Sxx>0S_{xx}>0 (the xix_{i} are not all equal).

dSda=−2Sxy+2aSxx=0  ⟺  a=SxySxx\displaystyle \dfrac{dS}{da}=-2S_{xy}+2aS_{xx}=0\iff a=\dfrac{S_{xy}}{S_{xx}}
Smin⁡=Syy−2Sxy2Sxx+Sxy2Sxx=Syy−Sxy2Sxx=Syy(1−Sxy2SxxSyy)=Syy(1−r2)\displaystyle S_{\min}=S_{yy}-2\dfrac{S_{xy}^{2}}{S_{xx}}+\dfrac{S_{xy}^{2}}{S_{xx}}=S_{yy}-\dfrac{S_{xy}^{2}}{S_{xx}}=S_{yy}\left(1-\dfrac{S_{xy}^{2}}{S_{xx}S_{yy}}\right)=S_{yy}(1-r^{2})

A sum of squares is positive or zero: Syy(1−r2)≥0S_{yy}(1-r^{2})\ge 0, and Syy>0S_{yy}>0 as soon as the yiy_{i} are not all equal, so r2≤1r^{2}\le 1, that is, −1≤r≤1-1\le r\le 1.

Better still: r=±1r=\pm 1 exactly when Smin⁡=0S_{\min}=0, that is, when all the points lie on the line. This is the proof that rr measures ALIGNMENT.

It also shows why r2r^{2} is read as a proportion: 1−r2=Smin⁡Syy1-r^{2}=\dfrac{S_{\min}}{S_{yy}} is the share of the variation in yy that the line leaves unexplained.

d)

F‾=2.5\overline{F}=2.5 N and L‾=1026=17\overline{L}=\dfrac{102}{6}=17 cm.

Sxx=55−1526=17.5S_{xx}=55-\dfrac{15^{2}}{6}=17.5 and Sxy=289.7−15×1026=34.7S_{xy}=289.7-\dfrac{15\times 102}{6}=34.7

a=34.717.5≈1.983a=\dfrac{34.7}{17.5}\approx 1.983 cm/N, then b=17−1.983×2.5≈12.04b=17-1.983\times 2.5\approx 12.04 cm.

L^≈1.983 F+12.04\displaystyle \hat{L}\approx 1.983\,F+12.04
e)

The intercept is the predicted length with no force: the unstretched length of the spring, about 12.012.0 cm, in agreement with the measurement at 00 N.

The slope says that each additional newton stretches the spring by about 1.981.98 cm.

Hooke's law can be written L=L0+FkL=L_{0}+\dfrac{F}{k}: the slope equals 1k\dfrac{1}{k}, so k=11.983≈0.504k=\dfrac{1}{1.983}\approx 0.504 N/cm, or about 50.450.4 N/m.

This reading assumes that the spring stays within its elastic range, which the alignment of the six measurements makes plausible between 00 and 55 N, and only there.

Pitfall: taking the slope for the spring constant. Here L is on the vertical axis: the slope is the reciprocal of the spring constant, and it is in cm/N.

f)

Syy=1802.9−10226=68.9S_{yy}=1802.9-\dfrac{102^{2}}{6}=68.9 and r=34.717.5×68.9≈0.99931r=\dfrac{34.7}{\sqrt{17.5\times 68.9}}\approx 0.99931.

Smin⁡=68.9 (1−r2)=68.9−34.7217.5≈0.095S_{\min}=68.9\,(1-r^{2})=68.9-\dfrac{34.7^{2}}{17.5}\approx 0.095 cm²

The same value comes from summing the squares of the six residuals, −0.043-0.043, 0.0740.074, −0.109-0.109, 0.2090.209, −0.174-0.174, 0.0430.043: their sum is zero, as question a requires, and the sum of their squares is indeed 0.0950.095.

No other line does better: the one in the figure, drawn by eye, gives a much larger sum.

Exercise 3: Coefficient of determination, interpolation and extrapolation: an absorbance calibration

11 answers to check

To measure the iron content of drainage water from an old mine, the iron is converted into a red complex whose absorbance AA is measured at 480480 nm. Six standard solutions of known concentration cc give the table below. We assume that, over this range, AA is proportional to cc up to a small offset (Beer-Lambert law, valid for dilute solutions).

The figure shows the standards and the absorbance of sample E.

cc (mg/L)00224466881010
AA0.0030.0030.0980.0980.2040.2040.2970.2970.3990.3990.5050.505
246810120.10.20.30.40.50.6sample E: A = 0.352c (mg/L)A
  • a) Determine the least-squares line of AA as a function of cc.
  • b) Compute rr and r2r^{2}. Interpret r2r^{2} in one sentence.
  • c) Sample E has an absorbance of 0.3520.352. Determine its iron concentration. Is this an interpolation or an extrapolation?
  • d) The raw, undiluted water gives A=1.72A=1.72. Compute the concentration the line would give. Diluted five times, the same water gives A=0.398A=0.398: deduce its concentration. Which of the two values should be kept?
  • e) A classmate instead computes the line of cc as a function of AA, c^=a′A+b′\hat{c}=a'A+b'. Show that a a′=r2a\,a'=r^{2}, compute a′a' and compare it with 1a\frac{1}{a}.

Type your answers, the page tells you right or wrong 0/11

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) A^≈0.05009 c+0.0006\hat{A}\approx 0.05009\,c+0.0006
  • b) r≈0.99984r\approx 0.99984, r2≈0.9997r^{2}\approx 0.9997: the linear relationship explains 99.97%99.97\% of the variation in AA among the standards
  • c) cE≈7.02c_{E}\approx 7.02 mg/L, interpolation
  • d) Line: 34.334.3 mg/L, unreliable extrapolation; by dilution: 5×7.93≈39.75\times 7.93\approx 39.7 mg/L, the value to keep
  • e) a a′=r2a\,a'=r^{2}; a′≈19.96a'\approx 19.96 versus 1a≈19.97\frac{1}{a}\approx 19.97
a)

c‾=5\overline{c}=5 mg/L and A‾=1.5066=0.251\overline{A}=\dfrac{1.506}{6}=0.251.

Scc=220−3026=70S_{cc}=220-\dfrac{30^{2}}{6}=70 and ScA=11.036−30×1.5066=3.506S_{cA}=11.036-\dfrac{30\times 1.506}{6}=3.506

a=3.50670≈0.05009a=\dfrac{3.506}{70}\approx 0.05009 L/mg and b=0.251−0.05009×5≈0.0006b=0.251-0.05009\times 5\approx 0.0006.

A^≈0.05009 c+0.0006\displaystyle \hat{A}\approx 0.05009\,c+0.0006

The intercept is almost zero, as proportionality predicts: the blank barely absorbs.

b)

SAA=0.553664−1.50626≈0.17566S_{AA}=0.553664-\dfrac{1.506^{2}}{6}\approx 0.17566, so r=3.50670×0.17566≈0.99984r=\dfrac{3.506}{\sqrt{70\times 0.17566}}\approx 0.99984 and r2≈0.9997r^{2}\approx 0.9997.

Interpretation: between 00 and 1010 mg/L, the linear relationship with the concentration explains 99.97%99.97\% of the variation in the absorbance of the standards; the remaining 0.03%0.03\% comes from measurement error.

Pitfall: reading r=0.99984r=0.99984 as a percentage. It is r2r^{2}, the proportion 1−Smin⁡SAA1-\frac{S_{\min}}{S_{AA}} proved in exercise 2, that is read as a percentage.

c)

Invert the line: cE=0.352−0.00060.05009≈7.02c_{E}=\dfrac{0.352-0.0006}{0.05009}\approx 7.02 mg/L.

7.027.02 lies between 00 and 1010, the limits of the calibration range: this is an interpolation, the only kind of prediction the standards guarantee.

d)

A=1.72A=1.72 is far above the absorbance of the strongest standard, 0.5050.505. The line would give c=1.72−0.00060.05009≈34.3c=\dfrac{1.72-0.0006}{0.05009}\approx 34.3 mg/L: this is an extrapolation.

Nothing in the standards says that proportionality holds beyond 10 mg/L. At high absorbances, the Beer-Lambert law often stops holding and the instrument measures poorly.

The diluted solution, on the other hand, falls within the range: c=0.398−0.00060.05009≈7.93c=\dfrac{0.398-0.0006}{0.05009}\approx 7.93 mg/L, so the raw water contains 5×7.93≈39.75\times 7.93\approx 39.7 mg/L.

We keep 39.739.7 mg/L. The gap with 34.334.3 mg/L, about 14%14\%, shows what the extrapolation would have cost: the actual response bends beyond the range, and the extended line underestimates the concentration.

Pitfall: believing that an r² of 0.9997 guarantees the line everywhere. It judges the alignment of the measured points, and of those points only.

e)

The two slopes are a=ScAScca=\dfrac{S_{cA}}{S_{cc}} and a′=ScASAAa'=\dfrac{S_{cA}}{S_{AA}}.

a a′=ScA2SccSAA=r2\displaystyle a\,a'=\dfrac{S_{cA}^{2}}{S_{cc}S_{AA}}=r^{2}

a′=3.5060.17566≈19.96a'=\dfrac{3.506}{0.17566}\approx 19.96 mg/L per unit of absorbance, versus 1a≈19.97\dfrac{1}{a}\approx 19.97.

The two lines coincide only if r2=1r^{2}=1. The line of yy on xx minimizes the VERTICAL deviations, the line of xx on yy the horizontal ones: they are not the same deviations.

For a calibration, we regress AA on cc and then invert: the concentrations of the standards are known precisely and the error lies in the measured absorbance. Here r2r^{2} is so close to 11 that both methods give 7.027.02 mg/L for E.

510152025303540450.40.81.21.622.4rangeextended lineactual responseA = 1.72c (mg/L)A

Exercise 4: Contingency table and expected counts: the colour of hydrangeas

11 answers to check

A horticultural society records, in 200200 gardens, the flower colour of a hydrangea (blue, purple or pink) and the soil type, classified by its pH: acidic (pH below 66), neutral (pH from 66 to 77) or alkaline (pH above 77). One hydrangea is recorded per garden.

The critical value of the chi-square distribution with 44 degrees of freedom at the 1%1\% significance level is given: 13.27713.277.

Colour \ soilacidicneutralalkalineTotal
blue3814658
purple12201042
pink102664100
Total606080200
  • a) State the population, the two variables studied and their type.
  • b) Compute the percentage of blue flowers among the hydrangeas in acidic soil, in alkaline soil, then overall. What does the comparison suggest?
  • c) Let LiL_{i} be the total of row ii, CjC_{j} that of column jj and nn the overall total. Prove that, if colour and soil were independent, the expected count in cell (i,j)(i, j) would be Eij=Li CjnE_{ij}=\frac{L_{i}\,C_{j}}{n}.
  • d) Compute the expected counts of the cells (blue, acidic), (purple, neutral) and (pink, alkaline). Check that all the expected counts in the table are at least 55.
  • e) Show that, in each row, the expected counts have the same total as the observed counts. Deduce the number of cells that can be filled in freely, that is, the number of degrees of freedom.
  • f) Compute χ2\chi^{2}, then conclude at the 1%1\% level. Name the three cells that contribute the most.

Type your answers, the page tells you right or wrong 0/11

a)
b)
d)
e)
f)
Show the solution

Answers

  • a) Population: the hydrangeas of the 200 gardens; colour and soil type, two qualitative variables (soil type is ordinal)
  • b) 63.3%63.3\% in acidic soil, 7.5%7.5\% in alkaline soil, 29.0%29.0\% overall: the profiles differ clearly
  • c) Independence: P(Ai∩Bj)=P(Ai)P(Bj)P(A_{i}\cap B_{j})=P(A_{i})P(B_{j}), estimated by Lin⋅Cjn\frac{L_{i}}{n}\cdot\frac{C_{j}}{n}, hence Eij=n⋅Lin⋅Cjn=LiCjnE_{ij}=n\cdot\frac{L_{i}}{n}\cdot\frac{C_{j}}{n}=\frac{L_{i}C_{j}}{n}
  • d) 17.417.4; 12.612.6; 4040; the smallest is 12.6≥512.6\ge 5
  • e) ∑jEij=Li\sum_{j}E_{ij}=L_{i}; (3−1)(3−1)=4(3-1)(3-1)=4 degrees of freedom
  • f) χ2≈73.20>13.277\chi^{2}\approx 73.20>13.277: independence is rejected; cells (blue, acidic), (pink, alkaline), (pink, acidic)
a)

The population is that of the hydrangeas in the gardens studied; the statistical unit is one hydrangea, one per garden.

The two variables, flower colour and soil type, are qualitative. Soil type is even ordinal, since its three classes follow the order of the pH values.

It is the qualitative nature of both variables that calls for a contingency table and a chi-square test, not a regression line.

b)

Acidic soil: 3860≈63.3%\dfrac{38}{60}\approx 63.3\% blue flowers. Alkaline soil: 680=7.5%\dfrac{6}{80}=7.5\%. Overall: 58200=29.0%\dfrac{58}{200}=29.0\%.

We compare percentages computed within each column, called profiles: the raw counts cannot be compared, since the columns do not have the same total.

If colour did not depend on soil, each column would have roughly the overall profile, 29% blue flowers. The gap between 63.3% and 7.5% suggests a relationship, which remains to be tested.

Pitfall: dividing 38 by 58, the row total. That gives the share of blue flowers that grow in acidic soil, a different question.

c)

Choose a hydrangea at random. Let AiA_{i} be the event “its colour is in row ii” and BjB_{j} the event “its soil is in column jj”.

The observed frequencies estimate P(Ai)≈LinP(A_{i})\approx\dfrac{L_{i}}{n} and P(Bj)≈CjnP(B_{j})\approx\dfrac{C_{j}}{n}.

If the variables are independent, P(Ai∩Bj)=P(Ai) P(Bj)≈Lin⋅CjnP(A_{i}\cap B_{j})=P(A_{i})\,P(B_{j})\approx\dfrac{L_{i}}{n}\cdot\dfrac{C_{j}}{n}.

Out of nn hydrangeas, the expected count in the cell is therefore Eij=n⋅Lin⋅Cjn=Li CjnE_{ij}=n\cdot\dfrac{L_{i}}{n}\cdot\dfrac{C_{j}}{n}=\dfrac{L_{i}\,C_{j}}{n}.

d)

Eblue, acidic=58×60200=17.4E_{\text{blue, acidic}}=\dfrac{58\times 60}{200}=17.4, Epurple, neutral=42×60200=12.6E_{\text{purple, neutral}}=\dfrac{42\times 60}{200}=12.6 and Epink, alkaline=100×80200=40E_{\text{pink, alkaline}}=\dfrac{100\times 80}{200}=40.

The smallest expected count is the one for the row and the columns with the smallest totals: 42×60200=12.6\dfrac{42\times 60}{200}=12.6, shared by (purple, acidic) and (purple, neutral).

They are all at least 55: the condition for applying the test is met.

An expected count need not be a whole number: it is an expected average, not a count of hydrangeas.

e)

∑jEij=Lin∑jCj=Lin×n=Li\sum_{j}E_{ij}=\dfrac{L_{i}}{n}\sum_{j}C_{j}=\dfrac{L_{i}}{n}\times n=L_{i}: each expected row has the observed total. The same holds for each column.

Since the totals are fixed, it is enough to choose the cells of a sub-table with 2 rows and 2 columns: the last cell of each row and of each column follows.

The number of degrees of freedom is therefore (3−1)(3−1)=4(3-1)(3-1)=4.

f)

The nine contributions (O−E)2E\dfrac{(O-E)^{2}}{E} are, row by row: 24.3924.39, 0.660.66, 12.7512.75; then 0.030.03, 4.354.35, 2.752.75; then 13.3313.33, 0.530.53, 14.4014.40.

χ2≈73.20\chi^{2}\approx 73.20, far beyond the critical value 13.27713.277: the hypothesis of independence is rejected at the 1%1\% level.

The largest contributions come from (blue, acidic), 24.39, where 38 flowers are observed for 17.4 expected, from (pink, alkaline), 14.40, with 64 for 40, and from (pink, acidic), 13.33, with 10 for 30.

Conclusion: in these gardens, hydrangea colour is related to soil type; blue flowers dominate in acidic soil, pink ones in alkaline soil.

This is an observational survey: the test establishes the association, not its mechanism. The role of the soil is known from other sources, since soil aluminium is more available in acidic conditions, but other gardening practices could also follow the soil type.

63%20%17%acidic23%33%43%neutral12%80%alkaline29%21%50%overallbluepurplepink

Exercise 5: The chi-square test of independence from start to finish: treatment and germination

10 answers to check

To restore a meadow suitable for the monarch butterfly, a laboratory wants to germinate common milkweed seeds. It assigns 150150 seeds AT RANDOM to three treatments of 5050 seeds each: no treatment (control), 3030 days at 44 °C (cold), or a light abrasion of the seed coat (scarified). After 2121 days, it counts the germinated seeds.

Critical values of the chi-square distribution with 22 degrees of freedom: 5.9915.991 at the 5%5\% level and 9.2109.210 at the 1%1\% level. For 22 degrees of freedom, the density of the chi-square distribution is f(x)=12e−x/2f(x)=\frac{1}{2}e^{-x/2} for x≥0x\ge 0. The figure shows this density and the critical region at the 5%5\% level.

Outcome \ treatmentcontrolcoldscarifiedTotal
germinated22383090
not germinated28122060
Total505050150
24681012140.10.20.30.40.5c = 5.991area 0.052 degrees of freedomxdensity
  • a) State the null hypothesis H0H_{0} and the alternative hypothesis H1H_{1} in context.
  • b) Compute the six expected counts and check the condition for applying the test.
  • c) Compute the statistic χ2\chi^{2} and the number of degrees of freedom.
  • d) Conclude at the 5%5\% level, then at the 1%1\% level.
  • e) Prove that, for 22 degrees of freedom, P(χ2>c)=e−c/2P(\chi^{2}>c)=e^{-c/2}. Check the critical value 5.9915.991, then compute the P-value of the test.
  • f) Which cells contribute the most to χ2\chi^{2}? Can we conclude that cold INCREASES germination? And that scarification has no effect?

Type your answers, the page tells you right or wrong 0/10

b)
c)
d)
e)
f)
Show the solution

Answers

  • a) H0H_{0}: germination is independent of the treatment; H1H_{1}: it depends on it
  • b) 3030 for each “germinated” cell, 2020 for each “not germinated” cell; all ≥5\ge 5
  • c) χ2=323≈10.67\chi^{2}=\frac{32}{3}\approx 10.67; 22 degrees of freedom
  • d) 10.67>5.99110.67>5.991 and 10.67>9.21010.67>9.210: H0H_{0} is rejected at both levels
  • e) ∫c+∞12e−x/2dx=e−c/2\int_{c}^{+\infty}\frac{1}{2}e^{-x/2}dx=e^{-c/2}; e−5.991/2≈0.0500e^{-5.991/2}\approx 0.0500; p≈0.0048p\approx 0.0048
  • f) (not germinated, cold) and (not germinated, control), 3.203.20 each; yes to an effect of the treatment, since the trial is randomized; nothing is established for scarification alone
a)

H0H_{0}: the outcome, germinated or not, is independent of the treatment; the proportion of seeds that germinate is the same under all three treatments.

H1H_{1}: the outcome depends on the treatment; at least one treatment has a different germination proportion.

The chi-square test is global: its alternative says neither which treatment differs nor in which direction.

b)

Egerminated=90×50150=30E_{\text{germinated}}=\dfrac{90\times 50}{150}=30 in each column, and Enot germinated=60×50150=20E_{\text{not germinated}}=\dfrac{60\times 50}{150}=20.

The six expected counts are all at least 55: the condition for applying the test is met.

We also check that each seed is counted only once and that the seeds respond independently of one another, which we assume here.

c)

The deviations O−EO-E are −8-8, +8+8, 00 in the “germinated” row and +8+8, −8-8, 00 in the other.

χ2=6430+6430+0+6420+6420+0=323≈10.67\displaystyle \chi^{2}=\dfrac{64}{30}+\dfrac{64}{30}+0+\dfrac{64}{20}+\dfrac{64}{20}+0=\dfrac{32}{3}\approx 10.67

Degrees of freedom: (2−1)(3−1)=2(2-1)(3-1)=2.

d)

10.67>5.99110.67>5.991: the statistic falls in the critical region, so H0H_{0} is rejected at the 5%5\% level.

10.67>9.21010.67>9.210: it is also rejected at the 1%1\% level.

Conclusion: at the 1% level, the germination of common milkweed depends on the treatment received.

e)
P(χ2>c)=∫c+∞12e−x/2 dx=lim⁡M→+∞[−e−x/2]cM=e−c/2\displaystyle P(\chi^{2}>c)=\displaystyle\int_{c}^{+\infty}\frac{1}{2}e^{-x/2}\,dx=\lim_{M\to+\infty}\left[-e^{-x/2}\right]_{c}^{M}=e^{-c/2}

e−5.991/2≈0.0500e^{-5.991/2}\approx 0.0500: this indeed gives back the 5%5\% level.

P-value: p=P(χ2>10.67)=e−16/3≈0.0048p=P(\chi^{2}>10.67)=e^{-16/3}\approx 0.0048.

If the treatment had no effect, a deviation at least this large would appear only about 55 times in 10001000. Since p<0.01p<0.01, we recover the decision of d.

Only the distribution with 2 degrees of freedom gives such a simple formula: for the others, we read a table or integrate numerically.

f)

The contributions are 2.132.13, 2.132.13, 00, then 3.203.20, 3.203.20, 00. The largest, 3.203.20, are (not germinated, cold), with 1212 seeds for 2020 expected, and (not germinated, control), with 2828 for 2020.

Cold gives 3850=76%\dfrac{38}{50}=76\% germination versus 2250=44%\dfrac{22}{50}=44\% for the control.

The seeds were assigned at random: apart from the treatment, nothing distinguishes the three batches except chance, which the test has just made an unlikely explanation. The relationship shown can therefore be interpreted as an effect of the treatment, under the conditions of this trial.

Scarification, with 60% germination, contributes 0. This does not prove that it has no effect: the global test was not designed to compare two treatments with each other, and not observing a difference is not proving the absence of an effect.

Pitfall: writing that a dependence proves a cause in any study. Here it is the random assignment that allows the word “effect”.

24681012140.10.20.30.40.5c = 5.991area 0.052 degrees of freedomχ² = 10.67xdensity

Part B: problems and reasoning (/50)

Exercise 6: Outlier and influential point: latitude and temperature

13 answers to check

A climatology study records the mean annual temperature TT of seven lowland stations (elevation below 200200 m), spaced from south to north along the east coast of North America, as a function of their latitude xx. The values are fictitious but plausible.

Two more stations are then proposed: M, a mountaintop station at 4242 °N, at an elevation of about 23002300 m, where T=−5T=-5 °C; P, a coastal Arctic station at 7474 °N, where T=−10T=-10 °C. The figure shows the seven lowland stations and the points M and P, as open circles.

Latitude (°N)3030343438384141454548485252
TT (°C)21.021.016.516.514.014.010.510.57.57.53.53.51.51.5
253035404550556065707580−15−10−5510152025MPlatitude (°N)T (°C)
  • a) For the seven lowland stations, compute the slope aa and the intercept bb of the least-squares line of TT as a function of xx, and the coefficient rr.
  • b) M is added to the seven stations. Recompute rr and the slope. Compare.
  • c) P is added to the seven stations, without M. Recompute rr and the slope. Compare.
  • d) The slope can be written a=∑wi yi−y‾xi−x‾a=\sum w_{i}\,\frac{y_{i}-\overline{y}}{x_{i}-\overline{x}} with wi=(xi−x‾)2Sxxw_{i}=\frac{(x_{i}-\overline{x})^{2}}{S_{xx}} for xi≠x‾x_{i}\neq\overline{x}. Verify this expression, then compute the weight ww of P in case c and that of M in case b. Explain why P weighs on the slope and M hardly at all.
  • e) Should M be removed from the study? And P? Justify each decision.
  • f) Using the line of the seven lowland stations, predict the mean temperature at 6060 °N. Is this prediction reliable?

Type your answers, the page tells you right or wrong 0/13

a)
b)
c)
d)
e)
f)
Show the solution

Answers

  • a) a≈−0.899a\approx -0.899 °C per degree, b≈47.65b\approx 47.65 °C, r≈−0.9962r\approx -0.9962
  • b) With M: r≈−0.786r\approx -0.786, slope ≈−0.930\approx -0.930: rr drops, the slope barely moves
  • c) With P: r≈−0.984r\approx -0.984, slope ≈−0.704\approx -0.704: rr stays high, the slope changes by 22%22\%
  • d) wP≈63.1%w_{P}\approx 63.1\%, wM≈0.15%w_{M}\approx 0.15\%: the weight grows as the square of the distance from x‾\overline{x}
  • e) M: set aside and reported, because its elevation places it in another population; P: the line is not extended to it, it is studied separately
  • f) T^≈−6.3\hat{T}\approx -6.3 °C; extrapolation beyond 5252 °N, not guaranteed
a)

x‾=2887≈41.14\overline{x}=\dfrac{288}{7}\approx 41.14 and T‾=74.57≈10.64\overline{T}=\dfrac{74.5}{7}\approx 10.64.

Sxx=12,214−28827≈364.86S_{xx}=12{,}214-\dfrac{288^{2}}{7}\approx 364.86, SxT=2737−288×74.57≈−328.14S_{xT}=2737-\dfrac{288\times 74.5}{7}\approx -328.14, STT=1090.25−74.527≈297.36S_{TT}=1090.25-\dfrac{74.5^{2}}{7}\approx 297.36

a=−328.14364.86≈−0.899a=\dfrac{-328.14}{364.86}\approx -0.899 °C per degree of latitude, b=10.64+0.899×41.14≈47.65b=10.64+0.899\times 41.14\approx 47.65 °C.

r=−328.14364.86×297.36≈−0.9962r=\dfrac{-328.14}{\sqrt{364.86\times 297.36}}\approx -0.9962: very strong decreasing linear relationship.

In the lowlands, the temperature drops on average by 0.9 °C per degree of latitude northward, over the observed range from 30 to 52 °N.

b)

With M, over eight stations: x‾=41.25\overline{x}=41.25, Sxx=365.5S_{xx}=365.5, SxT≈−339.88S_{xT}\approx -339.88, STT≈511.47S_{TT}\approx 511.47.

r≈−0.786r\approx -0.786 and the slope is ≈−0.930\approx -0.930.

The coefficient collapses, r2r^{2} dropping from 0.9920.992 to 0.6180.618: M is an outlier, far below the line, about 1515 °C colder than predicted for its latitude.

But the slope changes by only 3%: M lies in the middle of the latitudes, so it pulls the scatter plot down without rotating it.

c)

With P, over eight stations: x‾=45.25\overline{x}=45.25, Sxx=1309.5S_{xx}=1309.5, SxT≈−921.63S_{xT}\approx -921.63, STT≈670.22S_{TT}\approx 670.22.

r≈−0.984r\approx -0.984 and the slope is ≈−0.704\approx -0.704.

The coefficient stays very strong, but the slope goes from −0.899-0.899 to −0.704-0.704, that is, 22%22\% less: a single point out of eight has rotated the line.

P is an influential point. Its temperature, −10-10 °C, is about 99 °C above what the lowland line predicts, −18.9-18.9 °C.

Pitfall: judging the effect of a point on r alone. The coefficient does not see that a line has rotated.

d)

wi yi−y‾xi−x‾=(xi−x‾)(yi−y‾)Sxxw_{i}\,\dfrac{y_{i}-\overline{y}}{x_{i}-\overline{x}}=\dfrac{(x_{i}-\overline{x})(y_{i}-\overline{y})}{S_{xx}}: the sum gives back SxySxx=a\dfrac{S_{xy}}{S_{xx}}=a, and a point with abscissa x‾\overline{x} contributes nothing.

The slope is therefore a weighted average of the slopes joining each point to the mean point, and the weights wiw_{i} add up to 11.

For P: wP=(74−45.25)21309.5≈0.631w_{P}=\dfrac{(74-45.25)^{2}}{1309.5}\approx 0.631, that is, 63.1%63.1\% of all the weight, on its own.

For M: wM=(42−41.25)2365.5≈0.0015w_{M}=\dfrac{(42-41.25)^{2}}{365.5}\approx 0.0015, that is, 0.15%0.15\%.

The weight of a point grows as the SQUARE of its distance from the mean of the x values: this is the leverage effect. A point far away in x decides the slope; a point in the centre hardly affects it, even when it is very far away in y.

e)

M: the mountaintop station does not belong to the population studied, the lowland stations. Its deviation is explained by a third variable, elevation: the temperature drops by several degrees per kilometre of altitude.

We therefore set it aside from this regression, SAYING so in the report and defining the population (elevation below 200 m). A point is never removed without saying which one and why.

P: the Arctic station does belong to the population, but it lies outside the range of latitudes over which the linear relationship was established. Its deviation suggests that the relationship changes beyond that range, under the influence of other factors such as the ocean.

We therefore do not extend the line to it: we present the line for 30 to 52 °N, and we point out that Arctic regions call for a separate study, with more stations.

In both cases, the decision comes from knowledge of the phenomenon, not from the wish to improve r.

f)

T^=−0.899×60+47.65≈−6.3\hat{T}=-0.899\times 60+47.65\approx -6.3 °C

6060 °N lies outside the observed range, from 3030 to 5252 °N: this is an extrapolation.

Station P has just shown that the lowland relationship does not carry on unchanged toward the north. The value −6.3 °C is only an indication, to be confirmed by measurements.

253035404550556065707580−25−20−15−10−5510152025PMwithout P: slope −0.90with P: slope −0.70latitude (°N)T (°C)

Exercise 7: The expected count condition and the effect of sample size: blood group and treatment

9 answers to check

An observational study follows 120120 patients treated with an experimental antiviral drug (fictitious). For each patient, the blood group and the response to treatment after two weeks, favourable or not, are recorded. The researchers obviously did not assign the patients to blood groups.

For 22 degrees of freedom: critical value 5.9915.991 at the 5%5\% level, and P(χ2>c)=e−c/2P(\chi^{2}>c)=e^{-c/2}.

Group \ responsefavourablenot favourableTotal
O302454
A311546
B7714
AB426
Total7248120
  • a) Compute the expected counts of row AB. Can the chi-square test be applied to the table as it stands?
  • b) Groups B and AB are combined into a single row. Justify this grouping, write the new table and give its number of degrees of freedom.
  • c) Compute χ2\chi^{2} for the combined table and conclude at the 5%5\% level.
  • d) Write the conclusion in context.
  • e) Prove that, if all the observed counts are multiplied by the same number k>0k>0, the statistic χ2\chi^{2} is multiplied by kk.
  • f) A study of 480480 patients finds EXACTLY the same proportions in the combined table. Compute its χ2\chi^{2} and its P-value, and conclude. Is the relationship stronger than in the study of 120120 patients?

Type your answers, the page tells you right or wrong 0/9

a)
b)
c)
f)
Show the solution

Answers

  • a) 3.63.6 and 2.42.4, below 55: test not applicable as it stands
  • b) B and AB both carry the B antigen; rows O, A, B or AB; (3−1)(2−1)=2(3-1)(2-1)=2 degrees of freedom
  • c) χ2≈1.70<5.991\chi^{2}\approx 1.70<5.991: do not reject H0H_{0}
  • d) At the 5% level, these data do not show a relationship between blood group and response; they do not prove independence
  • e) OO and EE are multiplied by kk, and so is each term (O−E)2E\frac{(O-E)^{2}}{E}
  • f) χ2≈6.80>5.991\chi^{2}\approx 6.80>5.991, p≈0.033p\approx 0.033: rejection; same relationship, more evidence
a)

EAB, favourable=6×72120=3.6E_{\text{AB, favourable}}=\dfrac{6\times 72}{120}=3.6 and EAB, not favourable=6×48120=2.4E_{\text{AB, not favourable}}=\dfrac{6\times 48}{120}=2.4.

These two expected counts are below 55: the condition for applying the test is not met, and the test cannot be applied to the table as it stands.

The reason: the statistic χ2\chi^{2} follows the chi-square distribution only APPROXIMATELY, and the approximation deteriorates when the expected counts are small. A small EE in the denominator also inflates a contribution at the slightest deviation.

b)

Groups B and AB have in common that they carry the B antigen: combining them makes biological sense. A grouping is decided on the meaning of the categories, ideally before seeing the results, never in order to obtain a rejection.

New table: O, 3030 and 2424; A, 3131 and 1515; B or AB, 1111 and 99, for a total of 2020.

Expected counts: 32.432.4 and 21.621.6; 27.627.6 and 18.418.4; 1212 and 88. They are all at least 55.

Degrees of freedom: (3−1)(2−1)=2(3-1)(2-1)=2. Combining has cost one degree of freedom, and part of the information about group AB.

c)

Contributions: 0.1780.178, 0.2670.267, 0.4190.419, 0.6280.628, 0.0830.083, 0.1250.125.

χ2≈1.70\chi^{2}\approx 1.70, less than 5.9915.991: H0H_{0} is not rejected at the 5%5\% level.

P-value: e−1.70/2≈0.43e^{-1.70/2}\approx 0.43. A deviation at least this large would appear nearly one time in two with no relationship at all.

d)

“At the 5% level, the data from these 120 patients do not allow us to conclude that there is a relationship between blood group and response to treatment.”

We do not write “blood group has no influence”: a weak relationship may exist and remain invisible with 120 patients. Not rejecting H0 means lacking evidence, not proving independence.

Pitfall: treating a failure to reject as a proof of the null hypothesis. Question f shows what happens with more patients.

e)

The new totals are kLikL_{i}, kCjkC_{j} and knkn, so Eij′=kLi kCjkn=kEijE'_{ij}=\dfrac{kL_{i}\,kC_{j}}{kn}=kE_{ij}.

(kOij−kEij)2kEij=k2(Oij−Eij)2kEij=k (Oij−Eij)2Eij\displaystyle \dfrac{(kO_{ij}-kE_{ij})^{2}}{kE_{ij}}=\dfrac{k^{2}(O_{ij}-E_{ij})^{2}}{kE_{ij}}=k\,\dfrac{(O_{ij}-E_{ij})^{2}}{E_{ij}}

Summing, χ′2=k χ2\chi'^{2}=k\,\chi^{2}. The degrees of freedom do not change, since the table keeps its dimensions.

f)

480=4×120480=4\times 120: by e, χ2=4×1.70≈6.80\chi^{2}=4\times 1.70\approx 6.80.

6.80>5.9916.80>5.991: H0H_{0} is rejected at the 5%5\% level, with a P-value of e−6.80/2≈0.033e^{-6.80/2}\approx 0.033.

The relationship is not stronger: the proportions are identical, for example 56% favourable responses among group O patients in both studies. What has changed is the amount of evidence: with 480 patients, the same deviation can no longer reasonably be explained by chance.

The chi-square test judges the EXISTENCE of a relationship, not its strength. To describe the strength, we compare the profiles: 3146≈67%\dfrac{31}{46}\approx 67\% favourable responses in group A versus 3054≈56%\dfrac{30}{54}\approx 56\% in group O.

Even when significant, this relationship remains observed, not produced by an intervention: blood group could be associated with another characteristic of the patients that does influence the response.

Exercise 8: Five statements to correct

6 answers to check

Each of the following five statements, taken from lab reports, is false. For each one, choose the right correction, then explain the error in one or two sentences. Two points per statement.

  • a) “For the seven lowland stations of exercise 6, r=−0.996r=-0.996: latitude explains 99.6%99.6\% of the temperature differences between these stations.”
  • b) “Between 1010 and 6060 °C, the activity of an enzyme and the temperature give r=0.01r=0.01: temperature has no effect on this enzyme.”
  • c) “In exercise 7, the chi-square test on 120120 patients does not reject H0H_{0} at the 5%5\% level: blood group and response to treatment are therefore independent.”
  • d) “To save time, we apply the chi-square test to the percentages of the germination table of exercise 5 rather than to its counts: the conclusion is the same.”
  • e) “The spring of exercise 2 follows L^=1.983F+12.04\hat{L}=1.983F+12.04 with r2=0.9986r^{2}=0.9986: under a force of 4040 N, it will be 91.491.4 cm long.”

Type your answers, the page tells you right or wrong 0/6

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) r2≈0.992r^{2}\approx 0.992: 99.2%99.2\% of the variation in TT is explained by the linear relationship with latitude
  • b) Bell-shaped relationship, very strong but nonlinear: r does not see it
  • c) Do not reject H0: no relationship shown, which does not prove independence
  • d) On the percentages of the total, χ2=10.67×100150≈7.11\chi^{2}=10.67\times\frac{100}{150}\approx 7.11: the test is done only on counts
  • e) Extrapolation from 55 to 4040 N: outside the range over which the spring was studied
a)

It is the coefficient of determination that is read as a percentage: r2=(−0.9962)2≈0.992r^{2}=(-0.9962)^{2}\approx 0.992.

Correction: “the linear relationship with latitude explains about 99.2% of the variation in mean temperature among these seven stations”.

“Explains” is meant in the statistical sense, a share of variance, and only for the lowland stations from 30 to 52 °N.

b)

rr measures how well the points align on a LINE. The activity of an enzyme rises up to an optimal temperature and then drops: the scatter plot forms a bell, and its two halves cancel each other out in rr.

Here, with the six measurements shown in the solution, r≈0.01r\approx 0.01 even though temperature takes the activity from 66 to 4949: the relationship is strong, it is just not linear.

Correction: “r is almost zero: there is no LINEAR relationship; the scatter plot shows a bell-shaped relationship, with an optimum around 35 °C”.

Always look at the scatter plot before computing r.

c)

Not rejecting H0H_{0} means that the observed deviation remains compatible with chance, for these 120120 patients.

Exercise 7 shows that with the same proportions over 480 patients, the test rejects H0: a weak relationship can escape a small sample.

Correction: “at the 5% level, these data do not allow us to conclude that there is a relationship”.

d)

The table in percentages of the total amounts to a sample of 100100 seeds instead of 150150.

By exercise 7, multiplying the counts by 100150\frac{100}{150} multiplies χ2\chi^{2} by 100150\frac{100}{150}: 10.67×23≈7.1110.67\times\frac{2}{3}\approx 7.11 instead of 10.6710.67.

Here both values exceed 5.9915.991, but with 10001000 individuals, switching to percentages would divide χ2\chi^{2} by 1010 and could reverse the decision.

Correction: “the chi-square test is always done on the observed counts; percentages are used to describe the profiles”.

e)

The calculation is right: 1.983×40+12.04≈91.41.983\times 40+12.04\approx 91.4 cm. It is the prediction that is not.

The spring was studied from 00 to 55 N; 4040 N is eight times the heaviest load measured. Beyond its elastic limit, a spring is permanently deformed and Hooke's law no longer applies.

Correction: “the line describes the spring between 0 and 5 N; under 40 N, we must measure, or know the elastic limit given by the manufacturer”.

An r² very close to 1 judges the alignment of the measured points, never what happens beyond them.

10203040506070102030405060r = 0.01T (°C)activity
Statement b: six activity measurements, bell-shaped around an optimum near 3535 °C; the relationship is very strong, and yet r≈0.01r\approx 0.01.

Exercise 9: Problem: when the line does not fit, the mass and length of garter snakes

13 answers to check

A herpetology team captures six common garter snakes from the same population and measures their total length LL and their mass mm. The data are fictitious but plausible.

The figure shows the scatter plot.

LL (cm)303040405050606070708080
mm (g)1111272753539090145145214214
203040506070809050100150200250L (cm)m (g)
  • a) Compute the least-squares line of mm as a function of LL, as well as r2r^{2}.
  • b) Compute the six residuals. Describe the sequence of their signs and say what it reveals about the linear model.
  • c) Consider the model m=k Lpm=k\,L^{p}. Show that it becomes linear by setting X=ln⁡LX=\ln L and Y=ln⁡mY=\ln m, then compute the least-squares line of YY as a function of XX and its coefficient rr.
  • d) Deduce pp and kk, then predict the mass of a 6565 cm garter snake with each of the two models.
  • e) Interpret the value of pp: what would happen to the mass if the snake kept exactly the same shape as it grew?

Type your answers, the page tells you right or wrong 0/13

a)
b)
c)
d)
Show the solution

Answers

  • a) m^≈4.017L−130.94\hat{m}\approx 4.017L-130.94; r2≈0.942r^{2}\approx 0.942
  • b) 21.421.4; −2.7-2.7; −16.9-16.9; −20.1-20.1; −5.3-5.3; 23.623.6: positive at the ends, negative in the middle; linear model unsuitable
  • c) Y=pX+ln⁡kY=pX+\ln k; Y^≈3.021X−7.862\hat{Y}\approx 3.021X-7.862, r≈0.99994r\approx 0.99994
  • d) p≈3.02p\approx 3.02, k≈3.85×10−4k\approx 3.85\times 10^{-4}; at 6565 cm: 115115 g (power) versus 130130 g (line)
  • e) Shape preserved: m∝L3m\propto L^{3}; p≈3p\approx 3 is consistent with growth that preserves shape
a)

L‾=55\overline{L}=55 cm and m‾=90\overline{m}=90 g; SLL=19,900−33026=1750S_{LL}=19{,}900-\dfrac{330^{2}}{6}=1750 and SLm=36,730−330×5406=7030S_{Lm}=36{,}730-\dfrac{330\times 540}{6}=7030.

a=70301750≈4.017a=\dfrac{7030}{1750}\approx 4.017 g/cm and b=90−4.017×55≈−130.94b=90-4.017\times 55\approx -130.94 g, so m^≈4.017L−130.94\hat{m}\approx 4.017L-130.94.

Smm=78,580−54026=29,980S_{mm}=78{,}580-\dfrac{540^{2}}{6}=29{,}980, hence r=70301750×29,980≈0.971r=\dfrac{7030}{\sqrt{1750\times 29{,}980}}\approx 0.971 and r2≈0.942r^{2}\approx 0.942.

The coefficient is high; it does not yet justify anything. The line predicts 4.017×30−130.94≈−10.44.017\times 30-130.94\approx -10.4 g for the smallest snake MEASURED, a negative mass: it gives m^<0\hat{m}<0 as soon as L<32.6L<32.6 cm.

b)

Residuals e=m−m^e=m-\hat{m}, in order of length: 21.421.4, −2.7-2.7, −16.9-16.9, −20.1-20.1, −5.3-5.3, 23.623.6 g.

Their sum is zero, as for any least-squares line; it is their ORDER that speaks: positive at both ends, negative in the middle.

This U pattern, visible on the residual plot, says that the scatter plot is curved: the line passes below the points at the ends and above those in the middle.

The linear model is not appropriate, despite r² = 0.942.

Pitfall: judging a model on r² alone. A clearly curved scatter plot can give a high r²; only the scatter plot and the residuals show the shape.

c)

ln⁡m=ln⁡k+pln⁡L\ln m=\ln k+p\ln L, that is, Y=pX+ln⁡kY=pX+\ln k: a linear relationship between XX and YY, with slope pp and intercept ln⁡k\ln k.

XX: 3.40123.4012, 3.68893.6889, 3.91203.9120, 4.09434.0943, 4.24854.2485, 4.38204.3820.

YY: 2.39792.3979, 3.29583.2958, 3.97033.9703, 4.49984.4998, 4.97674.9767, 5.36605.3660.

SXX≈0.66727S_{XX}\approx 0.66727 and SXY≈2.01580S_{XY}\approx 2.01580, so the slope is ≈3.021\approx 3.021 and the intercept Y‾−3.021 X‾≈−7.862\overline{Y}-3.021\,\overline{X}\approx -7.862.

r≈0.99994r\approx 0.99994: the transformed points are aligned, and the residuals of this line no longer show any pattern.

d)

p≈3.02p\approx 3.02 and k=e−7.862≈3.85×10−4k=e^{-7.862}\approx 3.85\times 10^{-4}, in grams for LL in centimetres: m≈3.85×10−4 L3.02m\approx 3.85\times 10^{-4}\,L^{3.02}.

At 6565 cm: power model, 3.85×10−4×653.02≈1153.85\times 10^{-4}\times 65^{3.02}\approx 115 g; line, 4.017×65−130.94≈1304.017\times 65-130.94\approx 130 g.

Both predictions are interpolations, but the line overestimates: between 60 and 70 cm, its residuals are negative, so it passes above the points.

Pitfall: predicting with rounded values of the transformed slope and intercept. Keep all the decimals until k is computed.

e)

If the shape were preserved, all the lengths of the body would be multiplied by the same factor λ\lambda, the volume by λ3\lambda^{3}, and so would the mass, the density being roughly constant: m∝L3m\propto L^{3}.

The slope obtained, p≈3.02p\approx 3.02, is very close to 33: the data are consistent with growth that preserves shape, called isometric growth.

With six snakes, we cannot claim that p is exactly 3: that would require a test on the slope, which goes beyond the minimum of the course specification, and more individuals.

It is the physical model, the volume, that suggested the right transformation: the number r² alone would never have indicated the shape.

255075−30−20−10102030the residuals form a UL (cm)residual (g)
Residuals of the line as a function of length: positive at both ends, negative in the middle, a U that betrays the curvature.
3.23.43.63.844.24.44.622.533.544.555.56slope 3.02; r = 0.9999ln Lln m
After taking logarithms: the six points are aligned, with slope 3.023.02.

Exercise 10: Problem: a complete study, the salamanders of a forest

15 answers to check

An ecology team surveys the salamanders of a deciduous forest over one season. Each salamander captured is marked, so that no individual is counted twice. The data are fictitious but plausible.

Document 1: 200200 salamanders classified by species (eastern red-backed, two-lined, spotted) and by capture habitat. Critical values of the chi-square distribution with 44 degrees of freedom: 9.4889.488 at the 5%5\% level, 13.27713.277 at the 1%1\% level.

Document 2: on eight plots of the wooded slope, the soil moisture xx (in %) and the number yy of red-backed salamanders found under boards laid on the ground. It is given before question d.

Species \ habitatwooded slopestream edgetemporary pondTotal
red-backed34222480
two-lined14281860
spotted16162860
Total646670200
  • a) Document 1. State H0H_{0}, compute the expected counts of the three cells of the “red-backed” row and check the condition for applying the test.
  • b) Compute χ2\chi^{2} and the number of degrees of freedom. Conclude at the 5%5\% level, then at the 1%1\% level.
  • c) Name the two cells that contribute the most to the statistic and describe what they show.
  • d) Document 2. Compute the least-squares line of yy as a function of xx, then rr and r2r^{2}.
  • e) Predict the number of red-backed salamanders for a soil moisture of 35%35\%, then of 10%10\%. Comment.
  • f) Write the conclusion of the study in four sentences at most: what it shows, and what it does not show.

Type your answers, the page tells you right or wrong 0/15

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) H0H_{0}: species and habitat independent; 25.625.6; 26.426.4; 2828; smallest EE: 19.2≥519.2\ge 5
  • b) χ2≈12.89\chi^{2}\approx 12.89, 44 degrees of freedom; rejection at 5%5\%, no rejection at 1%1\%
  • c) (two-lined, stream), 3.40, and (red-backed, slope), 2.76: each species is overrepresented in one habitat
  • d) y^≈0.349x−4.72\hat{y}\approx 0.349x-4.72; r≈0.939r\approx 0.939, r2≈0.882r^{2}\approx 0.882
  • e) 7.57.5 salamanders at 35%35\%; −1.2-1.2 at 10%10\%, absurd extrapolation
  • f) Species-habitat association significant at 5%, and increasing linear relationship with moisture within the observed range; observational study: no causation shown, no validity outside the range
a)

H0H_{0}: in this forest, the species of a salamander is independent of its capture habitat.

Ered-backed, slope=80×64200=25.6E_{\text{red-backed, slope}}=\dfrac{80\times 64}{200}=25.6, Ered-backed, stream=80×66200=26.4E_{\text{red-backed, stream}}=\dfrac{80\times 66}{200}=26.4, Ered-backed, pond=80×70200=28E_{\text{red-backed, pond}}=\dfrac{80\times 70}{200}=28.

The smallest expected count is 60×64200=19.2\dfrac{60\times 64}{200}=19.2: they all exceed 55.

Marking guarantees the other condition: each observation is a different individual. A salamander recaptured three times would have been counted three times and would have biased the test.

b)

The nine contributions are 2.762.76, 0.730.73, 0.570.57; then 1.411.41, 3.403.40, 0.430.43; then 0.530.53, 0.730.73, 2.332.33.

χ2≈12.89\chi^{2}\approx 12.89 with (3−1)(3−1)=4(3-1)(3-1)=4 degrees of freedom.

12.89>9.48812.89>9.488: H0H_{0} is rejected at the 5%5\% level. 12.89<13.27712.89<13.277: it is not rejected at the 1%1\% level.

The conclusion therefore depends on the level, which must be chosen BEFORE seeing the data. At the usual 5% level, we conclude that there is an association between species and habitat.

c)

The largest contribution, 3.403.40, is (two-lined, stream): 2828 captures for 19.819.8 expected, that is, 2860≈47%\dfrac{28}{60}\approx 47\% of the two-lined salamanders were caught at the stream edge, versus 33%33\% of all salamanders.

Next comes (red-backed, slope), 2.762.76: 3434 captures for 25.625.6 expected.

Each species is overrepresented in a different habitat; the spotted salamander is also overrepresented near the ponds, with 2.33.

d)

x‾=2838=35.375\overline{x}=\dfrac{283}{8}=35.375 and y‾=618=7.625\overline{y}=\dfrac{61}{8}=7.625.

Sxx=10,951−28328≈939.88S_{xx}=10{,}951-\dfrac{283^{2}}{8}\approx 939.88, Sxy=2486−283×618≈328.13S_{xy}=2486-\dfrac{283\times 61}{8}\approx 328.13, Syy=595−6128≈129.88S_{yy}=595-\dfrac{61^{2}}{8}\approx 129.88.

a=328.13939.88≈0.349a=\dfrac{328.13}{939.88}\approx 0.349 salamander per point of moisture, b=7.625−0.349×35.375≈−4.72b=7.625-0.349\times 35.375\approx -4.72.

r=328.13939.88×129.88≈0.939r=\dfrac{328.13}{\sqrt{939.88\times 129.88}}\approx 0.939 and r2≈0.882r^{2}\approx 0.882: the linear relationship with moisture explains about 88%88\% of the variation in the number of salamanders between plots.

The scatter plot shows neither curvature nor an isolated point, which justifies this linear model.

e)

At 35%35\%: y^=0.349×35−4.72≈7.5\hat{y}=0.349\times 35-4.72\approx 7.5 salamanders on average, an interpolation within the range 1818 to 52%52\%.

At 10%10\%: y^=0.349×10−4.72≈−1.2\hat{y}=0.349\times 10-4.72\approx -1.2, a NEGATIVE number of salamanders.

The absurd result signals the extrapolation: below 18%, no data say how the number varies. It probably tends toward 0 without ever becoming negative, and the line stops describing the phenomenon.

f)

In this forest, salamander species and habitat are associated at the 5% level (not at the 1% level), each species being overrepresented in one habitat; on the slope, the number of red-backed salamanders increases with soil moisture, by about 0.35 individual per point of moisture between 18 and 52%.

This is an observational study: it shows associations, not causes. Moisture varies with other factors, such as forest cover or dead wood, which could explain part of the relationship.

The results hold for this forest, this season and the observed moisture range; extending them elsewhere would require new plots, and attributing the effect to moisture would require an experiment in which moisture is varied.

Pitfall: concluding “moisture attracts salamanders” or “the stream edge produces two-lined salamanders”. The study design only allows the word “associated”.

Something missing from this set? A type of exercise your teacher gives, a problem you are stuck on, a mistake you spotted: tell me, I read every request.

Sending goes through your free space: that is how I can answer you and tell you when the exercise is added. An email is enough, no password. Create your space. Rather not create an account? Write to me directly.

What is it about?
I read every request myself, nobody else sees it. No need to write your name or your school.
When your request is dealt with, you hear about it by email and in your space.

By sending, you agree that I read your request to answer it. It is kept with your account, erased with it, and never published: privacy policy.

© Ahmed Squalli Houssaini. Exercise set published at www.letuteurscientifique.ca/en/exercices/cegep-sn1-regression-chi-square. Free for personal and classroom use; republishing it elsewhere requires written permission (legal notice).

Looking for a probability and statistics tutor in Montreal?

Get in touch for a first session. Regression and the chi-square test come back on the final exam as a complete study: the reasoning and the written conclusion are graded first, then the calculations, and that is exactly what we work on in a session.

Site by Studio Squalli