Home page for accesible maths 3.2 Difference of two means

Style control - access keys in brackets

Font (2 3) - + Letter spacing (4 5) - + Word spacing (6 7) - + Line spacing (8 9) - +

3.2.3 Hypothesis tests based on a difference in means

A data set called baby_ smoke represents a random sample of 150 cases of mothers and their newborns in North Carolina over a year. Four cases from this data set are represented in Table 3.4. We are particularly interested in two variables: weight and smoke. The weight variable represents the weights of the newborns and the smoke variable describes which mothers smoked during pregnancy. We would like to know, is convincing evidence that newborns from mothers who smoke have a different average birth weight than newborns from mothers who don’t smoke? We will use the North Carolina sample to try to answer this question. The smoking group includes 50 cases and the nonsmoking group contains 100 cases, represented in Figure LABEL:babySmokePlotOfTwoGroupsToExamineSkew.

R> data(births)
R> hist(births[births[,14] == ’smoker’,11], xlim=c(0, 11))
R> hist(births[births[,14] == ’nonsmoker’,11], xlim=c(0, 11))

fAge mAge weeks weight sexBaby smoke
1 NA 13 37 5.00 female nonsmoker
2 NA 14 36 5.88 female nonsmoker
3 19 15 41 8.13 male smoker
150 45 50 36 9.25 female nonsmoker
Table 3.4: Four cases from the baby_ smoke data set. The value ‘‘NA’’, shown for the first two entries of the first variable, indicates that piece of data is missing.
Example 3.2.1

Set up appropriate hypotheses to evaluate whether there is a relationship between a mother smoking and average birth weight.

Answer. The null hypothesis represents the case of no difference between the groups.

  • H0:

    There is no difference in average birth weight for newborns from mothers who did and did not smoke. In statistical notation: μn-μs=0, where μn represents non-smoking mothers and μs represents mothers who smoked.

  • HA:

    There is some difference in average newborn weights from mothers who did and did not smoke (μn-μs0).

Summary statistics are shown for each sample in Table 3.5. Because the data come from a simple random sample and consist of less than 10% of all such cases, the observations are independent. Additionally, each group’s sample size is at least 30 and the skew in each sample distribution is strong (see Figure LABEL:babySmokePlotOfTwoGroupsToExamineSkew). The skew is reasonable for these sample sizes of 50 and 100. Therefore, each sample mean is associated with a nearly normal distribution.

smoker nonsmoker
mean 6.78 7.18
st. dev. 1.43 1.60
samp. size 50 100
Table 3.5: Summary statistics for the baby_ smoke data set.
Example 3.2.2

(a) What is the point estimate of the population difference, μn-μs? (b) Can we use a normal distribution to model this difference? (c) Compute the standard error of the point estimate from part (a).

Answer. (a) The difference in sample means is an appropriate point estimate: x¯n-x¯s=0.40.
(b) Because the samples are independent and each sample mean is nearly normal, their difference is also nearly normal.
(c) The standard error of the estimate can be estimated using Equation (3.1):

SE=σn2nn+σs2nssn2nn+ss2ns=1.602100+1.43250=0.26

The standard error estimate should be sufficiently accurate since the conditions were reasonably satisfied.

Example 3.2.3

If the null hypothesis from Example 3.2.1 was true, what would be the expected value of the point estimate? And the standard deviation associated with this estimate? Draw a picture to represent the p-value.

Answer. If the null hypothesis was true, then we expect to see a difference near 0. The standard error corresponds to the standard deviation of the point estimate: 0.26. To depict the p-value, we draw the distribution of the point estimate as though H0 was true and shade areas representing at least as much evidence against H0 as what was observed. Answer. Both tails are shaded because it is a two-sided test.

Example 3.2.4

Compute the p-value of the hypothesis test using the figure in Example 3.2.3, and evaluate the hypotheses using a significance level of α=0.05.

Answer. Since the point estimate is nearly normal, we can find the upper tail using the Z score and pnorm:

Z= 0.40-00.26=1.54upper tail =1-(Z<1.54)=1-0.938=0.062

Because this is a two-sided test and we want the area of both tails, we double this single tail to get the p-value: 0.124. This p-value is larger than the significance value, 0.05, so we fail to reject the null hypothesis. There is insufficient evidence to say there is a difference in average birth weight of newborns from North Carolina mothers who did smoke during pregnancy and newborns from North Carolina mothers who did not smoke during pregnancy.

Example 3.2.5

Does the conclusion to Example 3.2.4 mean that smoking and average birth weight are unrelated?

Answer. Absolutely not. It is possible that there is some difference but we did not detect it. If this is the case, we made a Type 2 Error.

Example 3.2.6

If we made a Type 2 Error and there is a difference, what could we have done differently in data collection to be more likely to detect such a difference?

Answer. We could have collected more data. If the sample sizes are larger, we tend to have a better shot at finding a difference if one exists.