Solutions for Exercises in Statistics
Exercise 4.1
a) test for standard deviation, one-sided b) test for mean, one-sided
c) test for proportion, one-sided d) test for two proportions, one-sided
e) test for standard deviation, two-sided f) test for mean, one-sided
g) test for two means, one-sided h) test for proportion, one-sided
i) test for two proportions, one-sided j) test for mean, one-sided
k) test for standard deviation, two-sided l) test for mean, one-sided
m) test for standard deviation, one-sided n) test for mean, one-sided
o) test for proportion, one-sided p) test for two proportions, one-sided
q) test for two standard deviations, two-sided
r) test for to means, two-sided s) test for two proportions, one-sided
t) test for proportion, one-sided u) test for mean, one-sided
Exercise 4.2
a) H 0 :μ ≤ 590 and H A : μ>590
b) H 0 :σ ≥19 and H A :σ <19
c) H 0 :μ PD 23 ≤ μ P 44 and H A : μ PD 23> μ P 44
d) H 0 : p ≥ 40 % and H A : p< 40 %
e) H 0 :μ ≤ 85 and H A : μ>85
Exercise 4.3
a) Firstly we make a normal fractile diagram for the sample:
2.5
2
1.5
1
0.5
0
-0.5470 480 490 500 510 520 530
-1
-1.5
-2
-2.5
As the data points are evenly distributed around the straight line, we cannot reject that
the contents of a beer bottle is normally distributed.
We calculate the average and the standard deviation of the sample to be x́=499,7 and
s x =13,456.
1
Solutions for Exercises in Statistics
b) As the average of the sample is below 500 ml, we choose the alternative hypothesis
H A : μ<500 and the corresponding null hypothesis becomes H 0 :μ ≥ 500.
As we have a small, normally distributed sample, we use the t-test. KeHaTools gives:
Test for mean (t-
test)
Hypotheses (Left-sided test)
H0 : 0
HA : < 0
Input
Sample size 20
Average 499,7
Standard deviation 13,45597
Null value 500
The result
Test statistic -0,09971
p-value 0,460811
As the p-value for the test is 46,1%, and this is more than the level of significance of
5%, we cannot reject the null hypothesis, and we cannot conclude that the average
contents is below 500 ml.
c) Now we shall test two-sided with the null hypothesis H 0 :σ=20 contra the alternative
H A :σ ≠ 20. KeHaTools gives:
Test for standard deviation / variance
Hypotheses (Two-sided test)
H0 : = 0
HA : 0
Input
Sample size 20
Standard deviation 13,45597
Null value 20
The result
Test statistic 8,6005
p-value 0,040915
2
Solutions for Exercises in Statistics
The p-value is 4,1%, and as this is less than the level of significance of 5%, we can
reject the null hypothesis, and we conclude that the standard deviation is not equal to 20.
d) We first examine whether the new sample follows a normal distribution. The normal
fractile diagram is:
2.5
2
1.5
1
0.5
0
-0.5485 490 495 500 505 510 515 520 525
-1
-1.5
-2
-2.5
As the data points are evenly distributed around the straight line, we cannot reject that
the new observations follow a normal distribution.
The sample average and standard deviation are calculated to be ý=503,75 and
s y =11,360 .
We now examine if the two variances (or standard deviations) are the same:
Test for two standard deviations / variances
Hypotheses (Two-sided test)
H0 : x = y
HA : x y
Input
Sample 1 Sample 2
Sample size 20 20
Standard deviation 13,45597 11,35955
The result
Test statistic 1,403161
p-value 0,467295
The p-value is 46,7%, and as this is above the level of significance of 5%, the null
hypothesis cannot be rejected, and we maintain that the two standard deviations are
equal.
e) As the second sample has a larger average than the first, we test left-sided with the
alternative hypothesis H A : μ x < μ y and the null hypothesis H 0 ; μ x ≥ μ y.
KeHaTools gives
3
Solutions for Exercises in Statistics
Test for two means (t-distribution)
Hypotheses (Left-sided test)
H0 : x y + D
HA : x < y + D
Input
Sample
Sample 1 2
Sample size 20 20
Average 499,7 503,75
11,3595
Standard deviation 13,45597 5
Difference (D) 0
The result
s 12,45196
Test statistic -1,02853
p-value 0,155101
We see that the p-value becomes 15,5%, and as this is above the level of significance of
5%, we cannot reject the null hypothesis.
We cannot conclude that the average contents in a Redberry Beer is larger than in a
Blueberry Brew.
4
Solutions for Exercises in Statistics
Exercise 4.4
a) I the sample there are x=21+25+14=60 out of 200 persons wanting to buy the new
60
beer. This gives an estimate for this proportion of ^p= =30 % .
200
As this estimate is above 25%, we test right-sided with the alternative hypothesis
H A : p>25 % against the null hypothesis H 0 : p ≤ 25 %.
KeHaTools gives:
Approximate test for proportion
(Right-sided
Hypotheses test)
H0 : p p0
HA : p > p0
Input
Sample size 200
No. of successes 60
Null value 25%
The result
Estimated
proportion 30%
Test statistic 1,632993
p-value 0,051235
As the p-value is 5,12%, and this is above the level of significance of 5%, then the null
hypothesis cannot be rejected, and it cannot be concluded that the proportion is below
25:
b) Among the 20-40-years old there is x=25 out of n x =25+15+16=56 , giving a
x 25
proportion of ^p x = = =44,64 %, wanting to buy the new beer, while among the
nx 56
older people above 40 years old there is y=14 out of n y =14+35+ 25=75, giving a
y 14
proportion of ^p y = = =18,92 % .
n y 75
As the estimated proportion in the first sample is above the proportion in the second
sample we test right-sided with the alternative hypothesis H A : p x > p y and the null
hypothesis H 0 : p x ≤ p y .
KeHaTools gives:
5
Solutions for Exercises in Statistics
Approximate test for two proportions
Hypotheses (Right-sided test)
H0 : px py + D
HA : px > p y + D
Input
Sample 1 Sample 2
Sample size 56 75
No. of successes 25 14
Difference (D) 0
The result
Test statistic 3,216692
p-value 0,000648
As the p-value is 0,065%, and this is less than the level of significance of 5%, then the
null hypothesis is rejected, and it is concluded, that the proportion of persons over 40
years waiting to buy the new beer, is significantly less than the corresponding proportion
among the 20-40 years old.