Tutorials › VEE Mathematical Statistics › Worked Problems Across Classical Test Procedures

VEE Mathematical Statistics · Classical Tests and Goodness of Fit · Tutorial 696 of 880

Worked Problems Across Classical Test Procedures

Work through how to select and calculate common classical tests, identify their reference distributions and degrees of freedom, and avoid common decision errors.

Intermediate 12 min read

What You'll Learn

  • Select a one-sample t procedure for a population mean and identify its assumptions and degrees of freedom.
  • Calculate a Welch two-sample t statistic and approximate reference degrees of freedom.
  • Use a pooled estimate under the null hypothesis in a two-proportion z test.
  • Form a chi-square test statistic for one population variance.
  • Calculate goodness-of-fit and contingency-table statistics with their appropriate degrees of freedom.
  • Interpret a test decision in context without treating failure to reject as proof of the null hypothesis.

Turning a Test Description into a Calculation

Classical test problems often provide several sample summaries and ask for a test statistic, a reference distribution, or a conclusion. A reliable solution starts by identifying the parameter and the null hypothesis. Then match the data structure to a test, check the assumptions for that procedure, calculate the statistic, and determine its degrees of freedom when relevant. The same observed difference can lead to different calculations depending on whether the samples are paired, whether a variance is known, and whether a proportion is estimated under the null.

The examples below use standard test procedures aligned with the SOA VEE Mathematical Statistics syllabus. Unless stated otherwise, decisions use a significance level of \(\alpha=0.05\). A test decision is about whether the observed data provide sufficient evidence against the null hypothesis; failing to reject it does not establish that it is true.

Definition: A test statistic is a function of the sample data whose distribution under the null hypothesis is known or approximated under stated assumptions. The reference distribution is that null distribution. A test's degrees of freedom specify the particular member of a family such as the \(t\) or chi-square distributions.

For a one-sided test, evidence against the null lies in the direction specified by the alternative. For a two-sided test, evidence lies in either tail. A critical-value decision compares the statistic with a cutoff chosen for the alternative and \(\alpha\); equivalently, a p-value is compared with \(\alpha\). The examples state which direction is being tested so the relevant comparison is unambiguous.

One-Sample and Two-Sample Tests for Means

For a sample of \(n\) independent observations from a normal population with unknown mean \(\mu\) and unknown standard deviation, let \(\bar X\) be the sample mean and \(S\) the sample standard deviation. To test \(H_0:\mu=\mu_0\), use the one-sample \(t\) statistic. Its reference distribution under the null is a \(t\) distribution with \(n-1\) degrees of freedom. Normality is important for an exact small-sample test; with larger samples, an approximate procedure may be justified under suitable conditions.

$$ t=\frac{\bar X-\mu_0}{S/\sqrt{n}},\qquad \text{degrees of freedom}=n-1. $$

Worked Example: A One-Sample Test of a Mean

A laboratory measures the processing time, in minutes, for 16 independently selected samples. Assume processing times are normally distributed. The sample mean is 42 minutes and the sample standard deviation is 8 minutes. Test \(H_0:\mu=38\) against \(H_1:\mu>38\) at the 5% level.

Method and assumptions. The population standard deviation is unknown, the observations are independent, and the stated normal model supports a one-sample \(t\) test. The alternative is upper-tailed.

Calculate the standard error. \(S/\sqrt n=8/\sqrt{16}=8/4=2\) minutes.

Calculate the statistic and degrees of freedom.

$$ t=\frac{42-38}{2}=2.00,\qquad df=16-1=15. $$

The 5% upper-tail critical value for 15 degrees of freedom is approximately 1.753. Since \(2.00>1.753\), reject \(H_0\). The data provide evidence that the mean processing time exceeds 38 minutes.

Check and common mistake. The statistic is positive, as expected because \(42>38\). A common error is to divide the sample standard deviation by \(n\) instead of \(\sqrt n\); that would give a standard error of \(0.5\), not \(2\), and an incorrect statistic of 8.

For two independent samples, the choice between pooled and Welch procedures depends on the variance assumptions. When equal population variances are justified, the pooled \(t\) procedure estimates a common variance. When equal variances are not assumed, Welch's procedure uses separate sample variances and an approximate degrees-of-freedom formula. The paired procedure instead analyzes within-pair differences; it is not the same as treating paired measurements as independent samples.

Worked Example: Comparing Two Independent Means with Welch's Test

Two independent groups evaluate a hypothetical service. Group A has \(n_1=10\), \(\bar x_1=18\), and \(s_1=4\); Group B has \(n_2=12\), \(\bar x_2=15\), and \(s_2=3\). Assume each group is sampled independently from a normal population, and do not assume equal population variances. Test \(H_0:\mu_1-\mu_2=0\) against a two-sided alternative at the 5% level.

Method and assumptions. Use Welch's two-sample \(t\) procedure because the samples are independent and equal variances are not assumed. The estimated standard error is the square root of the sum of the two sample-variance contributions.

Calculate the standard error.

$$ SE=\sqrt{\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}} =\sqrt{\frac{16}{10}+\frac{9}{12}} =\sqrt{1.6+0.75} =\sqrt{2.35} \approx 1.533. $$

Calculate the statistic. The observed difference is \(18-15=3\), so \(t=3/1.533\approx1.957\).

Calculate the approximate degrees of freedom. Welch's formula is

$$ \nu= \frac{(s_1^2/n_1+s_2^2/n_2)^2} {(s_1^2/n_1)^2/(n_1-1)+(s_2^2/n_2)^2/(n_2-1)} = \frac{2.35^2}{1.6^2/9+0.75^2/11} = \frac{5.5225}{0.28444+0.05114} \approx16.45. $$

The two-sided 5% critical value is approximately 2.12 for about 16 degrees of freedom. Since \(|1.957|<2.12\), do not reject \(H_0\). These data do not provide sufficient evidence of a difference in population means at the 5% level.

Check and common mistake. The difference and standard error are both expressed in the same units, so the statistic is dimensionless. Do not use \(n_1+n_2-2=20\) degrees of freedom here: that is associated with the equal-variance pooled procedure, not Welch's approximate degrees of freedom.

Two-Proportion Tests

For two independent samples with binary outcomes, let \(X_1\) and \(X_2\) be the numbers of successes from sample sizes \(n_1\) and \(n_2\). To test \(H_0:p_1=p_2\), the pooled two-proportion \(z\) test estimates the common null proportion using all successes divided by all observations. This pooling is used because the null hypothesis asserts that the two population proportions are equal.

$$ \hat p=\frac{X_1+X_2}{n_1+n_2},\qquad z=\frac{X_1/n_1-X_2/n_2} {\sqrt{\hat p(1-\hat p)(1/n_1+1/n_2)}}. $$

The \(z\) reference distribution is standard normal as an approximation. The samples should be independent, and expected success and failure counts under the null should be large enough for the normal approximation to be reasonable.

Worked Example: Comparing Two Success Proportions

In a hypothetical study, 78 of 120 participants in Group A and 50 of 100 participants in Group B complete a task. Test whether the population proportions differ at the 5% level.

Method and assumptions. The samples are independent binary-outcome samples, so use the pooled two-proportion \(z\) test for \(H_0:p_1=p_2\) against \(H_1:p_1\ne p_2\).

Find the sample proportions and pooled estimate. The observed proportions are \(78/120=0.65\) and \(50/100=0.50\). Under the null, the pooled estimate is

$$ \hat p=\frac{78+50}{120+100}=\frac{128}{220}\approx0.5818. $$

Calculate the standard error.

$$ SE=\sqrt{0.5818(1-0.5818)\left(\frac1{120}+\frac1{100}\right)} =\sqrt{0.2433(0.018333)} \approx\sqrt{0.004461} \approx0.06679. $$

Calculate and interpret the statistic. The observed difference is \(0.65-0.50=0.15\), giving \(z=0.15/0.06679\approx2.246\). The two-sided p-value is approximately 0.0247, which is less than 0.05. Reject \(H_0\); the data provide evidence of different population success proportions.

Check and common mistake. Under the null, pooled expected success counts are \(120(0.5818)\approx69.82\) and \(100(0.5818)\approx58.18\); the corresponding failure counts are also large. Do not use either sample proportion alone in the null standard error: the pooled estimate reflects the equality imposed by \(H_0\).

The pooled estimate has a direct justification. If both populations share a common success probability \(p\) under \(H_0\), the combined samples contain \(X_1+X_2\) successes among \(n_1+n_2\) independent trials. The maximum-likelihood estimate of that common probability is therefore

$$ \hat p=\frac{X_1+X_2}{n_1+n_2}. $$

Substituting this estimate into the null variance of the difference of two independent sample proportions gives the standard error in the pooled \(z\) statistic. Without the equality null, pooling would not be justified in this way.

Tests for a Population Variance

For a random sample of \(n\) independent observations from a normal population with variance \(\sigma^2\), the statistic \((n-1)S^2/\sigma_0^2\) has a chi-square distribution with \(n-1\) degrees of freedom when \(H_0:\sigma^2=\sigma_0^2\) is true. The normal-population assumption is essential for this exact result. An upper-tailed alternative looks for unusually large values; a two-sided alternative uses both tails.

Worked Example: Testing Whether a Variance Exceeds a Target

A normal-population model is assumed for measurements from 20 independent devices. The sample variance is \(s^2=25\). Test \(H_0:\sigma^2=16\) against \(H_1:\sigma^2>16\) at the 5% level.

Method and assumptions. Use the chi-square test for one normal population variance. The sample size is \(n=20\), so the reference degrees of freedom are \(19\).

Calculate the statistic.

$$ \chi^2=\frac{(n-1)s^2}{\sigma_0^2} =\frac{19(25)}{16} =\frac{475}{16} =29.6875,\qquad df=19. $$

The upper-tail 5% critical value is approximately 30.144. Since \(29.6875<30.144\), do not reject \(H_0\). At the 5% level, the sample does not provide sufficient evidence that the population variance exceeds 16.

Check and common mistake. The numerator uses \(n-1=19\), not \(n=20\). Also, this procedure tests a variance under a normal model; applying the same reference distribution to an arbitrary nonnormal population is not generally valid.

Goodness of Fit and Categorical Association

A Pearson goodness-of-fit test compares observed counts in mutually exclusive categories with expected counts under a specified probability model. If there are \(k\) categories, the model probabilities are fixed in advance, and the expected counts are adequate, the statistic has an approximate chi-square reference distribution with \(k-1\) degrees of freedom. Estimating parameters from the data changes the degrees of freedom; the simple \(k-1\) formula applies only when the category probabilities are fixed.

A Pearson test of independence instead uses a two-way contingency table to assess whether two categorical variables are associated in a population. For an \(r\)-by-\(c\) table, expected counts under independence are calculated from the observed margins, and the approximate reference degrees of freedom are \((r-1)(c-1)\). These approximations require adequate expected counts; when they are poor, a different method may be needed.

Worked Example: Goodness of Fit to Fixed Category Probabilities

A hypothetical device assigns each event to one of four categories with specified probabilities \(0.10, 0.20, 0.30,\) and \(0.40\). In 100 independent events, the observed counts are \(8, 25, 27,\) and \(40\). Test the specified model at the 5% level.

Method and assumptions. Use Pearson's chi-square goodness-of-fit statistic. The probabilities are fixed, the observations are independent, and the expected counts are all at least 10.

Calculate expected counts and contributions. Multiplying 100 by each probability gives expected counts \(10,20,30,40\). Thus

$$ \chi^2= \frac{(8-10)^2}{10} +\frac{(25-20)^2}{20} +\frac{(27-30)^2}{30} +\frac{(40-40)^2}{40} =0.40+1.25+0.30+0 =1.95. $$

There are \(k-1=4-1=3\) degrees of freedom. The 5% upper-tail critical value is 7.815. Since \(1.95<7.815\), do not reject the specified category model.

Check and common mistake. The expected counts sum to \(10+20+30+40=100\), matching the sample size. Using observed counts as denominators in the Pearson contributions would be incorrect; each denominator is the expected count under the null.

Worked Example: Testing Independence in a Contingency Table

A hypothetical survey records a preference category for two independent groups of 60 respondents each. The column totals for three preference categories are 30, 50, and 40. Group A's counts are \(20,25,15\), and Group B's are \(10,25,25\). Test independence between group and preference at the 5% level.

Method and assumptions. Use Pearson's chi-square test of independence. Respondents contribute to one cell each, and all expected counts must be checked. The row totals are 60 and 60, so under independence each expected count is its row total times its column total divided by the grand total of 120.

Calculate expected counts. In each row, expected counts are \(60(30)/120=15\), \(60(50)/120=25\), and \(60(40)/120=20\). All are at least 5.

Calculate the statistic.

$$ \chi^2= \frac{(20-15)^2}{15}+\frac{(25-25)^2}{25}+\frac{(15-20)^2}{20} +\frac{(10-15)^2}{15}+\frac{(25-25)^2}{25}+\frac{(25-20)^2}{20} =\frac{25}{15}+0+\frac{25}{20}+\frac{25}{15}+0+\frac{25}{20} \approx5.833. $$

For a \(2\)-by-\(3\) table, the degrees of freedom are \((2-1)(3-1)=2\). The 5% upper-tail critical value is 5.991. Since \(5.833<5.991\), do not reject independence at the 5% level.

Check and common mistake. The expected counts reproduce the margins: each row sums to 60 and the column totals are 30, 50, and 40. Do not use \(6-1=5\) degrees of freedom just because the table has six cells; the row and column margins constrain the table.

A Practical Checklist and Common Trap

The calculations differ across procedures, but the logic is consistent. State the null and alternative, identify the sampling structure and model assumptions, calculate the statistic using the null value or null model, and then use the matching reference distribution and degrees of freedom. In particular, paired observations require a test on the pairwise differences; two independent samples require an independent-sample procedure; and categorical counts require expected counts based on the relevant null model.

A frequent exam error is to select a reference distribution from the statistic's appearance alone. For example, a statistic that looks like a squared standardized difference is not automatically compared with a chi-square distribution: the sampling model and constraints determine its reference law. Similarly, the degrees of freedom are not always the sample size minus one; they depend on which quantity is being tested and on what has been estimated.

Key takeaway: A correct test calculation consists of more than a numerical statistic. Name the procedure, state its assumptions, give its reference distribution and degrees of freedom, and interpret the decision in the context of the alternative hypothesis.

Check Your Understanding

For each problem, identify the procedure and report the requested statistic, reference degrees of freedom when applicable, and decision at the stated significance level.

  1. A normal population is sampled independently \(n=25\) times, giving \(\bar x=103\) and \(s=10\). Test \(H_0:\mu=100\) against a two-sided alternative at 5%. (Answer: one-sample \(t=1.50\), \(df=24\); do not reject at 5%.)
  2. Two independent normal populations are sampled with equal variances assumed. Each sample has size 9; the sample means are 52 and 47, and both sample standard deviations are 6. Test equality of means against a two-sided alternative at 5%. (Answer: pooled \(t=1.768\), \(df=16\); do not reject at 5%.)
  3. In two independent samples, 52 of 80 and 50 of 100 individuals have a specified response. Test equality of proportions against a two-sided alternative at 5%. (Answer: pooled \(\hat p=102/180=0.5667\), \(z\approx2.018\); reject equality at 5%.)
  4. A normal population sample has \(n=15\) and \(s^2=12\). Test \(H_0:\sigma^2=9\) against a two-sided alternative at 5%. (Answer: \(\chi^2=14(12)/9=18.667\), \(df=14\); do not reject at 5%.)
  5. A model assigns equal probabilities to four categories. In 80 independent observations, the counts are \(15,25,20,20\). Test the model at 5%. (Answer: expected counts \(20,20,20,20\); \(\chi^2=2.50\), \(df=3\); do not reject at 5%.)
Clinical Biostats