| z | P(-1 ≤ z ≤ 1) |
|---|---|
| (-1, 1) | 0.68 |
| (-2, 2) | 0.95 |
| (-3, 3) | 0.997 |
> pnorm(1) - pnorm(-1) [1] 0.6826895 > pnorm(2) - pnorm(-2) [1] 0.9544997 > pnorm(3) - pnorm(-3) [1] 0.9973002
> qnorm(0.025) [1] -1.959964For a 99% confidence interval, the area of the two tails is 100% - 99% = 1% and area in one tail is 1% / 2 = 0.5% = 0.005. Using R:
> qnorm(0.005) [1] -2.575829
> t.test(conc, mu=70)
One Sample t-test
data: conc
t = 2.16, df = 4, p-value = 0.09689
alternative hypothesis: true mean is not equal to 70
95 percent confidence interval:
67.774 87.826
sample estimates:
mean of x
77.8
Conclusion: because p = 0.09689 ≥ 0.05, reject the null hypothesis. There is not enough evidence
to reject the null hypothesis.78 82 71 75 80 72 79 74 77 76Perform the calculations "by hand" using R. Then verify your work using the R t.test function. Also use the t.test function at the 0.99 confidence level.
1219 1214 1087 1200 1419 1121 1235 1345 1244 1258 1356 1132 1191 1270 1295 1135
38.4 57.6 46.2 55.5 62.5 49.5 38.0 40.9 62.8 44.3 33.9 93.8 50.4 47.9 35.0 69.2 52.8 46.2 60.1 56.3 55.1
29.3 28.2 29.1 28.7 28.9 28.5.
> dbinom(5000, 10000, 0.5) [1] 0.007978646The two values 0.007978713 and 0.007978646 are not exactly the same, but the normal approximation is very good because n is large at 10,000.
> # Calculate the probability of between > # 4,850 and 5,100 successes out of 10,000 trials > # > # Normal approximation: > pnorm(5100.5, mean=5000, sd=50) - + pnorm(4849.5, mean=5000, sd=50) [1] 0.9764782 > > # Exact calculation with pbinom: > pbinom(5100, size=10000, prob=0.5) - + pbinom(4849, size=10000, prob=0.5) [1] 0.9764817
SoleMaterialA: 13.2 8.2 10.9 14.3 10.7 6.6 9.5 10.8 8.8 13.3 SoleMaterialB: 14.0 8.8 11.2 14.2 11.8 6.4 9.8 11.3 9.3 13.6
Before: 70 80 75 85 90 70 After: 75 82 73 90 95 75
We will discuss this section again on May 9.
SoleMaterialA: 13.2 8.2 10.9 14.3 10.7 6.6 9.5 10.8 8.8 13.3 SoleMaterialB: 14.0 8.8 11.2 14.2 11.8 6.4 9.8 11.3 9.3 13.6Load this data into the two data vectors materialA and materialB. Then perform an independent two-sample t-test with R.
> t.test(materialA, materialB, var.equal=TRUE)This test uses the test statistic
.
.> t.test(materialA, materialB, var.equal=FALSE)Computational details are not shown here.
Early Bird: 23 28 27 33 26 30 22 25 26 Night Owl: 26 10 20 19 26 18 12 25