Pick a symbol in the bar, or tap it in any formula, to highlight it throughout the notes.
4
Sampling distributions
Statistics are random variables: they have an expectation, a variance and a distribution.
Concepts
Concept
Random sample, statistic and sampling distribution
Random sample: a set of \(n\) independent random variables \(X_1,\dots,X_n\), each with the same distribution \(f(x)\) as the variable under study.
Statistic: a random variable defined as a function of the random sample (mean, variance, relative frequency…). Its value changes from sample to sample.
Sampling distribution: the probability distribution of a statistic. Knowing its expectation, variance and shape is what makes it possible to estimate and to test hypotheses.
Parameter = fixed, unknown number of the population (\(\pmu,\ \psig^2,\ \pp\)). Statistic = number computed from the sample (\(\bar x,\ s^2,\ h\)).
Statistics and their distributions
Statistic
Sample mean \(\bar X\)
It varies around the population mean, and its spread shrinks as \(n\) grows.
If the original variable is normal, \(X\sim N(\pmu_X;\psig_X)\), the mean is normal too for any \(n\). Subtracting its expectation and dividing by its standard deviation gives \(Z\), the standardized mean, which follows a standard normal (mean 0, standard deviation 1):
$$E(\bar X)=E\Big(\tfrac1n\sum X_i\Big)=\tfrac1n\big[E(X_1)+\dots+E(X_n)\big]=\tfrac1n\,n\pmu_X=\pmu_X$$Linearity of expectation; each \(X_i\) has the distribution of \(X\).
$$V(\bar X)=\tfrac1{n^2}V\Big(\sum X_i\Big)=\tfrac1{n^2}\big[V(X_1)+\dots+V(X_n)\big]=\tfrac{1}{n^2}\,n\psig^2_X=\frac{\psig^2_X}{n}$$The constant comes out squared; the \(X_i\) are independent, so the variance of the sum is the sum of the variances.
Concept · theorem
Central Limit Theorem
If \(X\) has any distribution with mean \(\pmu_X\) and standard deviation \(\psig_X\), for large enough \(n\):
Rule of thumb: the approximation is valid for \(n\gt 30\). The more skewed \(X\) is, the larger the \(n\) needed. If \(X\) is already normal, \(\bar X\) is normal for any \(n\).
Statistic
Relative frequency \(h(A)\)
Let \(A\) be the event of interest, \(\pp=P(A)\) its probability and \(\pq=1-\pp\). Define \(X=1\) if \(A\) occurs and \(X=0\) otherwise (a Bernoulli variable). If \(f(A)\) is the absolute frequency (number of times \(A\) occurs in the \(n\) trials), then \(h(A)=\frac{f(A)}{n}=\frac{\sum X_i}{n}=\bar X\): the relative frequency is a sample mean.
$$E(X)=0\cdot \pq+1\cdot \pp=\pp$$Definition of the expectation of a discrete variable.
$$V(X)=(0-\pp)^2\pq+(1-\pp)^2\pp=\pp^2\pq+\pq^2\pp=\pp\pq(\pp+\pq)=\pp\pq$$Definition of variance and \(\pp+\pq=1\).
$$E(h)=E(\bar X)=\pp,\qquad V(h)=V(\bar X)=\frac{V(X)}{n}=\frac{\pp\pq}{n}$$Results for the mean applied to a Bernoulli \(X\); normality follows from the CLT (in practice \(n\gt30\)).
Statistic
Sample variance \(S^2\)
The sample variance is \(S^2=\frac{1}{n-1}\sum_{i=1}^n(X_i-\bar X)^2\). Define \(U\), the standardized sample variance: \(S^2\) multiplied by its degrees of freedom \(n-1\) and divided by the population variance \(\psig_X^2\). If \(X\sim N(\pmu_X;\psig_X)\), \(U\) follows a chi-square distribution with \(n-1\) degrees of freedom (\(\chi^2_{n-1}\)):
$$S^2=\frac{U\,\psig^2_X}{n-1},\qquad E(U)=n-1,\quad V(U)=2(n-1)$$Solving for \(S^2\); the expectation and variance of a chi-square are \(gl\) and \(2\,gl\).
$$E(S^2)=\frac{\psig^2_X}{n-1}E(U)=\frac{\psig^2_X}{n-1}(n-1)=\psig^2_X$$The constant comes out of the expectation.
$$V(S^2)=\Big(\frac{\psig^2_X}{n-1}\Big)^2V(U)=\frac{\psig^4_X}{(n-1)^2}\,2(n-1)=\frac{2\psig^4_X}{n-1}$$The constant comes out of the variance squared.
Statistic
Student's T statistic
When, in the standardized mean \(Z\), the (unknown) population standard deviation \(\psig_X\) is replaced by the sample one \(S\), the resulting variable \(T\) is no longer normal: it follows a Student's t with \(n-1\) degrees of freedom (\(t_{n-1}\)):
$$Z=\frac{\bar X-\pmu_X}{\psig_X/\sqrt n}\sim N(0;1),\qquad U=\frac{(n-1)S^2}{\psig_X^2}\sim\chi^2_{n-1}$$Previous results; for normal \(X\), \(Z\) and \(U\) are independent.
$$T=\frac{Z}{\sqrt{U/(n-1)}}\sim t_{n-1}$$Definition of Student's T variable.
Take two independent normal populations, \(X_1\sim N(\pmu_1;\psig_1)\) and \(X_2\sim N(\pmu_2;\psig_2)\), and from each a sample of size \(n_1\) and \(n_2\), with sample variances \(S_1^2\) and \(S_2^2\). The ratio of their standardized variances follows a Snedecor's F with \(n_1-1\) and \(n_2-1\) degrees of freedom:
$$\frac{S_1^2/\psig_1^2}{S_2^2/\psig_2^2}\sim F_{n_1-1;\,n_2-1}\qquad\text{y si }\psig_1^2=\psig_2^2:\quad F=\frac{S_1^2}{S_2^2}\sim F_{n_1-1;\,n_2-1}$$
Proof
$$U_1=\frac{(n_1-1)S_1^2}{\psig_1^2}\sim\chi^2_{n_1-1},\qquad U_2=\frac{(n_2-1)S_2^2}{\psig_2^2}\sim\chi^2_{n_2-1}$$Distribution of the sample variance in each population.
$$F=\frac{U_1/(n_1-1)}{U_2/(n_2-1)}=\frac{S_1^2/\psig_1^2}{S_2^2/\psig_2^2}$$Definition of F: ratio of independent chi-squares divided by their degrees of freedom.
If \(\psig_1^2=\psig_2^2\) the population variances cancel out, leaving \(S_1^2/S_2^2\).
Statistical quality control
Concept
Causes of variation and statistical control
Assignable causes: identifiable and removable (untrained operator, new batch of reagent, lack of calibration). They produce large variations.
Random causes: many small, unavoidable and independent causes (small environmental or electrical fluctuations).
In statistical control: the assignable causes have been removed and only the random ones remain.
Control sample: reference material with a certified analyte level (\(\pmu\) known). With the process in control, \(X\sim N(\pmu;\psig)\): \(\pmu\) and \(\psig\) are the quality specifications.
Formula
Shewhart chart for the mean
\(X\) is the measurement on the control sample and \(\pmu\), \(\psig\) are the quality specifications. With one measurement per control, \(X\) is plotted; with \(n\) measurements, their mean \(\bar X\) is plotted. The limits are placed \(k\) standard deviations from the center line \(\pmu\) (\(LI\): lower limit; \(LS\): upper):
$$\text{Individual: }\ \pmu\pm k\,\psig\qquad\qquad \text{Media de }n:\ \pmu\pm k\,\frac{\psig}{\sqrt n}$$
\(k=1\): contains 68 % (useful to detect patterns).
\(k=2\) (exactly 1.96): warning limits, 95 %.
\(k=3\) (exactly 2.576 for 99 %): action limits, 99.73 %.
Proof of the lower warning limit
$$P(X\lt LI_{Alerta})=0.025$$We look for the 2.5 and 97.5 percentiles of \(X\).
$$P\Big(Z\lt \frac{LI_{Alerta}-\pmu}{\psig}\Big)=0.025\ \Longrightarrow\ \frac{LI_{Alerta}-\pmu}{\psig}=z_{0.025}=-1.96$$Standardization and standard normal percentile.
$$LI_{Alerta}=\pmu-1.96\,\psig$$Solving. With means of \(n\), \(\psig\) is replaced by \(\psig/\sqrt n\). The action limits follow the same way with \(z_{0.005}=-2.576\).
Formula
Control chart for precision (variance)
The sample variance \(S^2\) of the \(n\) measurements of each control is plotted; \(\psig^2\) is the specified process variance and \(\chi^2_{n-1;\,q}\) the \(q\) percentile of the chi-square with \(n-1\) degrees of freedom. There are only upper limits (\(L_{Alerta}\) and \(L_{Acción}\)):
$$P(S^2\lt L_{Alerta})=0.95\Longrightarrow P\Big(\frac{(n-1)S^2}{\psig^2}\lt\frac{(n-1)L_{Alerta}}{\psig^2}\Big)=0.95$$Same transformation on both sides.
$$\frac{(n-1)L_{Alerta}}{\psig^2}=\chi^2_{n-1;\,0.95}\Longrightarrow L_{Alerta}=\frac{\psig^2\chi^2_{n-1;0.95}}{n-1}$$The ratio is a \(\chi^2_{n-1}\); solve.
Concept
Rules for detecting loss of control
One point outside the action limits (probability 0.0027 if the process is still in control).
Two out of three consecutive points between the warning and action limits.
Four out of five consecutive points outside the \(k=1\) limits.
Non-random patterns: cyclic (rotation of analysts or equipment), shift in the mean (many points on the same side, e.g. a new batch of reagent), increasing or decreasing trend (a reagent deteriorating), stratified (almost everything within \(k=1\): the actual \(\psig\) is smaller than the one used).
On the variance chart: a point beyond the action limit or an increasing trend.
Interactive lab
Interactive chart
Distribution calculator: Z, t, χ² and F
Replaces the tables. Pick the distribution and its degrees of freedom, and ask for a percentile or a probability: the shaded area is the computed probability. It starts with \(\chi^2_{13;\,0.975}\), the percentile used in exercise 5.2.
Interactive chart · simulation
Population, 1000 samples and the distribution of the statistic
1000 samples of size \(n\) are drawn from the chosen population and \(\bar X\) or \(S^2\) is computed in each one. Raise \(n\): the histogram narrows (\(\psig/\sqrt n\)) and, by the CLT, the mean becomes normal even if the population is skewed or bimodal. With \(S^2\), the curve \(\chi^2\) only fits if the population is normal.
Histogram of the 1000 samplesTheoretical distributionParameter value
Worked exercises
Exercise 4.1 Course notes · U4, HDL cholesterol examplethe probability questions were added
Why average? HDL cholesterol
HDL cholesterol concentration in a population is \(X\sim N(50;\,3)\) mg/dL. Compute the probability of getting a value between 49 and 51 mg/dL (a) with a single measurement; (b) with the mean of \(n=10\); (c) with the mean of \(n=40\).
Step-by-step solution
One measurement: $$P(49\lt X\lt 51)=P\Big(\tfrac{49-50}{3}\lt Z\lt\tfrac{51-50}{3}\Big)=P(-0.33\lt Z\lt 0.33)=0.261$$
Mean of 10: \(\sigma_{\bar X}=3/\sqrt{10}=0.949\). $$P(49\lt \bar X\lt 51)=P(-1.05\lt Z\lt 1.05)=0.708$$
Mean of 40: \(\sigma_{\bar X}=3/\sqrt{40}=0.474\). $$P(-2.11\lt Z\lt 2.11)=0.965$$
Conclusion. The probability of landing within 1 mg/dL of the true mean goes from 26 % to 71 % and to 96.5 %: the standard deviation of the mean is divided by \(\sqrt n\).
61 % of a population of seeds germinate within a week. A sample of 200 seeds is taken and 130 germinate. (a) Is 0.61 a parameter or a statistic? (b) Compute \(h\) and its distribution. (c) How likely is it to observe \(h\ge 0.65\)?
Step-by-step solution
\(\pp=0.61\) is a parameter (it describes the population). \(h=130/200=0.65\) is a statistic: another sample of 200 would give another value.
With \(n=200\gt30\): $$h\sim N\Big(0.61;\ \sqrt{\tfrac{0.61\cdot0.39}{200}}\Big)=N(0.61;\ 0.0345)$$
Conclusion. In 12 % of samples of 200 seeds a germination of 65 % or more would be observed; the result is consistent with \(\pp=0.61\).
Exercise 4.3 Course notes · U4, examples 2 and 3 (glucose)the values in part (b) are illustrative
Glucose control charts with three daily aliquots
Glucose control sample with \(\pmu=80\) and \(\psig=1.5\) mg/100mL; \(n=3\) aliquots are run each day. (a) Build the charts for the mean and for the variance. (b) Illustrative values: two consecutive days with means 81.9 and 82.1, and one day with \(s^2=11.2\). What can be concluded?
81.9 and 82.1 lie between warning (81.73) and action (82.60): the rule “two out of three consecutive points between warning and action” is met. Also \(s^2=11.2\gt10.36\).
Conclusion. Both charts signal an assignable cause: patient results are not reported until the process has been checked.
Integrative exercises
Exercise 4.4 Workbook · ch. 4, ex. 9Integrative
Out-of-spec tablets: normal or binomial?
8 % of a population of tablets does not meet the Pharmacopoeia specifications. (a) Compute the probability that, in a sample of 150 tablets, the percentage out of spec is at most 10 %. (b) Compute the same probability for a sample of 10. (c) Was the same procedure used in (a) and (b)? Explain.
Step-by-step solution
Let \(A\) = “the tablet is out of spec”, with \(\pp=0.08\) and \(\pq=0.92\). The statistic is the relative frequency \(h=f(A)/n\), with \(E(h)=\pp\) and \(V(h)=\pp\pq/n\).
(a) n = 150. Since \(n\gt30\), by the CLT \(h\) is approximately normal: $$h\sim N\Big(0.08;\ \sqrt{\tfrac{0.08\cdot0.92}{150}}\Big)=N(0.08;\ 0.0222)$$ $$P(h\le0.10)=P\Big(Z\le\frac{0.10-0.08}{0.0222}\Big)=P(Z\le0.90)=0.8159$$
(b) n = 10. With \(n\le30\) the CLT does not apply. Use the exact distribution of the absolute frequency: \(f(A)\sim\text{Binomial}(10;\ 0.08)\). Since \(h\le0.10\iff f(A)\le1\): $$P(f(A)\le1)=0.92^{10}+10\cdot0.08\cdot0.92^{9}=0.4344+0.3777=0.8121$$
(c) No: in (a) the distribution of \(h\) was approximated by a normal; in (b) the exact binomial was used. Had the normal been used in (b), \(\sigma_h=\sqrt{0.08\cdot0.92/10}=0.0858\) would give \(P(Z\le0.23)=0.592\), far from the correct value 0.8121.
Conclusion. The probability is 0.816 with n = 150 and 0.812 with n = 10. The normal approximation for \(h\) requires large samples; with small samples you have to work with the binomial.
Exercise 4.5 Workbook · ch. 4, ex. 11Integrative
Serum cholesterol: charts for the mean and the variance over 20 days
An enzymatic method for serum cholesterol was brought into control. A control mix with \(\pmu=210\) mg/dL and \(\psig=3\) mg/dL is used, with three measurements per day. (a) Build the control charts. (b) With the means and variances of the next 20 days, can it be concluded that the process stayed in control?
Day
1
2
3
4
5
6
7
8
9
10
x̄
209.7
211.3
206.7
211.0
210.0
211.7
209.0
207.7
210.0
210.0
s²
6.33
9.33
2.33
12.03
16.00
6.33
12.00
4.33
4.00
12.00
Day
11
12
13
14
15
16
17
18
19
20
x̄
211.3
211.3
210.0
207.7
209.7
208.7
212.0
209.7
211.3
209.3
s²
2.33
12.33
7.00
2.33
5.33
6.33
3.00
2.33
6.33
41.33
Step-by-step solution
Mean chart (mean of \(n=3\)): \(\psig/\sqrt n=3/\sqrt3=1.732\) and limits \(210\pm k\cdot1.732\).
Limit
k
Lower
Upper
68 %
1
208.27
211.73
Warning
2
206.54
213.46
Action
3
204.80
215.20
Variance chart, with \(gl=n-1=2\): $$L_{Alerta}=\frac{3^2\cdot\chi^2_{2;0.95}}{2}=\frac{9\cdot5.99}{2}=26.96\qquad L_{Acción}=\frac{9\cdot9.21}{2}=41.45\ (\text{mg/dL})^2$$
Means. None falls outside the warning limits. Only days 3 (206.7), 8 (207.7), 14 (207.7) and 17 (212.0) fall outside \(k=1\), in isolation: never 4 out of 5 in a row. There are 9 means below 210, 7 above and 4 equal, with no runs or trends.
Variances. The first 19 are below 26.96. On day 20, \(s^2=41.33\) lies between the warning and the action limit, very close to the latter.
Conclusion. Over the 20 days the process stayed in statistical control: no point exceeded an action limit and no patterns appeared. But the precision on day 20 is borderline: the following days should be watched, because another point between warning and action would signal loss of control.
5
Parameter estimation
Point estimation and confidence intervals; sample size.
Concepts
Concept
Estimator and estimate
Estimator of \(\theta\): a random variable that is a function of the sample, \(\hat\theta=g(X_1,\dots,X_n)\). Estimate: the observed value of the estimator once the sample has been obtained.
Example from the notes: with 40 individuals, \(\bar x=50.3\) mg/dL was obtained; 50.3 is an estimate of the mean HDL cholesterol.
Concept
Properties of a good estimator
Unbiased: \(E(\hat\theta)=\theta\).
Consistent (among unbiased ones): \(V(\hat\theta)\to0\) as \(n\to+\infty\).
Parameter
Estimator
Expectation
Variance
\(\pmu_X\)
\(\bar X\)
\(\pmu_X\)
\(\psig^2_X/n\)
\(\psig^2_X\)
\(S^2_X\)
\(\psig^2_X\)
\(2\psig^4_X/(n-1)\)
\(\pp=P(A)\)
\(h(A)\)
\(\pp\)
\(\pp\pq/n\)
Why divide by \(n-1\) and not by \(n\)
$$S'^2=\frac1n\sum(x_i-\bar x)^2=\frac{n-1}{n}S^2$$Relationship between both versions.
$$E(S'^2)=\frac{n-1}{n}E(S^2)=\frac{n-1}{n}\psig^2_X\ \lt\ \psig^2_X$$\(S'^2\) is biased: it underestimates the population variance. \(S^2\) is unbiased.
Concept
Confidence interval: steps and interpretation
Define the parameter \(\theta\).
Choose a good estimator \(\hat\theta\).
Set the confidence \(1-\alpha\) (usually 0.90, 0.95, 0.99).
Define a variable \(Y\) that contains \(\theta\) and \(\hat\theta\), with a known distribution (with other parameters known).
Set up \(P(y_{\alpha/2}\le Y\le y_{1-\alpha/2})=1-\alpha\) and solve for \(\theta\).
Take the sample and compute \((a;\,b)\).
Conclude with confidence \(1-\alpha\) that \((a;\,b)\) covers \(\theta\).
If sampling were repeated many times, \((1-\alpha)\cdot100\)% of the intervals would cover the true \(\theta\). It is not “the probability that \(\theta\) lies in this interval”: \(\theta\) is fixed; what is random is the interval.
The half-width \(d\) (margin of error) measures precision: the higher the confidence, the wider the interval; the larger \(n\), the narrower.
Formulas
Formula · CI
CI for \(\pmu\), normal population with known \(\psig\)
By the CLT it holds for any \(X\) with known \(\psig\) if \(n\) is large.
Proof
$$P\Big(z_{\alpha/2}\le\frac{\bar X-\pmu_X}{\psig_X/\sqrt n}\le z_{1-\alpha/2}\Big)=1-\alpha$$\(Z\sim N(0;1)\) contains the parameter and the estimator.
$$P\Big(z_{\alpha/2}\tfrac{\psig_X}{\sqrt n}\le\bar X-\pmu_X\le z_{1-\alpha/2}\tfrac{\psig_X}{\sqrt n}\Big)=1-\alpha$$Multiply by \(\psig_X/\sqrt n\gt0\).
$$P\Big(\bar X-z_{\alpha/2}\tfrac{\psig_X}{\sqrt n}\ge\pmu_X\ge\bar X-z_{1-\alpha/2}\tfrac{\psig_X}{\sqrt n}\Big)=1-\alpha$$Subtract \(\bar X\) and multiply by \(-1\) (the inequalities flip).
$$P\Big(\bar X-z_{1-\alpha/2}\tfrac{\psig_X}{\sqrt n}\le\pmu_X\le\bar X+z_{1-\alpha/2}\tfrac{\psig_X}{\sqrt n}\Big)=1-\alpha$$Symmetry of the normal: \(z_{\alpha/2}=-z_{1-\alpha/2}\).
Higher confidence, higher precision (smaller \(d\)) or a more heterogeneous population (larger \(\psig\)) require a larger \(n\). Round up. If \(\psig\) is unknown, use a value from previous studies or from a pilot sample.
Formula · CI
CI for \(\pmu\), normal population with unknown \(\psig\)
$$P\Big(t_{n-1;\alpha/2}\le\frac{\bar X-\pmu_X}{S_X/\sqrt n}\le t_{n-1;1-\alpha/2}\Big)=1-\alpha$$\(T\sim t_{n-1}\) replaces \(Z\) because \(\psig_X\) is estimated by \(S_X\).
Solving as with \(Z\) and using the symmetry \(t_{n-1;\alpha/2}=-t_{n-1;1-\alpha/2}\) gives \(\bar X\pm t_{n-1;1-\alpha/2}S_X/\sqrt n\).
$$P\Big(\frac{\chi^2_{n-1;\alpha/2}}{(n-1)S^2_X}\le\frac1{\psig^2_X}\le\frac{\chi^2_{n-1;1-\alpha/2}}{(n-1)S^2_X}\Big)=1-\alpha$$Divide by \((n-1)S^2_X\gt0\).
$$P\Big(\frac{(n-1)S^2_X}{\chi^2_{n-1;1-\alpha/2}}\le\psig^2_X\le\frac{(n-1)S^2_X}{\chi^2_{n-1;\alpha/2}}\Big)=1-\alpha$$Take reciprocals (the inequalities flip) and reorder.
\(\pp'\) comes from previous studies or a pilot sample. Conservative option: \(\pp'=0.5\), which maximizes \(\pp'\pq'\) and gives the largest \(n\).
Proof
$$Z=\frac{h-\pp}{\sqrt{h(1-h)/n}}\sim N(0;1)$$CLT; the variance \(\pp\pq/n\) depends on the parameter, so \(\pp\) and \(\pq\) are replaced by \(h\) and \(1-h\).
$$P\Big(h-z_{1-\alpha/2}\sqrt{\tfrac{h(1-h)}{n}}\le\pp\le h+z_{1-\alpha/2}\sqrt{\tfrac{h(1-h)}{n}}\Big)=1-\alpha$$Same solving as for the mean, with \(z_{\alpha/2}=-z_{1-\alpha/2}\).
Interactive lab
Interactive chart · simulation
What does “90 % confidence” mean?
Fifty samples of a sodium solution with \(\pmu=2\) mg/L and \(\psig=0.2\) mg/L, as in exercise 4 of the workbook. Each bar is an interval; the ones that miss \(\pmu\) are in red. Generate several times: the cumulative percentage approaches the chosen confidence. Change the confidence or \(n\) to see how the width changes.
Covers μMisses μμ = 2 mg/L
Worked exercises
Exercise 5.1 Workbook · ch. 5, ex. 3
Yield of a new maize variety
Yields (qq/ha) in 12 plots in southern Santa Fe; a normal distribution is assumed. Estimate the mean yield with a point estimate and with a 95 % CI.
88
85
74
69
93
70
87
65
89
79
93
84
Step-by-step solution
Point estimate: \(\hat{\pmu}=\bar x=81.33\) qq/ha; \(s=9.70\).
\(\psig\) unknown and \(n=12\): use \(t_{11;\,0.975}=2.201\). $$81.33\pm2.201\cdot\frac{9.70}{\sqrt{12}}=81.33\pm6.16$$
CI: \((75.17;\ 87.50)\) qq/ha.
Conclusion. With 95 % confidence, the interval (75.2; 87.5) qq/ha covers the mean yield of the variety in the area.
Exercise 5.2 Workbook · ch. 5, ex. 6
Antioxidant capacity (FRAP) of wild raspberries
FRAP values (µg Fe/g dry weight) in 14 raspberries; normal variable. (a) Point estimates of the mean and the variance. (b) 99 % CI for the mean. (c) 95 % CI for the variance. (d) What \(n\) halves the width of (b)?
New margin \(d=2.29/2=1.146\); with \(\psig\approx s\): \(n=\big(\frac{2.576\cdot2.848}{1.146}\big)^2=40.9\Rightarrow n=41\).
Conclusion. Mean between 13.2 and 17.8 µg Fe/g (99 %), variance between 4.3 and 21.1 (95 %). Doubling the precision takes 41 raspberries: halving \(d\) almost triples \(n\).
Exercise 5.3 Workbook · ch. 5, ex. 7
Poor eating habits
We want to estimate the proportion of people with poor eating habits in a city. (a) Sample size for 95 % confidence and a 4 % margin, if 12 out of 40 had them in a pilot. (b) Out of 500 people, 124 have them: estimate.
Conclusion. With 95 % confidence, between 21.0 % and 28.6 % of the population has poor eating habits.
Integrative exercises
Exercise 5.4 Workbook · ch. 5, ex. 4Integrative
Twenty sodium aliquots: coverage and width of the intervals
To estimate the sodium concentration of a solution, 9 measurements are made on an aliquot. The experiment is repeated with 20 aliquots of the same solution. The workbook gives the 18 intervals of the other aliquots; those for aliquots 4 and 15 are missing (mg/L):
Aliquot 4
1.98
1.88
2.11
1.62
1.39
2.15
1.70
1.99
1.95
Aliquot 15
2.16
1.83
1.89
1.75
2.03
1.98
1.72
1.87
1.95
(a) 90 % CI for aliquots 4 and 15 with \(\psig=0.2\) mg/L. (b) If the true value is 2 mg/L, what proportion of the 20 intervals covers it? (c) Repeat assuming \(\psig\) unknown. (d) With a 95 % CI, how does the width change and how many intervals are expected to cover the true value? (e) What happens to the width if the number of measurements per aliquot increases?
Step-by-step solution
(a) σ known. \(z_{0.95}=1.645\) and \(\psig/\sqrt n=0.2/3=0.0667\): half-width \(d=1.645\cdot0.0667=0.110\), the same for all aliquots.
$$\text{Aliquot 4: }\bar x=1.863\Rightarrow(1.753;\ 1.973)\qquad\text{Aliquot 15: }\bar x=1.909\Rightarrow(1.799;\ 2.019)$$
(b) With \(\pmu=2\), aliquot 2 \((2.020;\ 2.240)\) and aliquot 4 \((1.753;\ 1.973)\) miss it: 18 out of 20 cover it, i.e. 90 %, equal to the confidence. That is what to expect: in the long run, 90 % of the intervals built this way cover \(\pmu\).
(c) σ unknown. Use \(t_{8;0.95}=1.860\) and the standard deviation of each aliquot: $$\text{Aliquot 4: }s=0.248\Rightarrow 1.863\pm1.860\cdot\tfrac{0.248}{3}=(1.709;\ 2.017)$$ $$\text{Aliquot 15: }s=0.139\Rightarrow 1.909\pm1.860\cdot\tfrac{0.139}{3}=(1.823;\ 1.995)$$ Now the widths change from one aliquot to another because \(s\) varies. Aliquot 2 \((2.013;\ 2.247)\) and aliquot 15 miss it: again 18 out of 20 (90 %), although different intervals fail.
(d) 95 %. The intervals are wider: with σ known the half-width goes from 0.110 to \(1.96\cdot0.0667=0.131\); with σ unknown the critical value goes from 1.860 to \(t_{8;0.975}=2.306\). 19 out of the 20 are expected to cover it.
(e) The half-width is \(z\,\psig/\sqrt n\) (or \(t\,s/\sqrt n\)): increasing \(n\) at the same confidence narrows the intervals in proportion to \(1/\sqrt n\); with σ unknown the t percentile also drops.
Conclusion. Confidence is not a property of a particular interval but of the procedure: in both cases 18 out of 20 intervals cover the true value. More confidence means wider intervals; more measurements, narrower intervals.
Exercise 5.5 Workbook · ch. 5, ex. 15Integrative
Active ingredient in tablets: plan the sample and estimate
We want to estimate the mean content of the active ingredient of a product. The variable is normal with \(\psig=0.0068\) g. (a) How many tablets must be processed to estimate with a margin of error of 0.005 g and 99 % confidence? (b) Estimate with an interval using the results obtained (g):
0.8403
0.8363
0.8447
0.8490
0.8352
0.8471
0.8312
0.8412
0.8456
0.8369
0.8478
0.8302
Step-by-step solution
(a) With \(z_{0.995}=2.576\): $$n=\Big(\frac{z_{0.995}\,\psig}{d}\Big)^2=\Big(\frac{2.576\cdot0.0068}{0.005}\Big)^2=12.27\Rightarrow n=13$$ Always round up, so as not to exceed the required margin.
(b) With the 12 values: \(\bar x=0.84046\) g. Since \(\psig\) is known, use \(z\): $$0.84046\pm2.576\cdot\frac{0.0068}{\sqrt{12}}=0.84046\pm0.00506\Rightarrow(0.8355;\ 0.8455)\ \text{g}$$
With 12 tablets (one fewer than planned) the margin turns out to be 0.00506 g, slightly above the required 0.005: that is why the calculation in (a) gave 13.
Conclusion. With 99 % confidence, the mean content of the active ingredient is between 0.8355 and 0.8455 g.
6
Hypothesis tests based on one sample
Mean, proportion and variance; errors, power and sample size.
Concepts
Concept
Null and alternative hypotheses
\(H_0\): statement about the parameter that represents the status quo; it is assumed true and is not rejected without sufficient evidence. \(H_1\): the research question, which contradicts \(H_0\).
Possible conclusions: reject \(H_0\) (strong conclusion, \(\alpha\) bounded) or do not reject \(H_0\) (weak conclusion, \(\beta\) not bounded). That is why we never say “\(H_0\) is accepted”.
The trial analogy: \(H_0\) “innocent”, \(H_1\) “guilty”. Failing to convict for lack of evidence does not prove innocence.
Simple: a single value (\(\pmu=50\)). Composite: several (\(\pmu\gt50\)).
Right-tailed (\(H_1:\theta\gt\theta_0\)), left-tailed (\(\theta\lt\theta_0\)) or two-tailed (\(\theta\ne\theta_0\)): defines the tail of the rejection region.
With \(n\) fixed, lowering \(\alpha\) raises \(\beta\). Only increasing \(n\) lowers both.
\(\alpha\) is fixed (significance level: 0.01, 0.05, 0.10) and the rejection region is built from it; \(\beta\) depends on the true value of the parameter.
Power increases the farther \(\pmu_1\) is from \(\pmu_0\), the smaller \(\psig\) is and the larger \(n\) is.
Concept
Test statistic, rejection region and p-value
Test statistic: function of the sample on which the decision is based. Critical region: values of the statistic that lead to rejecting \(H_0\). Critical value \(c_\alpha\): separates the regions; it is derived from \(P(E_I)=\alpha\).
p-value (associated probability): probability of observing a value of the statistic as extreme as or more extreme than the one obtained, assuming \(H_0\) is true. A single rule for every test: reject \(H_0\) if \(p_{asoc}\le\alpha\).
Steps: (1) hypotheses, (2) \(\alpha\), (3) test statistic and its distribution under \(H_0\), (4) rejection region, (5) sample and observed value, (6) decision and conclusion in terms of the problem.
$$\frac{c_\alpha-\pmu_0}{\psig/\sqrt n}=z_{1-\alpha}\Rightarrow c_\alpha=\pmu_0+z_{1-\alpha}\frac{\psig}{\sqrt n}$$Standard normal percentile and solving. In the two-tailed test, \(\alpha/2\) goes to each tail.
Formula · power
Type II error, power and sample size
For \(H_0:\pmu=\pmu_0\) vs \(H_1:\pmu\gt\pmu_0\), if the true mean is \(\pmu_1\):
The same formula for \(n\) holds for the left-tailed test.
Proof of the formula for \(n\)
$$P(\bar X\lt c_\alpha\mid\pmu=\pmu_1)=\beta$$Definition of type II error in this test.
$$P\Big(Z\lt\frac{\pmu_0+z_{1-\alpha}\psig/\sqrt n-\pmu_1}{\psig/\sqrt n}\Big)=P\Big(Z\lt\frac{\pmu_0-\pmu_1}{\psig/\sqrt n}+z_{1-\alpha}\Big)=\beta$$Substitute \(c_\alpha\) and standardize under \(H_1\).
$$-z_{1-\beta}=\frac{\pmu_0-\pmu_1}{\psig}\sqrt n+z_{1-\alpha}$$The right-hand side is the \(z_\beta=-z_{1-\beta}\) percentile.
$$\sqrt n=\frac{(-z_{1-\beta}-z_{1-\alpha})\psig}{\pmu_0-\pmu_1}\Rightarrow n=\frac{(z_{1-\alpha}+z_{1-\beta})^2\psig^2}{(\pmu_0-\pmu_1)^2}$$Solving and squaring.
Formula · test
Test for \(\pmu\) with unknown \(\psig\) (Student's t)
The test uses \(\pp_0\pq_0\) (the value under \(H_0\)); the interval uses \(h(1-h)\).
Proof of the critical value (right)
$$P(h\ge c_\alpha\mid\pp=\pp_0)=\alpha\Rightarrow P\Big(Z\ge\frac{c_\alpha-\pp_0}{\sqrt{\pp_0\pq_0/n}}\Big)=\alpha$$Type I error and normality of \(h\) under \(H_0\).
$$c_\alpha=\pp_0+z_{1-\alpha}\sqrt{\frac{\pp_0\pq_0}{n}}$$Percentile and solving.
Formula · test
Test for \(\psig^2\) of a normal population
\(H_0:\psig^2=\psig_0^2\) vs \(H_1:\psig^2\gt\psig_0^2\) (loss of precision):
$$u_{obs}=\frac{(n-1)s^2_{obs}}{\psig^2_0}\qquad\text{rechazar si }u_{obs}\ge\chi^2_{n-1;1-\alpha}\ \Leftrightarrow\ s^2_{obs}\ge\frac{\chi^2_{n-1;1-\alpha}\,\psig_0^2}{n-1}$$
Proof
$$P(S^2\ge c_\alpha\mid\psig^2=\psig^2_0)=\alpha\Rightarrow P\Big(\frac{(n-1)S^2}{\psig^2_0}\ge\frac{(n-1)c_\alpha}{\psig^2_0}\Big)=\alpha$$Both sides are multiplied by the same constant.
$$\frac{(n-1)c_\alpha}{\psig^2_0}=\chi^2_{n-1;1-\alpha}\Rightarrow c_\alpha=\frac{\chi^2_{n-1;1-\alpha}\psig^2_0}{n-1}$$\(U\sim\chi^2_{n-1}\); percentile and solving.
Interactive lab
Interactive chart
Rejection regions, α, β and power
Test for \(\pmu\) with known \(\psig\). The blue curve is the distribution of \(\bar X\) if \(H_0\) is true; the orange one, if the true mean is \(\pmu_1\). Move \(\pmu_1\), \(n\), \(\psig\) or \(\alpha\) and watch how the areas split. The initial values come from the hepcidin exercise (6.2).
α: reject with H₀ trueβ: do not reject with H₁ truePower 1 − βp-valuerejection regionnon-rejection
Worked exercises
Exercise 6.1 Workbook · ch. 6, ex. 3
Arsenic in water: is reverse osmosis needed?
The maximum allowed is 0.05 mg/L. It was measured over 10 days (mg/L). Is there evidence that the maximum is exceeded with \(\alpha=0.05\)? And with \(\alpha=0.01\)?
0.072
0.062
0.067
0.069
0.080
0.036
0.086
0.081
0.076
0.022
Step-by-step solution
\(H_0:\pmu\le0.05\) vs \(H_1:\pmu\gt0.05\) (the equipment is installed only with evidence).
\(t_{9;0.95}=1.833\); critical value in mg/L: \(c_\alpha=0.05+1.833\cdot0.0206/\sqrt{10}=0.0619\). \(\bar x=0.0651\ge0.0619\).
\(p_{asoc}=P(T\ge2.32)=0.0227\).
With \(\alpha=0.01\): \(t_{9;0.99}=2.821\gt2.32\) and \(p=0.0227\gt0.01\): not rejected.
Conclusion. At the 5 % significance level there is evidence that mean arsenic exceeds 0.05 mg/L, and installing the equipment is recommended (p = 0.023). At 1 % the evidence is not enough.
Exercise 6.2 Workbook · ch. 6, ex. 5
Hepcidin in thalassemia carriers
In the general population the mean is 21 ng/mL. It was measured in 12 carriers. (a) Is it lower in carriers? (\(\alpha=0.05\)). (b) Power if the true mean is 17 ng/mL (\(\psig=5\)). (c) What \(n\) gives power 0.95?
7.2
5.2
15.4
14.1
16.2
20.5
10.8
13.5
9.5
12.1
11.75
23.1
Step-by-step solution
The normal probability plot in the workbook shows aligned points: normality is accepted. \(H_0:\pmu=21\) vs \(H_1:\pmu\lt21\).
Power with \(\psig=5\): \(c_\alpha=21-1.645\cdot5/\sqrt{12}=18.63\). $$1-\beta=P(\bar X\le18.63\mid\pmu=17)=P\Big(Z\le\frac{18.63-17}{5/\sqrt{12}}\Big)=P(Z\le1.13)=0.870$$
Conclusion. Mean hepcidin in carriers is significantly lower than 21 ng/mL (p < 0.001). With 12 patients, the test detects a drop to 17 ng/mL with probability 0.87; for 0.95, 17 patients are needed.
Exercise 6.3 Workbook · ch. 6, ex. 7
Side effects of a painkiller
Out of 440 arthritis patients, 23 had some side effect. Can the percentage be assumed to be below 10 %? (\(\alpha=0.05\)). Estimate the proportion with 95 %.
Step-by-step solution
\(H_0:\pp=0.10\) vs \(H_1:\pp\lt0.10\). \(h=23/440=0.0523\).
95 % CI: $$0.0523\pm1.96\sqrt{\frac{0.0523\cdot0.9477}{440}}=0.0523\pm0.0208$$ that is, \((0.031;\ 0.073)\).
Conclusion. There is evidence that fewer than 10 % of patients suffer side effects (p = 0.0004); the estimate is between 3.1 % and 7.3 %.
Integrative exercises
Exercise 6.4 Workbook · ch. 6, ex. 4Integrative
Malathion: switch suppliers? Sample size, test, power and CI
A calibration curve uses malathion with 99.2 % purity. Supplier B offers a product of higher purity. Purity is normal with \(\psig=0.1\) %. (a) State the hypotheses. (b) Minimum number of measurements to have probability 0.05 of recommending the switch when purity equals the usual one, and 0.01 of staying with the usual supplier when B's is 0.15 % higher. (c) Test the hypotheses with 10 measurements of B. (d) Is the power with 10 measurements greater or less than 0.99? (e) If \(H_0\) is rejected, estimate B's purity with a 95 % CI.
99.35
99.37
99.25
99.32
99.44
99.18
99.22
99.28
99.41
99.15
Step-by-step solution
(a) \(H_0:\pmu=99.2\) % vs \(H_1:\pmu\gt99.2\) %. The supplier is switched only with evidence of higher purity.
(b) \(\alpha=0.05\) (\(z_{0.95}=1.645\)), \(\beta=0.01\) (\(z_{0.99}=2.326\)) and \(\pmu_1=99.35\): $$n=\frac{(1.645+2.326)^2\cdot0.1^2}{(99.2-99.35)^2}=7.01$$ The workbook reports 7 measurements.
(d) With 10 measurements (more than the 7 needed) the power exceeds 0.99: $$1-\beta=P(\bar X\ge99.252\mid\pmu=99.35)=P\Big(Z\ge\frac{99.252-99.35}{0.0316}\Big)=P(Z\ge-3.10)=0.999$$
Conclusion. There is evidence that B's product is purer (p = 0.001), and the test had more than enough power to detect it. Its mean purity is between 99.24 % and 99.36 % (95 %): switching suppliers is recommended.
Exercise 6.5 Workbook · ch. 6, ex. 9Integrative
Creatinine: accuracy and precision of the enzymatic method
30 repeated creatinine measurements were made on a 0.8 mg/dL solution, with \(\bar x=0.81\) mg/dL and \(s=0.025\) mg/dL. (a) Test the hypothesis that there are only random errors (\(\alpha=0.01\)). (b) The maximum accepted variability is a coefficient of variation of 5 %. Is there evidence to reject that the process meets this specification? (\(\alpha=0.05\)).
Step-by-step solution
(a) Accuracy. “Only random errors” means no systematic error: the mean of the measurements is the true value. \(H_0:\pmu=0.8\) vs \(H_1:\pmu\ne0.8\) (two-tailed).
$$t_{obs}=\frac{0.81-0.8}{0.025/\sqrt{30}}=2.19\qquad t_{29;0.995}=2.756\qquad p_{asoc}=2P(T\ge2.19)=0.0367$$ Since \(|t_{obs}|\lt2.756\) (and \(p\gt0.01\)), \(H_0\) is not rejected.
(b) Precision. A CV of 5 % on 0.8 mg/dL: \(\psig_0=0.05\cdot0.8=0.04\) mg/dL, \(\psig_0^2=0.0016\). \(H_0:\psig^2\le0.0016\) vs \(H_1:\psig^2\gt0.0016\).
$$u_{obs}=\frac{(n-1)s^2}{\psig_0^2}=\frac{29\cdot0.025^2}{0.0016}=11.33\qquad\chi^2_{29;0.95}=42.56\qquad p_{asoc}=0.9987$$ \(H_0\) is not rejected. The observed CV is \(0.025/0.81=3.1\) %.
Conclusion. At the 1 % significance level there is no evidence of systematic error (although at 5 % there would be, p = 0.037). The precision comfortably meets the specification: the observed CV is 3.1 %.
7
Design of experiments and two samples
Independent and dependent samples; classical and nonparametric tests.
Concepts
Concept
Design of experiments vocabulary
Response variable: what is measured (time until symptoms disappear).
Factor: what distinguishes the populations being compared (antibiotic). Levels: its categories (tetracycline, penicillin).
Treatment: combination of levels applied to a unit. Experimental unit: smallest portion of material to which a treatment is applied (patient).
Concept
DCA and DBCA: independent or dependent samples
Completely randomized design (DCA): homogeneous units, randomly assigned to the levels → independent samples. They also arise when comparing natural groups (women of different ethnicities).
Randomized complete block design (DBCA): heterogeneous units grouped into homogeneous blocks; each block receives all the treatments at random → dependent samples. Extreme case: the same unit measured before and after.
Independent samples
Formula · test
Comparing variances: the F ratio
The larger sample variance goes in the numerator (if \(s_1^2\gt s_2^2\)): \(H_0:\psig_1^2=\psig_2^2\) vs \(H_1:\psig_1^2\gt\psig_2^2\).
$$F_{obs}=\frac{s^2_1}{s^2_2}\qquad\text{rechazar si }F_{obs}\ge F_{n_1-1;\,n_2-1;\,1-\alpha},\quad p=P(F\ge F_{obs})$$
Proof
$$\frac{S_1^2/\psig_1^2}{S_2^2/\psig_2^2}\sim F_{n_1-1;n_2-1}\ \overset{H_0}{\Longrightarrow}\ \frac{S_1^2}{S_2^2}\sim F_{n_1-1;n_2-1}$$Ratio of chi-squares over their df; under \(H_0\) the variances cancel out.
$$P\Big(\frac{S_1^2}{S_2^2}\ge c_\alpha\Big)=\alpha\Rightarrow c_\alpha=F_{n_1-1;n_2-1;1-\alpha}$$Percentile of the F.
Notation in unit 7: the second parameter of the normal is the variance. If \(H_0\) postulates a difference \(\delta\ne0\), subtract \(\delta\) in the numerator.
Proof
Linear combination of independent normals: if \(Y_1,\dots,Y_m\) are \(m\) independent normal variables with means \(\mu_j\) and variances \(\sigma_j^2\), and \(a_j\) are real constants, the combination \(W=\sum_{j=1}^m a_jY_j\) is normal: \(W\sim N\big(\sum a_j\mu_j;\sum a_j^2\sigma_j^2\big)\). With \(a_1=1,\ a_2=-1\) we get the distribution of \(\bar X_1-\bar X_2\).
$$P(\bar X_1-\bar X_2\ge c_\alpha\mid\pdm=0)=\alpha\Rightarrow c_\alpha=z_{1-\alpha}\sqrt{\tfrac{\psig_1^2}{n_1}+\tfrac{\psig_2^2}{n_2}}$$Standardization and percentile (right-tailed).
Formula · test
Unknown, equal variances: t with pooled variance
First run the F test. If equality is not rejected:
\(s_a^2\) is a weighted average of the sample variances. Right: \(t_{obs}\ge t_{n_1+n_2-2;1-\alpha}\); left: \(\le -t\); two-tailed: \(|t_{obs}|\ge t_{n_1+n_2-2;1-\alpha/2}\).
$$h_1-h_2\sim N\Big(\pp_1-\pp_2;\ \frac{\pp_1\pq_1}{n_1}+\frac{\pp_2\pq_2}{n_2}\Big)$$CLT (\(n_i\gt30\)) and linear combination of normals.
$$\overset{H_0}{\Longrightarrow}\ h_1-h_2\sim N\Big(0;\ \pp\pq\big(\tfrac1{n_1}+\tfrac1{n_2}\big)\Big)$$With \(\pp_1=\pp_2=\pp\); \(\pp\) is estimated by \(h\).
$$c_\alpha=z_{1-\alpha}\sqrt{h(1-h)\big(\tfrac1{n_1}+\tfrac1{n_2}\big)}$$Type I error, standardization and percentile (right).
Dependent samples
Formula · test
Comparing paired means: \(\pmd\)
Compute the difference within each block, \(d_i=x_{1i}-x_{2i}\), and assume \(D\sim N(\pmd;\psig_D^2)\). It is a one-sample t test on the differences:
$$\bar D\sim N\Big(\pmd;\frac{\psig^2_D}{n}\Big),\quad \frac{(n-1)S^2_D}{\psig^2_D}\sim\chi^2_{n-1}\Rightarrow T=\frac{\bar D-\pmd}{S_D/\sqrt n}\sim t_{n-1}$$Same as the one-sample T.
$$P(\bar D\ge c_\alpha\mid\pmd=0)=\alpha\Rightarrow\frac{c_\alpha}{s_D/\sqrt n}=t_{n-1;1-\alpha}$$Type I error and t percentile (right).
Formula · test
Two proportions with dependent samples
Only the \(n'=f(A,\bar A)+f(\bar A,A)\) blocks with different responses are informative. Under \(H_0:\pp_1=\pp_2\), among them the probability of “A with treatment 1 and not with 2” is 0.5:
\(H_1:\pp_1\gt\pp_2\) is equivalent to \(\pp'_1\gt0.5\) (right); \(\pp_1\lt\pp_2\) to \(\pp'_1\lt0.5\); \(\ne\) is two-tailed.
Nonparametric tests
Concept · ranks
Wilcoxon rank-sum (independent, Mann-Whitney)
When \(X_1\) or \(X_2\) are not normal. Hypotheses about location. The \(n=n_1+n_2\) observations are sorted and assigned ranks 1…n (ties: average rank).
If \(H_1\): population 2 shifted to the right, reject if \(w_1\le w_{1;\alpha}\) (or \(w_2\ge w_{2;1-\alpha}\)). If population 1 is to the right, \(w_1\ge w_{1;1-\alpha}\). Critical values from tables.
Example from the notes: samples 25, 26, 27, 28, 30 and 29, 31, 32, 35 give \(w_1=16\), \(w_2=29\), with sum \(45=9\cdot10/2\).
Concept · ranks
Wilcoxon signed-rank (dependent)
When \(D\) is not normal. Zero differences are dropped, the rest are sorted by absolute value and assigned ranks.
$$T^-=\sum\text{rangos de }d_j\lt0,\quad T^+=\sum\text{rangos de }d_j\gt0,\quad T^-+T^+=\frac{n'(n'+1)}2$$
Two-tailed: \(T=\min(T^-,T^+)\); reject if \(t_{obs}\le t_\alpha\).
\(X_1\) to the right of \(X_2\): reject if \(t^-_{obs}\le t_\alpha\). \(X_2\) to the right: \(t^+_{obs}\le t_\alpha\).
Interactive lab
Interactive chart · simulation
Two independent samples: from F to the t test
Define two normal populations and the size of each sample. The chart follows the procedure of the unit: first the F test for variances (larger on top), and depending on its result the pooled-variance t or Welch's test, two-tailed with \(\alpha=0.05\). Initial values similar to the tetracycline vs penicillin example.
Group 1Group 2Rejection region (α = 0.05)p-value
Worked exercises
Exercise 7.1 Workbook · data from ch. 7, ex. 2(a)the workbook only asks to identify factor and variable; the test was added
Tetracycline vs penicillin
Twenty infected rats: 10 treated with tetracycline and 10 with penicillin. Time (h) until symptoms disappear. Do the mean times differ? (\(\alpha=0.05\), normal populations).
\(H_0:\pdm=0\) vs \(H_1:\pdm\ne0\): $$t_{obs}=\frac{39.2-55.3}{16.54\sqrt{0.2}}=-2.18,\quad |t_{obs}|\ge t_{18;0.975}=2.101,\quad p=0.043$$
Conclusion. At the 5 % significance level, the mean time until symptoms disappear differs between antibiotics; it is shorter with tetracycline (16 h less on average).
Conclusion. There is evidence that the treatment increases mean FVC at 6 months (estimated mean increase of 3.1 points, p = 0.001). Comparing them as independent samples would ignore the variability between children.
Exercise 7.3 Course notes · U7, Wilcoxon signed-rank example
Wilcoxon signed-rank test on 10 blocks
Ten pairs of observations with non-normal differences. Does the location of the distributions differ? (two-tailed, \(\alpha=0.05\); table critical value for \(n'=10\): \(t_{0.05}=8\)).
Block
X1
X2
D
Rank
1
80.0
96.5
−16.5
8
2
42.0
40.0
2.0
2
3
57.2
46.7
10.5
6
4
92.0
43.5
48.5
9
5
44.0
35.5
8.5
5
6
35.0
29.8
5.2
4
7
50.0
65.0
−15.0
7
8
32.0
34.5
−2.5
3
9
29.0
30.5
−1.5
1
10
90.0
29.0
61.0
10
Step-by-step solution
Ranks by absolute value of \(D\) (no zeros, \(n'=10\)).
Conclusion. \(H_0\) is not rejected: there is no evidence of a difference in location (with software, p ≈ 0.43).
Integrative exercises
Exercise 7.4 Workbook · ch. 7, ex. 7Integrative
Yield of two soybean varieties: F, t and interval for the difference
The yield of a medium-cycle soybean variety and a long-cycle one is compared in northwestern Argentina, with plots chosen at random in the same region:
Variety
n
x̄ (kg/ha)
s (kg/ha)
Medium cycle
15
3001.3
201.5
Long cycle
19
2741.8
174.3
(a) Is there evidence that mean yield differs by variety? Report the p-value. (b) 95 % CI for the difference of means. (c) Required assumptions.
Step-by-step solution
Independent samples (different plots). First, the variances, with the larger on top: $$F_{obs}=\frac{201.5^2}{174.3^2}=1.336\lt F_{14;18;0.95}=2.29\qquad p=0.278$$ \(\psig_1^2=\psig_2^2\) is not rejected: the pooled variance is used.
\(H_0:\pdm=0\) vs \(H_1:\pdm\ne0\): $$t_{obs}=\frac{3001.3-2741.8}{186.69\sqrt{\frac1{15}+\frac1{19}}}=\frac{259.5}{64.48}=4.02\gt t_{32;0.975}=2.037\qquad p=0.0003$$
(b) $$259.5\pm2.037\cdot64.48=259.5\pm131.3\Rightarrow(128.2;\ 390.8)\ \text{kg/ha}$$ The workbook gives (127.95; 391.04) because of rounding of the table percentile.
(c) Normal yield in both varieties, random and independent samples, and equal variances (checked with the F test).
Conclusion. Mean yields differ (p = 0.0003): the medium-cycle variety yields between 128 and 391 kg/ha more than the long-cycle one (95 %). Since the interval does not contain 0, it agrees with rejecting \(H_0\).
Exercise 7.5 Workbook · ch. 7, ex. 11Integrative
Transfusions with fresh red blood cells: means and proportions
In a multicenter study, 1211 critically ill patients received red blood cells stored for less than 8 days (group I) and 1219 received cells stored longer (group II). Baseline hemoglobin and 90-day mortality were compared:
Group
n
Mean Hb (g/dL)
SD
Deaths
I
1211
7.69
1.28
430
II
1219
7.76
1.01
448
(a) Can it be concluded that the groups do not differ in baseline hemoglobin? (b) The authors conclude that fresh cells do not reduce mortality. Check it.
Step-by-step solution
(a) Variances. $$F_{obs}=\frac{1.28^2}{1.01^2}=1.606\qquad p\lt0.0001$$ With such large samples, even this difference is significant: the variances differ and Welch's test is used.
Means (\(H_0:\pdm=0\) vs \(H_1:\pdm\ne0\)): $$t_{obs}=\frac{7.69-7.76}{\sqrt{\frac{1.28^2}{1211}+\frac{1.01^2}{1219}}}=\frac{-0.07}{0.0468}=-1.50\qquad f\approx2297\qquad p=0.135$$ \(H_0\) is not rejected: the groups are comparable in baseline hemoglobin, as intended in a randomized trial.
(b) Mortality. \(h_1=430/1211=0.355\) and \(h_2=448/1219=0.368\). “Fresh cells reduce mortality” would be \(H_1:\pp_1\lt\pp_2\). Under \(H_0\) the common proportion is estimated from the combined sample: \(h=878/2430=0.361\).
Conclusion. The groups start from the same mean hemoglobin (p = 0.135) and there is no evidence that fresh cells reduce mortality (p = 0.26): the data support the authors' conclusion.
8
ANOVA: more than two samples
One-factor, fixed effects, balanced, in DCA and DBCA.
Concepts
Concept
Analysis of variance and notation
The total variability is split into sources in order to compare \(I\) means at once. Fixed effects: the levels studied are exactly the ones of interest. Random effects: levels drawn from a population of levels. Balanced design: \(J\) observations per level.
$$SC_{Total}=\sum_i\sum_j\big[(Y_{ij}-\bar Y_{i\cdot})+(\bar Y_{i\cdot}-\bar Y_{\cdot\cdot})\big]^2$$Add and subtract \(\bar Y_{i\cdot}\).
$$=\sum\sum(Y_{ij}-\bar Y_{i\cdot})^2+\sum\sum(\bar Y_{i\cdot}-\bar Y_{\cdot\cdot})^2+2\sum_i(\bar Y_{i\cdot}-\bar Y_{\cdot\cdot})\sum_j(Y_{ij}-\bar Y_{i\cdot})$$Square of a binomial.
$$F=\frac{CM_{Trat}}{CM_{Error}}\overset{H_0}{\sim}F_{I-1;\,IJ-I}\qquad\text{rechazar si }F_{obs}\ge F_{I-1;IJ-I;1-\alpha}\ \text{ o }\ p=P(F\ge F_{obs})\le\alpha$$
The rejection region is always right-tailed: a large \(F\) means the levels explain a lot of variability. An \(F\) much smaller than 1 may point to an uncontrolled factor.
FV
SC
gl
CM
F
p
Treatment
\(SC_{Trat}\)
\(I-1\)
\(CM_{Trat}\)
\(CM_{Trat}/CM_{Error}\)
\(P(F\ge F_{obs})\)
Error
\(SC_{Error}\)
\(IJ-I\)
\(CM_{Error}\)
Total
\(SC_{Total}\)
\(IJ-1\)
Proof of the F distribution and the critical value
$$\frac{SC_{Trat}}{\psig^2}\overset{H_0}{\sim}\chi^2_{I-1},\qquad\frac{SC_{Error}}{\psig^2}\sim\chi^2_{IJ-I}$$\(SC_{Error}=\sum_i(J-1)S^2_{i\cdot}\); under \(H_0\) all the \(\pai{i}=0\).
$$F=\frac{SC_{Trat}/[\psig^2(I-1)]}{SC_{Error}/[\psig^2(IJ-I)]}=\frac{CM_{Trat}}{CM_{Error}}\sim F_{I-1;IJ-I}$$Definition of F; \(\psig^2\) cancels out.
$$P(F\ge c_\alpha\mid H_0)=\alpha\Rightarrow c_\alpha=F_{I-1;IJ-I;1-\alpha}$$Percentile of the F.
Concept
Multiple comparisons
If \(H_0\) is rejected, we look for which means differ by comparing them in pairs (\(\pmi{i}=\pmi{j}\) vs \(\ne\)) with the type I error controlled overall: Tukey, Scheffé, Dunnett, Bonferroni, Duncan, LSD.
Reading: levels whose asterisks line up in the same column do not differ; if they share no column, they differ. In the interval plot, overlapping intervals indicate no significant difference.
Blocking takes degrees of freedom away from the error: it only pays off if the blocks really are heterogeneous. Since blocks are not assigned at random, the test for the block effect should be interpreted with caution.
When squaring and summing over \(i\) and \(j\), the three cross products vanish because the deviations of row means, column means and the residuals add up to zero in every row and every column.
Degrees of freedom: $$IJ-1=(I-1)+(J-1)+(I-1)(J-1)$$
Interactive lab
Interactive chart · simulation
ANOVA: variability between and within groups
Four levels with means \(\pmi{i}\) and a common \(\psig\). The thin lines are the deviations within each group (\(SC_{Error}\)); the thick ones, the deviations of each mean from the overall mean (\(SC_{Trat}\)). Bring the means closer or raise \(\psig\) and watch \(F\) drop. Initial values: means from the amines exercise (8.3).
Within deviation (Y − ȳᵢ.)Between deviation (ȳᵢ. − ȳ..)Overall mean
Worked exercises
Exercise 8.1 Workbook · ch. 8, ex. 2
Carbon gases in four industrial zones
Five readings per zone (mg/m³). Does the mean level differ between zones? (\(\alpha=0.05\)).
A
0.047
0.039
0.051
0.048
0.046
B
0.032
0.036
0.031
0.030
0.035
C
0.019
0.021
0.018
0.022
0.017
D
0.041
0.037
0.038
0.047
0.048
Step-by-step solution
Model \(Y_{ij}=\pmu+\pai{i}+\varepsilon_{ij}\), \(i\)=zone (A–D), \(j\)=reading (1–5). The residual plots in the workbook show no departures from normality or homoscedasticity.
Means: A 0.0462, B 0.0328, C 0.0194, D 0.0422. Residual of the 3rd reading of B: \(0.031-0.0328=-0.0018\).
FV
SC
gl
CM
F
p
Zone
0.002127
3
0.000709
50.28
<0.0001
Error
0.000226
16
0.0000141
Total
0.002353
19
\(F_{3;16;0.95}=3.24\).
Scheffé (α = 0.05): C (0.0194) < B (0.0328) < D (0.0422) = A (0.0462).
Conclusion. There is a zone effect (p < 0.0001). Zones A and D have the highest levels and do not differ from each other; B is intermediate and C is the least polluted.
Exercise 8.2 Workbook · ch. 8, ex. 4
Washing solutions for milk containers (DBCA)
Three solutions, one trial of each per day for 6 days (each day is a block). Number of colonies. Work with \(\alpha=0.01\) and compare with the analysis without blocks.
Solution
D1
D2
D3
D4
D5
D6
1
13
22
18
39
22
19
2
16
24
17
44
25
28
3
5
4
1
22
7
15
Step-by-step solution
Factor: solution (3 levels); block: day (6); response: number of colonies. Model \(Y_{ij}=\pmu+\pai{i}+\pbj{j}+\varepsilon_{ij}\).
FV
SC
gl
CM
F
p
Solution
926.78
2
463.39
44.89
<0.0001
Day
1118.94
5
223.79
21.68
<0.0001
Error
103.22
10
10.32
Total
2148.94
17
\(F_{2;10;0.99}=7.56\): \(H_0\) is rejected.
Scheffé (α = 0.01): solution 3 (9.0) < solutions 1 (22.2) and 2 (25.7), which do not differ.
Without blocks, the SC for days goes into the error: \(SC_{Error}=1222.17\), 15 df, \(CM=81.48\), \(F=5.69\), \(p=0.0145\gt0.01\) (\(F_{2;15;0.99}=6.36\)).
Conclusion. Solution 3 is the one that delays bacterial growth the most. The day effect is significant: without blocking, with α = 0.01 no difference between solutions would have been detected.
Exercise 8.3 Workbook · ch. 8, ex. 8
Antifungal amines on wood-decay fungi
Mycelial growth (cm) with three amines and a control, 6 replicates. Given \(CM_{Trat}=48.5556\) and \(SC_{Error}=19.9467\), complete the table and draw a conclusion (\(\alpha=0.05\)).
Control
8.6
10.5
12.5
10.3
11.4
9.3
DMA4
8.3
9.6
7.7
8.1
8.8
7.5
DMA12
5.6
6.4
3.7
5.8
5.0
5.3
DMA16
3.9
4.5
3.6
4.0
5.6
3.6
Step-by-step solution
\(I=4\), \(J=6\): df Trat = 3, df Error = 20, df Total = 23. \(SC_{Trat}=3\cdot48.5556=145.67\).
Tukey: minimum difference \(q_{4;20;0.05}\sqrt{CM_E/J}=3.958\cdot0.408=1.61\). DMA16 (4.20) and DMA12 (5.30) differ by 1.10: not significant. DMA4 (8.33) and Control (10.43) differ from all the others.
Conclusion. The three amines reduce growth compared with the control (p < 0.0001), and the medium- and long-chain ones are the most effective. The data support the authors' claim.
Integrative exercises
Exercise 8.4 Workbook · ch. 8, ex. 5Integrative
Paracetamol: do the five analysts measure the same?
Tablets were ground into a fine homogeneous powder and each of five analysts made six determinations of the paracetamol content (% w/w). (a) Identify factor, levels and variable. (b) Write the model equation. (c) Complete the analysis and conclude, with Tukey comparisons (\(\alpha=0.05\)).
A
84.32
84.51
84.63
84.61
84.64
84.51
B
84.24
84.25
84.41
84.13
84.00
84.30
C
84.29
84.40
84.68
84.28
84.40
84.36
D
84.14
84.22
84.02
84.48
84.27
84.33
E
84.50
84.20
84.49
84.40
84.11
84.06
Step-by-step solution
(a) Factor: analyst, with 5 levels (A to E). Response variable: paracetamol content (% w/w). The units are aliquots of the same homogeneous powder: completely randomized design, \(I=5\), \(J=6\).
(b) \(Y_{ij}=\pmu+\pai{i}+\varepsilon_{ij}\), with \(\varepsilon_{ij}\sim NI(0;\psig^2)\); \(\pai{i}\) is the effect of analyst \(i\). \(H_0:\pmi{A}=\dots=\pmi{E}\).
(c) The residual plots in the workbook show no departures from normality or homoscedasticity.
FV
SC
gl
CM
F
p
Analyst
0.4080
4
0.1020
4.29
0.0089
Error
0.5948
25
0.0238
Total
1.0028
29
\(F_{obs}=4.29\gt F_{4;25;0.95}=2.76\): \(H_0\) is rejected.
Tukey. Minimum significant difference: $$q_{5;25;0.05}\sqrt{CM_{Error}/J}=4.153\sqrt{0.0238/6}=0.262$$ Means: B 84.222, D 84.243, E 84.293, C 84.402, A 84.537. Only A − B = 0.315 and A − D = 0.293 exceed 0.262. Homogeneous groups: {B, D, E, C} and {E, C, A}.
Conclusion. The analysts do not get the same result on average (p = 0.009): A measures more than B and D, and there is no evidence of differences between the other pairs. The procedure of those analysts should be reviewed.
Exercise 8.5 Workbook · ch. 8, ex. 9Integrative
Methylmercury in fish: three techniques in blocks
Three techniques are compared: cold vapor atomic absorption (A), optical emission (B) and mass spectrometry (C). In each of 8 fish muscle samples the concentration was measured with all three (ng/g). (a) Model equation. (b) Null hypothesis. (c) Assumptions and residual of observation 11.3. (d) ANOVA table and Scheffé. (e) What would have been concluded without accounting for the variation between samples?
Sample
1
2
3
4
5
6
7
8
A
10.2
15.8
9.3
28.5
33.6
51.2
21.5
41.5
B
11.3
16.3
7.0
35.4
28.3
60.3
19.2
39.2
C
14.5
20.4
10.1
37.2
41.2
65.8
29.6
51.2
Step-by-step solution
(a) Each fish sample is a block (it receives all three techniques): DBCA with \(I=3\) techniques and \(J=8\) blocks. \(Y_{ij}=\pmu+\pai{i}+\pbj{j}+\varepsilon_{ij}\), \(\varepsilon_{ij}\sim NI(0;\psig^2)\).
(b) \(H_0:\pmi{A}=\pmi{B}=\pmi{C}\): the three techniques measure the same on average.
(c) Assumptions: normal, independent errors with constant variance across techniques and blocks. For 11.3 (technique B, sample 1): $$e_{21}=Y_{21}-\bar Y_{2\cdot}-\bar Y_{\cdot1}+\bar Y_{\cdot\cdot}=11.3-27.125-12.0+29.108=1.283$$
(d)
FV
SC
gl
CM
F
p
Technique
260.36
2
130.18
12.71
0.0007
Sample
6123.26
7
874.75
85.43
<0.0001
Error
143.36
14
10.24
Total
6526.98
23
\(F_{2;14;0.95}=3.74\): \(H_0\) is rejected. Scheffé: A (26.45) and B (27.13) form one group; C (33.75) gives higher values.
(e) Without blocks, the SC for samples goes into the error: \(SC_{Error}=143.36+6123.26=6266.62\) with 21 df, \(CM_{Error}=298.41\), \(F=130.18/298.41=0.44\), \(p=0.65\). No difference would be detected.
Conclusion. Mass spectrometry gives higher concentrations on average than the other two techniques, which do not differ from each other. The variability between fish samples is huge: without the block design that effect would have stayed hidden.
9
Linear regression and correlation
Regression line, inference on its coefficients, R² and Pearson's coefficient.
Concepts
Concept
Regression vs correlation
Regression: a random response variable \(Y\) depends on a controlled explanatory variable \(x\) (set by the researcher). E.g.: absorbance as a function of the concentration of a standard.
Correlation: two random variables measured on the same unit, with no roles; the interest is the strength of the relationship (weight and height; sodium measured by two methods).
Always start with the scatter plot. A deterministic relationship (\(y=5000+2500x\)) leaves no variability; a stochastic one does, and requires a model with error.
$$\frac{\partial}{\partial a}=-2\sum(y_i-a-bx_i)=0\Rightarrow\sum y_i=na+b\sum x_i\Rightarrow a=\bar y-b\bar x$$Derivative with respect to \(a\) set to zero.
$$\frac{\partial}{\partial b}=-2\sum x_i(y_i-a-bx_i)=0\Rightarrow\sum x_iy_i=a\sum x_i+b\sum x_i^2$$Derivative with respect to \(b\).
Proportion of the variability of \(Y\) explained by the line. \(R^2=1\): perfect fit; \(R^2=0\): horizontal line \(\hat y=\bar y\). A high \(R^2\) does not guarantee linearity: always look at the residuals.
ANOVA only tests \(\pb\ne0\); the t test allows one-sided tests. In the two-tailed case \(t_{obs}^2=F_{obs}\) and the p-values match. For \(\pa\) the usual question is whether the line passes through the origin.
FV
SC
gl
CM
F
Regression
\(SC_{Reg}\)
1
\(SC_{Reg}/1\)
\(CM_{Reg}/CM_{Error}\)
Error
\(SC_{Error}\)
\(n-2\)
\(SC_{Error}/(n-2)\)
Total
\(SC_{Total}\)
\(n-1\)
Proof of the critical value (t, right)
$$P(B\ge c_\alpha\mid\pb=0)=\alpha\Rightarrow P\Big(T\ge\frac{c_\alpha-0}{\sqrt{CM_E/[(n-1)s^2_x]}}\Big)=\alpha$$Type I error and construction of the T.
$$c_\alpha=t_{n-2;1-\alpha}\sqrt{\frac{CM_{Error}}{(n-1)s^2_x}}$$Percentile of the t and solving.
The covariance gives the direction but is unbounded and depends on the units; \(\prho\) fixes both.
\(\prho=\pm1\): perfect linear relationship. Independence ⇒ \(\prho=0\), but \(\prho=0\) does not imply independence (there may be a nonlinear relationship).
\(b_1\) and \(b_2\) have the same sign. With \(|r|=1\) the lines coincide; with \(r=0\) they are perpendicular (\(\hat y=\bar y\), \(\hat x=\bar x\)).
Interactive lab
Interactive chart
Least squares regression: drag the points
Drag any point or tap an empty spot to add one. The line, the residuals, the 95 % confidence band for \(\pmyx\), \(R^2\), \(r\) and the test for \(\pb=0\) are recomputed instantly. Try moving a single point away from the line and see how much the slope changes.
Observationsŷ = a + bxResiduals95 % CI bandx̂ = a₂ + b₂y
Worked exercises
Exercise 9.1 Workbook · ch. 9, ex. 2
Calibration curve for starch in sugar
Absorbance of starch standards (mg/kg). (a) Least squares line. (b) Residual at \(x=100\). (c) Does the line pass through the origin? (\(\alpha=0.05\)).
\(CM_{Error}=1.6245\times10^{-5}/7=2.32\times10^{-6}\). $$t_{obs}=\frac{0.0254}{\sqrt{2.32\times10^{-6}\big(\frac19+\frac{225.83^2}{386550}\big)}}=\frac{0.0254}{0.000751}=33.83$$ \(t_{7;0.975}=2.365\), p < 0.0001.
Conclusion. \(\hat y=0.0254+0.000493\,x\). \(\pa=0\) is rejected: the line does not pass through the origin (there is a background absorbance of about 0.025 units). Each mg/kg of starch increases absorbance by 0.000493 on average.
Exercise 9.2 Workbook · ch. 9, ex. 3
Caffeine by HPLC: calibration and inverse prediction
Peak area vs caffeine concentration (ppm). (a) Line. (b) Test \(\pb=0\) (\(\alpha=0.05\)). (c) \(R^2\). (d) Concentration for an area of 520. (e) And for 2500?
For 2500 it would give ≈ 40 ppm, far outside the range studied (2 to 16 ppm): extrapolating is not reliable.
Conclusion. There is a significant linear regression and the line explains 99.9 % of the variability of the area. A sample with area 520 contains about 8.3 ppm of caffeine.
Exercise 9.3 Workbook · ch. 9, ex. 9
Co-expression of two genes in Arabidopsis
mRNA expression of two genes under 10 experimental conditions. Both variables are random: analyze their association.
Gene 1
445
1284
723
3045
203
1009
1132
1894
834
2300
Gene 2
9045
16943
6534
30928
3698
11960
13850
20394
20394
25290
Step-by-step solution
It is a correlation problem (no controlled variable). The scatter plot shows a direct linear relationship.
Lines: \(\hat y=4437.39+8.910\,x\) and \(\hat x=-217.34+0.0946\,y\). Check: \(\sqrt{8.910\cdot0.0946}=0.918\).
\(r^2=0.843\).
Conclusion. Strong direct linear association (\(r=0.918\)): the genes are co-expressed, and 84 % of the variability of one is linearly associated with the other.
Integrative exercises
Exercise 9.4 Workbook · ch. 9, ex. 5Integrative
Degradation of a drug: choose the model and predict
The label of a solution states 1.5 % of active ingredient, but at the start of the experiment (day 0) 1.25 % was measured. The concentration was followed for 25 days:
Days
0
5
10
15
20
25
C (%)
1.25
1.04
0.87
0.72
0.60
0.50
The process is zero order if \(C\) is linear in \(t\); first order if \(\ln C\) is (\(C_t=C_0e^{-kt}\)); second order if \(1/C\) is. (a) Determine the order. (b) Estimate the rate constant \(k\). (c) How much time passed between manufacture and day 0? (d) Half-life and time for the concentration to drop 10 % below the label. (e) Concentration at 10 days.
Step-by-step solution
(a) The three lines are fitted by least squares:
Model
Line
R²
Residuals
Order 0: C
1.2029 − 0.02983 t
98.30 %
curvature (+ − − − − +)
Order 1: ln C
0.22374 − 0.03669 t
99.99 %
no pattern
Order 2: 1/C
0.7310 + 0.04774 t
98.25 %
curvature (+ − − − − +)
All three \(R^2\) are high, but only the first-order one has residuals with no curved pattern. The reaction is first order.
(b) The slope of \(\ln C\) as a function of \(t\) is \(-k\): \(k=0.03669\) day⁻¹. The intercept gives \(\hat C_0=e^{0.22374}=1.251\) %.
(c) Find \(t\) such that \(C=1.5\): $$\ln1.5=0.22374-0.03669\,t\Rightarrow t=\frac{0.22374-0.40547}{0.03669}=-4.95$$ The drug was manufactured about 5 days before the start.
(d) Half-life (from 1.5 % to 0.75 %): \(t_{1/2}=\ln2/k=18.9\approx19\) days. Dropping 10 % below the label means reaching 1.35 %: $$t=\frac{\ln(1.5/1.35)}{k}=\frac{0.1054}{0.03669}=2.9\ \text{days after manufacture}$$ On the experiment's time scale that is \(t=-2.1\): about 2 days before day 0, which is the workbook's answer.
Conclusion. The degradation is first order, with \(k=0.0367\) day⁻¹ and a half-life of about 19 days. The product had already lost more than 10 % of its stated content when the experiment began: that happened 3 days after manufacture.
Exercise 9.5 Workbook · ch. 9, ex. 11Integrative
Lead in juices by two methods: correlation and paired test
Lead (µg/mL) was measured in 10 juices with a new potentiometric method (APR) and by atomic absorption (EAA). (a) Scatter plot. (b) Estimate the parameter that measures the strength of the relationship. (c) Do both methods measure, on average, the same concentration? (\(\alpha=0.05\)).
Juice
1
2
3
4
5
6
7
8
9
10
EAA
35
75
75
80
125
205
205
215
240
350
APR
35
70
80
80
120
200
220
200
250
330
Step-by-step solution
(a) Both are random variables measured on the same juice, with no controlled variable: it is a correlation problem. The points line up along an increasing line.
(b) \(\bar x_{EAA}=160.5\), \(s_{EAA}=98.47\); \(\bar x_{APR}=158.5\), \(s_{APR}=95.40\); \(S_{XY}=9342.5\). $$r=\frac{S_{XY}}{S_XS_Y}=\frac{9342.5}{98.47\cdot95.40}=0.9945$$ Very strong direct linear association.
(c) A high correlation does not guarantee that the methods agree: they could differ by a constant. To compare means, use the paired test (each juice is a block). With \(d=\text{EAA}-\text{APR}\): 0, 5, −5, 0, 5, 5, −15, 15, −10, 20, we get \(\bar d=2.0\) and \(s_D=10.59\).
\(H_0:\pmd=0\) vs \(H_1:\pmd\ne0\): $$t_{obs}=\frac{2.0}{10.59/\sqrt{10}}=0.60\lt t_{9;0.975}=2.262\qquad p=0.565$$
Conclusion. The methods are strongly correlated (r = 0.9945) and there is no evidence that they differ on average (p = 0.57): the new APR method agrees with atomic absorption.
Σ
Summary table
Parameter, estimator, pivot variable and distribution. Rows are marked when you pick a parameter.
What each symbol in the notes means. Tap one to highlight it in every formula. The notation follows the original Spanish course: SC = sum of squares, CM = mean square, gl = degrees of freedom, FV = source of variation, DCA = completely randomized design, DBCA = randomized complete block design.
No cards match. Try another unit, another parameter, or clear the search.