# Statistics with R

## Student Resources

# Chapter 11: Comparisions of Means and Proportions

1. Consider the following information about two independent random samples. For sample 1: n_{1} = 34, x̅_{1} = 72, and s_{1} = 8; for sample 2, n_{2} = 40, x̅_{2} = 64, and s_{2} = 10. What is the point estimate of the difference between the two population means, μ_{1} - μ_{2}?

- 6
- 2
- 4
- 8 X

**Solution:**

> difference <- 72 - 64

> difference

[1] 8

2. If the desired level of confidence is 90%, what is the margin of error?

- 3.488231 X
- 5.538845
- 4.173131
- 4.980764

**Solution:**

> MOE_90 <- qt(0.05, 34 + 40 - 2, lower.tail = FALSE) * sqrt(8 ^ 2 / 34 + 10 ^ 2 / 40)

> MOE_90

[1] 3.488231

3. What is the 90% confidence interval estimate of the difference between the two population means, μ_{1} - μ_{2}?

- 5.253647 to 10.74643
- 2.461155 to 13.53884
- 4.511769 to 11.48823 X
- 3.826869 to 12.17313

**Solution:**

> difference - MOE_90

[1] 4.511769

and

> difference + MOE_90

[1] 11.48823

4. What is the 95% confidence interval estimate of the difference between the two population means, μ_{1} - μ_{2}?

- 5.253647 to 10.74643
- 2.461155 to 13.53884
- 4.511769 to 11.48823
- 3.826869 to 12.17313 X

**Solution:**

> MOE_95 <- qt(0.025, 34 + 40 - 2,lower.tail = FALSE) * sqrt(8 ^ 2 / 34 + 10 ^ 2 / 40)

> MOE_95

[1] 4.173131

Therefore

> difference - MOE_95

[1] 3.826869

and

> difference + MOE_95

[1] 12.17313

5. What is the 99% confidence interval estimate of the difference between the two population means, μ_{1} - μ_{2}?

- 5.253647 to 10.74643
- 2.461155 to 13.53884 X
- 4.511769 to 11.48823
- 3.826869 to 12.17313

**Solution:**

> MOE_99 <- qt(0.005, 34 + 40 - 2,lower.tail = FALSE) * sqrt(8 ^ 2 / 34 + 10 ^ 2 / 40)

> MOE_99

[1] 5.538845

Therefore

> difference - MOE_99

[1] 2.461155

and

> difference + MOE_99

[1] 13.53884

6. The following sample results have been obtained from two independent populations (one consisting of men, the other of women) involving a preliminary vote in connection with a political candidate who is running for higher office. For sample 1 (men), 250 have voted ‘yes’ but 150 have voted ‘no.’ For sample 2 (women), 220 have voted ‘yes,’ but 220 have voted ‘no.’ What is the point estimate of the difference between the two population proportions, p_{1} - p_{2}?

- 0.125 X
- 0.625
- 0.563
- 0.500

**Solution:**

> difference <- (250 / (250 + 150)) - (220 / (220 + 220))

> difference

[1] 0.125

7. If the desired level of confidence is 90%, what is the margin of error?

- 0.06705542
- 0.04470361
- 0.04917397
- 0.05587951 X

**Solution:**

> pbar1 <- 250 / 400

> pbar2 <- 220 / 440

> MOE_90 <- qnorm(0.05, lower.tail = FALSE) * sqrt(((pbar1) * (1 - pbar1) / 400) + (pbar2) * (1 - pbar2) / 440)

> MOE_90

[1] 0.05587951

8. What is the 90% confidence interval estimate of the difference between the two population proportions?

- 0.03749307 to 0.2125069
- 0.06912049 to 0.1808795 X
- 0.05841545 to 0.1915845
- 0.06801314 to 0.1819874

**Solution:**

> difference - MOE_90

[1] 0.06912049

and

> difference + MOE_90

[1] 0.1808795

9. What is the 95% confidence interval estimate of the difference between the two population proportions?

- 0.03749307 to 0.2125069
- 0.06912049 to 0.1808795
- 0.05841545 to 0.1915845 X
- 0.06801314 to 0.1819874

**Solution:**

> MOE_95 <- qnorm(0.025, lower.tail = FALSE) * sqrt(((pbar1) * (1 - pbar1) /400) + (pbar2) * (1 - pbar2) / 440)

> MOE_95

[1] 0.06658455

Therefore

> difference - MOE_95

[1] 0.05841545

and

> difference + MOE_95

[1] 0.1915845

10. What is the 99% confidence interval estimate of the difference between the two population proportions?

- 0.03749307 to 0.2125069 X
- 0.06912049 to 0.1808795
- 0.05841545 to 0.1915845
- 0.06801314 to 0.1819874

**Solution:**

> MOE_99 <- qnorm(0.005, lower.tail = FALSE) * sqrt(((pbar1)*(1 - pbar1)/400) + (pbar2)*(1 - pbar2)/440)

> MOE_99

[1] 0.08750693

Therefore

> difference - MOE_99

[1] 0.03749307

and

> difference + MOE_99

[1] 0.2125069