-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path07-testing-hypothesis-for-single-population-parameter.Rmd
2149 lines (1592 loc) · 71.4 KB
/
07-testing-hypothesis-for-single-population-parameter.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Testing Hypothesis for Single Population Parameter
[book](pdf/book07.pdf){target="_blank"}
[eStat YouTube Channel](https://www.youtube.com/channel/UCw2Rzl9A4rXMcT8ue8GH3IA){target="_blank"}
**CHAPTER OBJECTIVES**
Estimation of population parameters using sample distributions was
discussed in Chapter 6.
However, one might be interested in which one of two hypothesis about
the population parameter is reasonable to accept.
This problem is called a testing hypothesis and we take samples and
calculate the sample statistics to decide by using the sampling
distributions discussed in Chapter 6.
In this chapter we discuss the testing hypothesis of the population
mean, population variance and population proportion.
A method of testing hypothesis which considers both type 1 and type 2
error is also introduced.
:::
:::
:::
## Testing Hypothesis for a Population Mean
::: presentation-video-link
[presentation](pdf/0701.pdf){.presentation-link target="_blank"}
[video](https://youtu.be/ba0JTGsChY8){.video-link target="_blank"}
:::
::: mainTable
Examples of testing hypothesis for a population mean are as follows.
::: textL30M10
- The weight of a cookie bag is indicated as 200g. Would there be
enough cookies as the indicated weight?
- At a light bulb factory, a newly developed light bulb advertises a
longer bulb life than the past one. Is this propaganda reliable?
- Immediately after completing this year's academic test, students
said that there will be 5 points increase in the average English score
higher than last year. How can you investigate if this is true?
:::
Testing hypothesis is the answer to the above questions (hypothesis).
That is, the testing hypothesis is to decide statistically which
hypothesis is to use for the two hypotheses about the unknown population
parameter using samples. In this section, we examine the test of the
population mean, population variance, and population proportion which
are most commonly used in testing hypothesis.
The following example explains the theory of testing hypothesis of the
population mean in single population.
:::
::: mainTableGrey
**Example 7.1.1** At a light bulb factory, the average life expectancy
of a light bulb made by a conventional production method is known to be
1500 hours and the standard deviation is 200 hours. Recently, the
company is trying to introduce a new production method, with the average
life expectancy of 1600 hours for light bulbs. To confirm this argument,
30 samples were taken from the new type of light bulbs by simple random
sampling and the sample mean was $\overline x$ = 1555 hours. Can you
tell me that the new type of light bulb has the average life of 1600
hours?
**Answer**
A statistical approach to the question of this issue is first to make
two assumptions about the different arguments for the population mean μ
. Namely, $$ \small
\begin{multline}
\shoveleft H_0 : μ = 1500 \\
\shoveleft H_1 : μ = 1600
\end{multline}
$$ $\small H_0$ is called a null hypothesis and $\small H_1$ is an
alternative hypothesis. In most cases, the null hypothesis is defined as
an 'existing known fact', and the alternative hypothesis is defined as
'new facts or changes in current beliefs'. So when choosing between two
hypotheses, the basic idea of testing hypothesis is 'unless there is a
significant reason, we accept the null hypothesis (current fact) without
choosing the alternative hypothesis (the fact of the matter). This idea
of testing hypothesis is referred to as a 'conservative decision
making'.
A common sense criterion for choosing between two hypotheses would be
'which population mean of two hypothesis is closer in distance to the
sample mean'. Based on this common sense criteria which uses the
concept of distance, the sample mean of 1555 is closer to
$\small H_1 : μ = 1600$ so the alternative hypothesis will be chosen. A
statistical testing hypothesis is based not only on this common sense
criteria, but also on the sampling distribution of $\overline X$. In
other words, the statistical testing hypothesis is to select a critical
value $C$ based on the sampling distribution theory and to make a
decision rule as follows:
$\small \qquad \text { ‘If \(\overline X$ is smaller than C, then the
null hypothesis $H_0$ will be chosen, else reject $H_0$'} \\)
The area of {$\small \overline X < C$} is called an acceptance region of
$\small H_0$ and the area {$\small \overline X ≥ C$} is called a
rejection region of $\small H_0$ ([Figure 7.1.1]{.figure-ref}).
![](Figure/Fig070101.png){.imgFig400300}
::: figText
[Figure 7.1.1]{.figure-ref} Acceptance and rejection region of $H_{0}$
:::
If a hypothesis is chosen by this decision rule, there are always two
possible errors in the decision. One is a **Type 1 Error** which accepts
$\small H_1$ when $\small H_0$ is true, the other is a **Type 2 Error**
which accept $\small H_0$ when $\small H_1$ is true. These errors can be
summarized as [Table 7.1.1]{.table-ref}.
Table 7.1.1 Two types of errors in testing hypothesis
-----------------------------------------------------------------------
Actual\ Actual\
$\small H_0$ is true $\small H_1$ is true
----------------------- ----------------------- -----------------------
Decision : $\small H_0$ Correct Type 2 Error
is true
Decision : $\small H_1$ Type 1 Error Correct
is true
-----------------------------------------------------------------------
If you try to reduce one type of error when the sample size is fixed,
then the other type of error is increasing. That is why we came up with
a conservative decision making method that defines the null hypothesis
$\small H_0$ as 'past or present facts' and 'accept the null
hypothesis unless there is a significance evidence for the alternative
hypothesis.' In this conservative way, we try to reduce the type 1
error as much as possible that selects $\small H_1$ when $\small H_0$ is
true, which would be more risky than the type 2 error. Testing
hypothesis determines the tolerance for the probability of the type 1
error, usually 5% or 1% for rigorous test, and use the selection
criteria that satisfy this limitation. The tolerance for the probability
that this type 1 error will occur is called the **significance level**
and is often expressed as α. The probability of the type 2 error is
expressed as β.
If the significance level is established, the decision rule for the two
hypotheses can be tested using the sampling distribution of all possible
sample means in Chapter 6. [Figure 7.1.2]{.figure-ref} shows the distribution of
populations for two hypotheses, and the distribution of all possible
sample means for each population.
![](Figure/Fig070102.png){.imgFig400300}
::: figText
[Figure 7.1.2]{.figure-ref} Testing Hypothesis
:::
If the population corresponds to the distribution of $\small H_0$ : μ =
1500, the sampling distribution of all possible sample means is
approximated as $\small N(1500,200^2 )$ by the central limit theorem. If
the population corresponds to the distribution of $\small H_1$ : μ =
1600, the sampling distribution of all possible sample means is
approximated as $\small N(1600,200^2 )$. The standard deviation for each
population is assumed to be 200 from a historical data. Then the
decision rule becomes as follows:
$\small \qquad \text {‘If \(\overline X < C$, then accept $H_{0}$, else
accept $H_{1}$ (i.e. reject $H_{0}$ )'} \\)
In Figure 7.1.2, the shaded area represents the probability of the type
1 error. If we set the significance level, which is the tolerance level
of the type 1 error, is 5%, i.e. $\small P(\overline X < C) = 0.95$, $C$
can be calculated by finding the percentile of the normal distribution
$\small N(1500,\frac{200^2}{30})$ as follows:
$\small \qquad 1560+1.645 \frac{200}{\sqrt 30 } = 1560.06$
Therefore, the decision rule can be written as follows.
$\small \qquad \text {‘If \(\overline X$ \< 1560.06, then accept $H_0$,
else reject $H_0$ (accept $H_1$ ).'} \\)
In this problem, the observed sample mean of the random variable
$\small \overline X$ is $\overline x$= 1555 and $\small H_0$ is
accepted. In other words, the hypothesis of $\small H_0$ : μ = 1500 is
judged to be correct, which contradicts the result of common sense
criteria that $\overline x$ = 1555 is closer to $\small H_1$ : μ = 1600
than $\small H_0$ : μ = 1500. This result can be interpreted that the
sample mean of 1555 is not a sufficient evidence to reject the null
hypothesis by a conservative decision making method.
The above decision rule is often written as follows, emphasizing that it
is the result from a conservative decision making method.
$\small \qquad \text {‘If \(\overline X$ \< 1560.06, then do not reject
$H_0$, else reject $H_0$.'} \\)
In addition, this decision rule can be written for calculation purpose
as follows.
$\small \qquad \text {‘If \(\frac{\overline X - 1500}{\frac {200}{\sqrt{30}}}$,
then accept $H_0$ , else reject $H_0$.'} \\)
In this case, since $\overline x$ = 1555,
$\frac{1555 - 1500}{\frac {200}{\sqrt{30}}}$ and it is less than 1.645.
Therefore, we accept $\small H_0$.
:::
::: mainTable
Since the testing hypothesis by the conservative decision making is only
based on the probability of the type 1 error as seen in \[Example
7.1.1\], even if the alternative hypothesis is $H_1 : μ > 1500$, we will
have the same decision rule.
Generally, there are three types of alternative hypothesis in the
testing hypothesis for the population mean as follows. $$
\begin{align}
& 1)\quad H_1 : \mu \gt \mu_0 \\
& 2)\quad H_1 : \mu \gt \mu_0 \\
& 3)\quad H_1 : \mu \ne \mu_0 \\
\end{align}
$$ Since 1) has the rejection region on the right side of the
sampling distribution of all possible sample means under the null
hypothesis, it is called a **right-sided test**. Since 2) has the
rejection region on the left side of the sampling distribution, it is
called a **left-sided test**. Since 3) has rejection regions on both
sides of the sampling distribution, it is called a **two-sided test**.
The decision rule for each type of three alternative hypothesis are
summarized in [Table 7.1.2]{.table-ref} when the population standard deviation is
known and α is the significance level.
:::
Table 7.1.2 Testing hypothesis for the population mean - known σ case
---------------------------------------------------------------------------------------------------------------------------
Type of Hypothesis Decision Rule
----------------------------------- ---------------------------------------------------------------------------------------
1\) $\; H_0 : \mu = \mu_0$\ If $\frac {\overline X - \mu_0}{ \frac {\sigma}{\sqrt{n}} } > z_{α}$, then reject $H_0$
$\quad\,\, H_1 : \mu > \mu_0$
2\) $\; H_0 : \mu = \mu_0$\ If $\frac {\overline X - \mu_0}{ \frac {\sigma}{\sqrt{n}} } < - z_{1-α}$, then reject
$\quad\,\, H_1 : \mu < \mu_0$ $H_0$
3\) $\; H_0 : \mu = \mu_0$\ If
$\quad\,\, H_1 : \mu \ne \mu_0$ $\left | \frac {\overline X - \mu_0}{ \frac {\sigma}{\sqrt{n}} } \right | > z_{α/2}$,
then reject $H_0$
---------------------------------------------------------------------------------------------------------------------------
Note: The $H_0$ of 1) can be written as $\; H_0 : \mu \le \mu_0$ , 2) as
$\; H_0 : \mu \ge \mu_0$
::: mainTable
The following expression used for the decision rule is referred to as a
test statistic for testing hypothesis of the population mean. $$
\frac {\overline X - \mu_0}{ \frac {\sigma}{\sqrt{n}} }
$$
The population standard deviation σ of the test statistic is usually
unknown. However, if the sample is large enough (approximately 30 or
more), the hypothesis test can be performed using the sample standard
deviation $S$ instead of the population standard deviation σ.
In [Example 7.1.1]{.example-ref}, if the sample mean is either 1555 or 1540, the
null hypothesis can not be rejected, but degrees of evidence that the
null hypothesis is not rejected are different. The degree of evidence
that the null hypothesis is not rejected is measured by calculating the
probability of the type 1 error when the observed sample mean value is
considered as the critical value for decision, which is called the
$p$-value. That is, the $p$-value indicates where the observed sample
mean is located among all possible sample means by considering the
location of the alternative hypothesis. In [Example 7.1.1]{.example-ref}, the
$p$-value for $\overline X$ = 1540 is the probability of sample means
which is greater than $\overline X$ = 1540 by using
$N(1500, \frac{200^2}{30} )$. The higher the $p$-value, the stronger the
reason for not being rejected. If $H_0$ is rejected, the smaller the
$p$-value, the stronger the grounds for being rejected. Therefore, if
the $p$-value is less than the significance level considered by the
analyst, then $H_0$ is rejected, because it means that the sample mean
is in the rejection region. Statistical packages provide this $p$-value.
:::
::: mainTableYellow
**Decision rule using $p$-value**
If the $p$-value is less than the significance level, then $H_0$ is
rejected, else $H_0$ is accepted.
:::
::: mainTable
The calculation of the $p$-value depending on the type of the
alternative hypothesis is summarized as in [Table 7.1.3]{.table-ref}.
:::
Table 7.1.3 Calculation of $p$-value
----------------------------------------------------------------------------------
Type of Hypothesis $p$-value
----------------------------------- ----------------------------------------------
1\) $\; H_0 : \mu = \mu_0$\ $P ( \overline X > {\overline x}_{obs} )$
$\quad\,\, H_1 : \mu > \mu_0$
2\) $\; H_0 : \mu = \mu_0$\ $P ( \overline X < {\overline x}_{obs} )$
$\quad\,\, H_1 : \mu < \mu_0$
3\) $\; H_0 : \mu = \mu_0$\ If $\overline X > \mu_0$, then
$\quad\,\, H_1 : \mu \ne \mu_0$ $2 P ( \overline X > {\overline x}_{obs} )$,
else
$2 P ( \overline X < {\overline x}_{obs} )$
----------------------------------------------------------------------------------
Note ${\overline x}_{obs}$ is the observed sample mean
::: mainTable
If the population standard deviation σ is unknown and the population is
a normal distribution, the test statistic $$
\frac {\overline X - \mu_0}{ \frac {S}{\sqrt{n}} }
$$ is a $t$ distribution with $(n-1)$ degrees of freedom. The
testing hypothesis for the population mean can be done as [Table 7.1]{.table-ref}.4
which replace the $Z$ distribution with the $t$ distribution in Table
7.1.2 and σ with $S$.
:::
Table 7.1.4 Testing hypothesis for a population mean - unknown σ case\
(Assume that the population is a normal distribution)
---------------------------------------------------------------------------------------------------------------------------
Type of Hypothesis Decision Rule
----------------------------------- ---------------------------------------------------------------------------------------
1\) $\; H_0 : \mu = \mu_0$\ If $\frac {\overline X - \mu_0}{ \frac {S}{\sqrt{n}} } > t_{n-1: α}$, then reject $H_0$
$\quad\,\, H_1 : \mu > \mu_0$
2\) $\; H_0 : \mu = \mu_0$\ If $\frac {\overline X - \mu_0}{ \frac {S}{\sqrt{n}} } < - t_{n-1: α}$, then reject
$\quad\,\, H_1 : \mu < \mu_0$ $H_0$
3\) $\; H_0 : \mu = \mu_0$\ If
$\quad\,\, H_1 : \mu \ne \mu_0$ $\left | \frac {\overline X - \mu_0}{ \frac {S}{\sqrt{n}} } \right | > t_{n-1; α/2}$,
then reject $H_0$
---------------------------------------------------------------------------------------------------------------------------
Note: The $H_0$ of 1) can be written as $H_0 : \mu \le \mu_0$ , 2) as
$H_0 : \mu \ge \mu_0$
::: mainTable
If the sample size is large enough (approximately 30 or more), the $t$
distribution is approximated to the standard normal distribution, so the
testing hypothesis in [Table 7.1.4]{.table-ref} can be performed using the standard
normal distribution, $Z$ , instead of $t$ distribution.
:::
::: mainTableGrey
**Example 7.1.2** The weight of a bag of cookies is supposed to be 250
grams. Suppose the weight of all bags of cookies is a normal
distribution. In the survey of 100 samples of bags which were randomly
selected, the sample mean was 253 grams and the standard deviation was
10 grams.
::: textL20M20
1\) Test hypothesis whether the weight of the bag of cookies is 250g or
larger and find the $p$-value. α = 1%
:::
::: textL20M20
2\) Test hypothesis whether or not the weight of the bag of cookies is
250g and find the $p$-value. α = 1%
:::
::: textL20M20
3\) Use 『eStatU』 to test the hypothesis above.
:::
**Answer**
::: textL20M20
1\) The hypothesis is a right tail test as $\small H_0 : \mu;$ = 250,
$\small H_0 : \mu;$ \> 250. Since the sample size is large ($n$=100), we
can use $Z$ distribution instead of $t$ distribution. Decision rule is
as follows.
:::
$$ \small
\begin{multline}
\shoveleft \text{'If } \frac {\overline X - \mu_0}{ \frac {S}{\sqrt{n}} } > z_{α} , \text{ then reject } H_0 \text{ else accept } H_0 ’ \\
\shoveleft \text{'If } \frac {253 - 250}{ \frac {10}{\sqrt{100}} } > z_{0.01} , \text{ then reject } H_0 \text{ else accept } H_0 ’ \\
\end{multline}
$$
::: textL20
Since $\frac {253 - 250}{ \frac {10}{\sqrt{100}} }$ = 3 and $z_{0.01}$=
2.326, $\small H_0$ is rejected. We can write the above decision rule as
follows:
:::
$$ \small
\begin{multline}
\shoveleft \text{'If } \overline X > \mu_0 + z_{α} \frac {S}{\sqrt{n}} , \text{ then reject } H_0 \text{ else accept } H_0 ’ \\
\shoveleft \text{'If } \overline X > 250 + 2.326 \frac {10}{\sqrt{100}} , \text{ then reject } H_0 \text{ else accept } H_0 ’ \\
\shoveleft \text{'If } \overline X > 252.326 , \text{ then reject} H_0 \text{ else accept } H_0 ’
\end{multline}
$$
::: textL20
Since the $p$-value is the probability of Type 1 error when the sample
mean is the critical value. it can be calculated by the probability of (
$\small P( \overline X$ \> 253). Since the distribution of
$\small \overline X$ is approximately $\small N(250, \frac{100}{100} )$
when $\small H_0 : \mu$ = 250 is true, the $p$-value is as follows:
:::
$\small \qquad \qquad p\text{-value} = P( \overline X \gt 253) = P( Z \gt \frac{253-250}{\frac{10}{10}} ) = P( Z \gt 3) = 0.0013$
::: textL20M20
2\) The hypothesis is a two-sided test as
$\small H_0 : \mu = 250, H_1 \ne 250$. Since the sample size is large
($n$=100), we can use the $Z$ distribution instead of the $t$
distribution. Decision rule is as follows.
:::
$$ \small
\begin{multline}
\shoveleft \text{'If } \left| \frac {\overline X - \mu_0}{ \frac {S}{\sqrt{n}} } \right| > z_{α/2} , \text{ then reject } H_0 \text{ else accept } H_0 ’ \\
\shoveleft \text{'If } \left| \frac {253 - 250}{ \frac {10}{\sqrt{100}} } \right| > z_{0.005} , \text{ then reject } H_0 \text{ else accept } H_0 ’ \\
\end{multline}
$$
::: textL20
Since $\frac {253-250} {\frac{10}{10}} = 3$ and $z_{0.005}$ = 2.575,
$\small H_0$ is rejected. The $p$-value can be calculated as follows:
:::
$\small \qquad \qquad p\text{-value} = 2 P(\overline X \gt 253) = 2 P(\overline X \gt \frac{253-250}{\frac{10}{10}} = 2 P( Z \gt 3) = 0.0026$
::: textL20M20
3\) In 『eStatU』 menu, select 'Testing Hypothesis μ', enter 250 at
the box of on \[Hypothesis\] and select the alternative hypothesis as
the right test in the window shown in [Figure 7.1.3]{.figure-ref}. Check \[Test
Type\] as Z test and check the significance level at 5%. At the \[Sample
Statistics\], enter sample size 100, sample mean 253, and sample
variance $10^2 = 100$. For the Z test, you must enter the population
variance, but you may enter the sample variance, because the sample size
is large enough.
:::
<div>
<div>
<input class="qrBtn" onclick="window.open(addrStr[101])" src="QR/eStatU700_TestMu.svg" type="image"/>
</div>
<div>
![](Figure/Fig070103.png){.imgPhoto}
::: figText
[Figure 7.1.3]{.figure-ref} 『eStatU』 Testing Hypothes for μ
:::
</div>
</div>
::: textL20
If you click the [Execute]{.button-ref} button, the confidence Interval for μ is
calculated and the testing result using 『eStatU』 will appear as in
[Figure 7.1.4]{.figure-ref}.
:::
![](Figure/Fig070104.png){.imgFig600400}
::: figText
[Figure 7.1.4]{.figure-ref} 『eStatU』 Testing Hypothes for μ - Right Tail Test
:::
::: textL20
If you select the two-tail test at \[Hypothesis\] of [Figure 7.1.3]{.figure-ref},
testing result using 『eStatU』 is as [Figure 7.1.5]{.figure-ref}.
:::
![](Figure/Fig070105.png){.imgFig600400}
::: figText
[Figure 7.1.5]{.figure-ref} 『eStatU』 Testing Hypothes for μ - Two Tails Test
:::
:::
::: mainTableGrey
**Example 7.1.3** When the sample size is 16 and the sample variance is
100 in [Example 7.1.2]{.example-ref}, test whether the average weight of the cookie
bags is 250g or greater and obtain the $p$-value. Check the result using
『eStatU』
**Answer**
Since the population standard deviation is unknown and the sample size
is small, the decision rule is as follows. $$ \small
\begin{multline}
\shoveleft \text{'If } \frac {\overline X - \mu_0} {\frac {S}{\sqrt{n}} } > t_{n-1: α} , \text{ then reject } H_0 \text{ else accept } H_0 ’ \\
\shoveleft \text{'If } \frac {253 - 250}{ \frac {10}{\sqrt{16}} } > t_{16: 0.01} , \text{ then reject } H_0 \text{ else accept } H_0 ’ \\
\end{multline}
$$ Since the value of test statistic is
$\frac {253 - 250}{ \frac {10}{\sqrt{16}} } = 1.2$, and
$t_{15: 0.01} = 2.602$ , we accept $\small H_0$. Note that the decision
rule can be written as follows.
$\small \qquad \qquad\text{'If } \overline X > 250 + 2.602 \frac {10}{\sqrt{16}} , \text{ then reject } H_0 \text{ else accept } H_0 ’ \\ $
In [Figure 7.1.3]{.figure-ref} of 『eStatU』 , select the right-sided test of
\[Hypothesis\], select the $t$-test on \[Test Type\] and enter sample
size $n$ = 16, then the test result is as [Figure 7.1.6]{.figure-ref} if you click
the [Execute]{.button-ref} button.
<div>
<div>
<input class="qrBtn" onclick="window.open(addrStr[101])" src="QR/eStatU700_TestMu.svg" type="image"/>
</div>
<div>
![](Figure/Fig070106.png){.imgFig600400}
::: figText
[Figure 7.1.6]{.figure-ref} Testing hypothesis for μ with $t$ distribution using
『eStatU』
:::
</div>
</div>
Since the $p$-value is the probability that $t_{15}$ is greater than the
test statistics 1.200, the $p$-value is 0.124 by using the module of $t$
distribution in 『eStatU』.
:::
::: mainTableGrey
**Example 7.1.4** (Heights of college students)
10 male students are sampled in a university and examined their heights
as follows:
::: textLeft
172 175 178 182 176 180 169 185 173 177 (Unit cm)
:::
::: textLeft
Ex ⇨ eBook ⇨ EX070104_Height.csv.
:::
Test the hypothesis whether the population mean is 175cm or greater with
the significance level of 5%.
**Answer**
After entering data on a sheet as shown in [Figure 7.1.7]{.figure-ref} in 『eStat』
, clicking the testing hypothesis for the population mean and then
clicking variable name V1 for 'Analysis Var' in variable selection box
will result in a dot graph with 95% confidence interval as in \<Figure
7.1.8\>.
<div>
<div>
<input class="qrBtn" onclick="window.open(addrStr[24])" src="QR/EX070104.svg" type="image"/>
</div>
<div>
![](Figure/Fig070107.png){.imgFig150200}
::: figText
[Figure 7.1.7]{.figure-ref} Data input
:::
</div>
</div>
![](Figure/Fig070108.png){.imgFig600540}
::: figText
[Figure 7.1.8]{.figure-ref} Dot graph and confidence interval
:::
If you click \[Histogram\] button from option menu below the graph as in
[Figure 7.1.9]{.figure-ref}, the corresponding histogram is appeared as in \<Figure
7.1.10\>. The histogram together with the normal distribution graph can
be used to check whether the sample data comes from a normal
distribution. The options such as \[Normal Q-Q Plot\] and \[Normality
Test\] will be explained in chapter 11.
![](Figure/Fig070109.png){.imgFig400100}
::: figText
[Figure 7.1.9]{.figure-ref} Options for testing hypothesis of population mean
:::
![](Figure/Fig070110.png){.imgFig600540}
::: figText
[Figure 7.1.10]{.figure-ref} Histogram and Normal Distribution
:::
Enter $μ_0$ = 175 at the box of option menu, select the right sided test
and the significance level of 5%. Then press the \[t-Test\] button to
display the hypothesis test graph as shown in [Figure 7.1.11]{.figure-ref} and a
test result in the Log Area as in [Figure 7.1.12]{.figure-ref}.
![](Figure/Fig070111.png){.imgFig600540}
::: figText
[Figure 7.1.11]{.figure-ref} Testing hypothesis for population mean
:::
![](Figure/Fig070112.png){.imgFig400300}
::: figText
[Figure 7.1.12]{.figure-ref} Testing hypothesis for population mean
:::
You can select Z-test in the option menu, but you have to enter the
population standard deviation σ in this case.
:::
::: mainTablePink
<div>
<div>
<input class="qrBtn" onclick="window.open(addrStr[101])" src="QR/eStatU700_TestMu.svg" type="image"/>
</div>
<div>
**Practice 7.1.1** The following data are weights of the 7 employees
randomly selected who are working in the shipping department of a
wholesale food company.
::: textLeft
154, 186, 159, 174, 183, 163, 181 (unit pound)
:::
::: textLeft
Ex ⇨ eBook ⇨ PR070101_Height.csv.
:::
Based on this data, can you say that the average weight of employees
working in the shipping department is 160 or greater than 160? Use the
significance level of 5%.
</div>
</div>
:::
::: mainTable
The testing hypothesis of the population mean using the sample variance
requires the assumption that the population is normally distributed.
Testing whether sample data come from a normal population is called a
goodness of fit test which will be explained in Chapter 11.
In this section, we looked at the testing hypothesis for the population
mean when the sample size is already given and only consider the
significance level of the type 1 error. In this case, if we try to
reduce the probability of the type 1 error, then the probability of the
type 2 error will be increased and we can not reduce both types of
errors at the same time. Therefore, if the sample size was
predetermined, or if data were given, only the type 1 error was
considered as a conservative decision making to test the hypothesis.
However, if the sample size can be selected by a researcher, there is a
testing hypothesis that considers both types of errors together which
will be explained in detail in section 7.4.
:::
::: mainTablePink
### Multiple Choice Exercise
Choose one answer and click Submit button
::: textL30M30
7.1 What is the type 1 error?
:::
<form name="Q1">
<label><input name="item" type="radio" value="1"/> Error rejecting the null hypothesis when it is true</label><br/>
<label><input name="item" type="radio" value="2"/> Error accepting the null hypothesis when it is true</label><br/>
<label><input name="item" type="radio" value="3"/> Error rejecting the null hypothesis when it is not true</label><br/>
<label><input name="item" type="radio" value="4"/> Error accepting the null hypothesis when it is true</label><br/>
<p>
<input onclick="radio(7,1,Q1)" type="button" value="Submit"/>
<input id="ansQ1" size="15" type="text"/>
</p></form>
::: textL30M30
7.2 Which hypothesis is accepted when the null hypothesis is rejected?
:::
<form name="Q2">
<label><input name="item" type="radio" value="1"/> null hypothesis</label><br/>
<label><input name="item" type="radio" value="2"/> significant hypothesis</label><br/>
<label><input name="item" type="radio" value="3"/> alternative hypothesis</label><br/>
<label><input name="item" type="radio" value="4"/> basic hypothesis</label><br/>
<p>
<input onclick="radio(7,2,Q2)" type="button" value="Submit"/>
<input id="ansQ2" size="15" type="text"/>
</p></form>
::: textL30M30
7.3 Which of the following statements is true?
:::
<form name="Q3">
<label><input name="item" type="radio" value="1"/> The conclusion about a statistical test is always absolute.</label><br/>
<label><input name="item" type="radio" value="2"/> Rejecting null hypothesis implies we accept the alternative hypothesis.</label><br/>
<label><input name="item" type="radio" value="3"/> In order to reduce the type 1 error, significance level of 0.05 is better than 0.01.</label><br/>
<label><input name="item" type="radio" value="4"/> In order to reduce the type 1 error, significance level of 0.01 is better than 0.05.</label><br/>
<p>
<input onclick="radio(7,3,Q3)" type="button" value="Submit"/>
<input id="ansQ3" size="15" type="text"/>
</p></form>
::: textL30M30
7.4 What is the meaning of the significance level α = 0.05?
:::
<form name="Q4">
<label><input name="item" type="radio" value="1"/> 5% of decisions to reject the null hypothesis when it is true if the same test method was repeated repeatedly</label><br/>
<label><input name="item" type="radio" value="2"/> 5% of decisions to reject the alternative hypothesis when it is true if the same test method was repeated repeatedly</label><br/>
<label><input name="item" type="radio" value="3"/> The probability of accepting the null hypothesis is 0.05.</label><br/>
<label><input name="item" type="radio" value="4"/> The probability of accepting the alternative hypothesis is 0.05.</label><br/>
<p>
<input onclick="radio(7,4,Q4)" type="button" value="Submit"/>
<input id="ansQ4" size="15" type="text"/>
</p></form>
::: textL30M30
7.5 What is the critical value to reject the null hypothesis if the
alternative hypothesis is right sided when the sampling distribution to
test the population mean is the standard normal distribution?
:::
<form name="Q5">
<label><input name="item" type="radio" value="1"/> 2.58</label><br/>
<label><input name="item" type="radio" value="2"/> 1.64</label><br/>
<label><input name="item" type="radio" value="3"/> 2.33</label><br/>
<label><input name="item" type="radio" value="4"/> 1.96</label><br/>
<p>
<input onclick="radio(7,5,Q5)" type="button" value="Submit"/>
<input id="ansQ5" size="15" type="text"/>
</p></form>
::: textL30M30
7.6 If the null hypothesis is $\small H_0 ; \mu = \mu_0$, what is the
two-sided alternative hypothesis?
:::
<form name="Q6">
<label><input name="item" type="radio" value="1"/> \(\small H_1 ; \mu > \mu_0 \)</label><br/>
<label><input name="item" type="radio" value="2"/> \(\small H_1 ; \mu < \mu_0 \)</label><br/>
<label><input name="item" type="radio" value="3"/> \(\small H_1 ; \mu = \mu_0 \)</label><br/>
<label><input name="item" type="radio" value="4"/> \(\small H_1 ; \mu \ne \mu_0 \)</label><br/>
<p>
<input onclick="radio(7,6,Q6)" type="button" value="Submit"/>
<input id="ansQ6" size="15" type="text"/>
</p></form>
::: textL30M30
7.7 The following lists the sequence of a statistical hypothesis test.
What's the right order? a. Set a hypothesis. b. Determine the
significance level. c. Determine whether or not to accept the
hypothesis. d. Calculate the test statistic. e. Find the rejection
region
:::
<form name="Q7">
<label><input name="item" type="radio" value="1"/> a→d→e→b→c</label><br/>
<label><input name="item" type="radio" value="2"/> a→d→b→e→c</label><br/>
<label><input name="item" type="radio" value="3"/> b→e→d→a→c</label><br/>
<label><input name="item" type="radio" value="4"/> a→c→b→d→e</label><br/>
<p>
<input onclick="radio(7,7,Q7)" type="button" value="Submit"/>
<input id="ansQ7" size="15" type="text"/>
</p></form>
::: textL30M30
7.8 Which of the following statements is incorrect?
:::
<form name="Q8">
<label><input name="item" type="radio" value="1"/> The rejection of the null hypothesis means accepting the alternative hypothesis.</label><br/>
<label><input name="item" type="radio" value="2"/> The maximum allowable probability of the type 1 error is the significance level.</label><br/>
<label><input name="item" type="radio" value="3"/> Error accepting the null hypothesis when it is false is the type 1 error.</label><br/>
<label><input name="item" type="radio" value="4"/> Error accepting the alternative hypothesis when it is false is the type 2 error.</label><br/>
<p>
<input onclick="radio(7,8,Q8)" type="button" value="Submit"/>
<input id="ansQ8" size="15" type="text"/>
</p></form>
:::
:::
## Testing Hypothesis for a Population Variance
::: presentation-video-link
[presentation](pdf/0702.pdf){.presentation-link target="_blank"}
[video](https://youtu.be/3SDaVzGqPL0){.video-link target="_blank"}
:::
::: mainTable
Examples for testing hypothesis of a population variance are as follows.
::: textL30M10
- Bolts produced by a company are currently supplied to an automaker
and have an average diameter of 7mm and a variance of 0.25mm. Recently,
a rival company has applied for the supply, claiming that their
company's bolts have the same average diameter of 7 mm but a variance
of 0.16mm. How can I find out if this claim is true?
- The variance of scores in mathematics on the last year's college
scholastic aptitude test was 100. Questions in mathematics this year's
test are said to be much easier than last year's. How can I test
whether the variance of the mathematics score in this year is smaller
than the last year?
:::
If you understand the testing hypothesis for the population mean, the
testing hypothesis for the population variance differs only from the
sampling distribution and the test statistic, and the basic concept is
the same. In Chapter 6, we studied that the distribution of all possible
sample variances multiplied by a constant, $\frac{(n-1)S^2}{\sigma^2}$,
follows a chi-square distribution with $n-1$ degrees of freedom when the
population is a normal distribution with variance $\sigma^2$. Using this
theory, testing hypothesis for the population variance can be done as
follows.
:::
Table 7.2.1 Testing hypothesis of the population variance\
- the population is normally distributed -
---------------------------------------------------------------------------------------------------
Type of Hypothesis Decision Rule
----------------------------------------------- ---------------------------------------------------
1\) $\; H_0 : \sigma^{2} = \sigma^{2}_0$\ If $\frac{(n-1)S^2}{\sigma^2} > \chi^2_{n-1: α}$,
$\quad\,\, H_1 : \sigma^{2} > \sigma^{2}_0$ then reject $H_0$, else accept $H_0$
2\) $\; H_0 : \sigma^{2} = \sigma^{2}_0$\ If $\frac{(n-1)S^2}{\sigma^2} < \chi^2_{n-1: 1-α}$,
$\quad\,\, H_1 : \sigma^{2} < \sigma^{2}_0$ then reject $H_0$, else accept $H_0$
3\) $\; H_0 : \sigma^{2} = \sigma^{2}_0$\ If $\frac{(n-1)S^2}{\sigma^2} > \chi^2_{n-1: α/2}$
$\quad\,\, H_1 : \sigma^{2} \ne \sigma^{2}_0$ or
$\frac{(n-1)S^2}{\sigma^2} < \chi^2_{n-1: 1-α/2}$
then reject $H_0$, else accept $H_0$
---------------------------------------------------------------------------------------------------
Note: The $\small H_0$ of 1) can be written as
$\small \; H_0 : \sigma^{2} \le \sigma^{2}_0$ , 2) as
$\small \; H_0 : \sigma^{2} \ge \sigma^{2}_0$
::: mainTableGrey
**Example 7.2.1** One company produces bolts for an automobile. If the
average diameter of bolts is 15mm and its variance is less than $0.1^2$,
it can be delivered to the automobile company. Twenty-five of the most
recent products were randomly sampled and their variance was $0.15^2$.
Assuming that the diameter of a bolt follows a normal distribution,
::: textL20M20
1\) Conduct testing hypothesis at the 5% significance level to determine
if the product can be delivered to the automotive company.
:::
::: textL20M20
2\) Check the result using 『eStatU』
:::
**Answer**
::: textL20M20
1\) The hypothesis of this problem is
$\small H_0 : \sigma^{2} \le 0.1^{2} , H_1 : \sigma^{2} > 0.1^{2}$ and
its decision rule is as follows.
:::
$\small \qquad \qquad '\text{If } \frac{(n-1)S^2}{\sigma^2_{0}} \gt \chi^2_{n-1: α} , \text{ then reject } H_0 , \text{ else accept } H_0 ’$
::: textL20
Note that
$\small s^2 = 0.15^2 = 0.0225 , \frac {(25-1)×0.15^2}{0.1^2} = 54$ and
$\small \chi^2_{25-1: 0.05} = \chi^2_{24: 0.05} = 36.42$. Therefore,
$\small H_0$ is rejected.
:::
::: textL20M20
2\) Select 'Testing Hypothesis $\sigma^2$' in 『eStatU』. Enter
$\sigma^2_{0} = 0.1^2 = 0.01$, select the right sided test and the 5%
significance level as [Figure 7.2.1]{.figure-ref} in the input box. Then enter the
sample size $n$ = 25 and sample variance $\small s^2 = 0.15^2 = 0.0225$.
:::
<div>
<div>
<input class="qrBtn" onclick="window.open(addrStr[102])" src="QR/eStatU720_TestSigma.svg" type="image"/>
</div>
<div>
![](Figure/Fig070201.png){.imgFig600400}
::: figText
[Figure 7.2.1]{.figure-ref} Testing hypothesis for $\sigma^2$ using 『eStatU』
:::
</div>
</div>
::: textL20
If you click the [Execute]{.button-ref} button, the confidence interval of
$\sigma^2$ is calculated and testing result will be shown as \<Figure
7.2.2\>.
:::
![](Figure/Fig070202.png){.imgFig600400}
::: figText
[Figure 7.2.2]{.figure-ref} Testing hypothesis for $\sigma^2$
:::
:::
::: mainTableGrey
**Example 7.2.2** (Heights of college students)\
Using 『eStat』 and the height data of 10 male college students in
[Example 7.1.4]{.example-ref},
::: textLeft
172 175 178 182 176 180 169 185 173 177\
Ex ⇨ eBook ⇨ EX070104_Height.csv.
:::
test the hypothesis whether the population variance is greater than 25
at the significance level of 5%.
**Answer**