-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path09-testing-hypothesis-form-several-population-means.Rmd
2341 lines (1842 loc) · 87.4 KB
/
09-testing-hypothesis-form-several-population-means.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 Several Population Means
[book](pdf/book09.pdf){target="_blank"}
[eStat YouTube Channel](https://www.youtube.com/channel/UCw2Rzl9A4rXMcT8ue8GH3IA){target="_blank"}
**CHAPTER OBJECTIVES**
In testing hypothesis of the population mean described in chapters 7 and
8, the number of populations was one or two. However, many cases are
encountered where there are three or more population means to compare.
The analysis of variance (ANOVA) is used to test whether several
population means are equal or not. The ANOVA was first published by
British statistician R. A. Fisher as a test method applied to the study
of agriculture, but today its principles are applied in many
experimental sciences, including economics, business administration,
psychology and medicine.
In section 9.1, the one-way ANOVA for single factor is introduced. In
section 9.2, experimental designs for experiments are introduced. In
section 9.2, the two-way ANOVA for two factors experiments is
introduced.
:::
:::
:::
## Analysis of Variance for Single Factor Experiments
::: presentation-video-link
[presentation](pdf/0901.pdf){.presentation-link target="_blank"}
[video](https://youtu.be/az6KJp26dFA){.video-link target="_blank"}
:::
::: mainTable
In section 8.1, we discussed how to compare means of two populations
using the testing hypothesis. This chapter discusses how to compare
means of several populations. There are many examples of comparing means
of several populations as follows:
::: textL30M10
- Are average hours of library usage for each grade the same?
- Are yields of three different rice seeds equal?
- In a chemical reaction, are response rates the same at four different
temperatures?
- Are average monthly wages of college graduates the same at three
different cities?
:::
The group variable used to distinguish groups of the population, such as
the grade or the rice, is called a factor.
:::
::: mainTableYellow
**Factor**
The group variable used to distinguish groups of the population is
called a **factor**.
:::
::: mainTable
This section describes the one-way analysis of variance (ANOVA) which
compares population means when there is a single factor. Section 9.2
describes how the experiment is designed to extract sample data. Section
9.3 describes the two-way ANOVA to compare several population means when
there are two factors. Let's take a look at the following example.
:::
::: mainTableGrey
**Example 9.1.1** In order to compare the English proficiency of each
grade at a university, samples were randomly selected from each grade to
take the same English test, and data are as in [Table 9.1.1]{.table-ref}. The last row
is a calculation of the average ${\overline y}_{1\cdot}$,
${\overline y}_{2\cdot}$, ${\overline y}_{3\cdot}$,
${\overline y}_{4\cdot}$ for each grade.
::: textLeft
Table 9.1.1 English Proficiency Score by Grade
:::
Socre Student 1 Student 2 Student 3 Student 4 Student 5 Student 6 Student Average
--------- ----------- ----------- ----------- ----------- ----------- ----------- -------------------------------
Grade 1 81 75 69 90 72 83 ${\overline y}_{1\cdot}$=78.3
Grade 2 65 80 73 79 81 69 ${\overline y}_{2\cdot}$=74.5
Grade 3 72 67 62 76 80 ${\overline y}_{3\cdot}$=71.4
Grade 4 89 94 79 88 ${\overline y}_{4\cdot}$=87.5
Ex ⇨ eBook ⇨ EX090101_EnglishScoreByGrade.csv.
::: textL20M20
1\) Using 『eStat』 , draw a dot graph of test scores for each grade and
compare their averages.
:::
::: textL20M20
2\) We want to test a hypothesis whether average scores of each grade
are the same or not. Set up a null hypothesis and an alternative
hypothesis.
:::
::: textL20M20
3\) Apply the one-way analysis of variances to test the hypothesis in
question 2).
:::
::: textL20M20
4\) Use 『eStat』 to check the result of the ANOVA test.
:::
**Answer**
::: textL20M20
1\) If you draw a dot graph of English scores by each grade, you can see
whether scores of each grade are similar. If you plot the 95% confidence
interval of the population mean studied in Chapter 6 on each dot graph,
you can see a more detailed comparison.\
In order to draw a dot graph with data shown in [Table 9.1.1]{.table-ref} using
『eStat』 , enter data on the sheet and set variable names to 'Grade'
and 'Score' as shown in [Figure 9.1.1]{.figure-ref}. In the variable selection
box which appears by clicking the ANOVA icon on the main menu of
『eStat』 , select 'Analysis Var' as 'Score' and 'By Group' as
'Grade'. The dot graph of English scores by each grade and the 95%
confidence interval are displayed as shown in [Figure 9.1.2]{.figure-ref}.
:::
::: width:650px
<div>
<input class="qrBtn" onclick="window.open(addrStr[27])" src="QR/EX090101.svg" type="image"/>
</div>
<div>
![](Figure/Fig090101.png){.imgFig600400}
::: figText
[Figure 9.1.1]{.figure-ref} 『eStat』 data input for ANOVA
:::
</div>
:::
![](Figure/Fig090102.svg){.imgFig600400}
::: figText
[Figure 9.1.2]{.figure-ref} 95% Confidence Interval by grade
:::
::: textL20
To review the normality of the data, pressing the \[Histogram\] button
under this graph ([Figure 9.1.3]{.figure-ref}) will draw the histogram and normal
distribution together, as shown in [Figure 9.1.4]{.figure-ref}.
:::
![](Figure/Fig090103.png){.imgFig600400}
::: figText
[Figure 9.1.3]{.figure-ref} Options of ANOVA
:::
![](Figure/Fig090104.svg){.imgFig600400}
::: figText
[Figure 9.1.4]{.figure-ref} Histogram of English score by grade
:::
\
::: textL20
[Figure 9.1.2]{.figure-ref} shows sample means as ${\overline y}_{1\cdot}$= 78.3,
${\overline y}_{2\cdot}$ = 74.5, ${\overline y}_{3\cdot}$ = 71.4,
${\overline y}_{1\cdot}$ = 87.5. The sample mean of the 4th grader is
relatively large and the order of the sample means in English is
${\overline y}_{3\cdot} \lt {\overline y}_{2\cdot} \lt {\overline y}_{1\cdot} \lt {\overline y}_{4\cdot}$.
${\overline y}_{2\cdot}$ and ${\overline y}_{3\cdot}$ are similar, but
${\overline y}_{4\cdot}$ is much greater than the other three.
Therefore, it can be expected that the population mean $\mu_{2}$ and
$\mu_{3}$ would be the same and $\mu_{4}$ will differ from three other
population means. However, we need to test whether this difference by
sample means is statistically significant.
:::
::: textL20M20
2\) In this example, the null hypothesis to test is that population
means of English scores of the four grades are all the same, and the
alternative hypothesis is that population means of the English scores
are not the same. In other words, if are the population means of English
scores for each grade, the hypothesis to test can be written as follows,
::: textL30
Null hypothesis $\small \qquad \qquad \; H_0$:
$\mu_1 = \mu_2 = \mu_3 = \mu_4$
:::
::: textL30
Alternative hypothesis $\quad \small H_1$: at least one pair of $\mu_i$
is not the same
:::
:::
::: textL20M20
3\) A measure that can be considered first as a basis for testing
differences in multiple sample means would be the distance from each
mean to the overall mean. In other words, if the overall sample mean for
all 21 students is expressed as $\overline y_{\cdot \cdot}$, the
distance from each sample mean to the overall mean is as follows when
the number of samples in each grade is weighted. This distance is called
the between sum of squares (SSB) or the treatment sum of squares (SSTr).
::: textL30
$\small SSTr = 6(78.3 - {\overline y}_{\cdot \cdot})^2 + 6(74.5 - {\overline y}_{\cdot \cdot})^2 + 5(71.4 - {\overline y}_{\cdot \cdot})^2 + 4(87.5 - {\overline y}_{\cdot \cdot})^2$
= 643.633
:::
:::
::: textL20
If the distance $\small SSTr$ is close to zero, all sample means of
English scores for four grades are similar.
However, this treatment sum of squares can be larger if the number of
populations increases. It requires modification to become a test
statistic to determine whether several population means are equal. The
distance from each observation to its sample mean of the grade is called
the within sum of squares (SSW) or the error sum of squares (SSE) as
defined below.
::: textL30
$\small SSE = (81 -{\overline y}_{1 \cdot})^2 + (75 -{\overline y}_{1 \cdot})^2 + \cdots + (83 -{\overline y}_{1 \cdot})^2$\
$\small \qquad + (65 -{\overline y}_{2 \cdot})^2 + (80 -{\overline y}_{2 \cdot})^2 + \cdots + (69 -{\overline y}_{2 \cdot})^2$\
$\small \qquad + (72 -{\overline y}_{3 \cdot})^2 + (67 -{\overline y}_{3 \cdot})^2 + \cdots + (80 -{\overline y}_{3 \cdot})^2$\
$\small \qquad + (89 -{\overline y}_{4 \cdot})^2 + (94 -{\overline y}_{4 \cdot})^2 + \cdots + (88 -{\overline y}_{4 \cdot})^2$\
= 839.033
:::
If population distributions of English scores in each grade follow
normal distributions and their variances are the same, the following
test statistic has the distribution.
::: textL30
$\small F_{0} = \frac { \frac{SSTr}{(4-1)} } { \frac{SSE}{(21-4)} }$
:::
This statistic can be used to test whether population English scores of
four grades are the same or not. In the test statistic, the numerator
$\frac{SSTr}{4-1}$ is called the treatment mean square (MSTr) which
implies a variance between grade means. The denominator
$\frac{SSE}{21-4}$ is called the error mean square (MSE) which implies a
variance within each grade. Thus, the above test statistics are based on
the ratio of two variances which is why the test of multiple population
means is called an analysis of variance (ANOVA).
Calculated test statistic which is the observed $\small F$ value,
$\small F_{0}$ , using data of English scores for each grade is as
follows.
::: textLeft
$F_{0} = \frac { \frac{SSTr}{(4-1)} } { \frac{839.033}{(21-4)} } = \frac { \frac{643.633}{(4-1)} } { \frac{SSE}{(21-4)} } = 4.347$
:::
Since $\small F_{3,17; 0.05}$ = 3.20, the null hypothesis that
population means of English scores of each grade are the same,
$\small H_0 : \mu_1 = \mu_2 = \mu_3 = \mu_4$ , is rejected at the 5%
significance level. In other words, there is a difference in population
means of English scores of each grade.
The following ANOVA table provides a single view of the above
calculation.
:::
Factor Sum of Squares Degree of freedom Mean Squares F ratio
----------- ---------------- ------------------- -------------------------- ---------------
Treatment SSTr=643.633 4-1 MSTr=$\frac{643.633}{3}$ $F_0 = 4.347$
Error SSE= 839.033 21-4 MSE=$\frac{839.033}{17}$
Total SST = 1482.666 20
::: textL20M20
4\) In [Figure 9.1.3]{.figure-ref}, if you select the significance level of 5%,
confidence level of 95%, and click \[ANOVA F test\] button, a graph
showing the location of the test statistic in the F distribution is
appeared as shown in [Figure 9.1.5]{.figure-ref}. Also, in the Log Area, the mean
and confidence interval tables and test result for each grade are
appeared as in[Figure 9.1.6]{.figure-ref}.
:::
::: textL20
![](Figure/Fig090105.svg){.imgFig600400}
::: figText
[Figure 9.1.5]{.figure-ref} 『eStat』 ANOVA F test
:::
![](Figure/Fig090106.png){.imgFig600400}
::: figText
[Figure 9.1.6]{.figure-ref} 『eStat』 Basic Statistics and ANOVA table
:::
\
The analysis of variance is also possible using 『eStatU』. Entering the
data as [Figure 9.1.7]{.figure-ref} and clicking the [Execute]{.button-ref} button will have
the same result as in [Figure 9.1.5]{.figure-ref}.
![](Figure/Fig090107.png){.imgFig600400}
::: figText
[Figure 9.1.7]{.figure-ref} ANOVA data input at 『eStatU』
:::
:::
:::
::: mainTable
The above example refers to two variables, the English score and grade.
The variable such as the English score is called as an analysis variable
or a response variable. The response variable is mostly a continuous
variable. The variable used to distinguish populations such as the grade
is called a group variable or a factor variable which is mostly a
categorical variable. Each value of a factor variable Is called a level
of the factor and the number of these levels is the number of
populations to be compared. In the above example, the factor has four
levels, 1st, 2nd, 3rd and 4th grade. The term 'response' or 'factor'
was originated to analyze data through experiments in engineering,
agriculture, medicine and pharmacy.
The analysis of variance method that examines the effect of single
factor on the response variable is called the one-way ANOVA. [Table 9.1]{.table-ref}.2
shows the typical data structure of the one-way ANOVA when the number of
levels of a factor is $k$ and the numbers of observation at each level
are $n_1 , n_2 , ... , n_k$.
:::
::: textLeft
Table 9.1.2 Notation of the one-way ANOVA
:::
Factor Observed values of sample Average
---------- ---------------------------------------- ------------------------
Level 1 $Y_{11} \; Y_{12}\; \cdots \;Y_{1n_1}$ $\overline Y_{1\cdot}$
Level 2 $Y_{21} \; Y_{22}\; \cdots \;Y_{2n_2}$ $\overline Y_{2\cdot}$
$\cdots$ $\cdots$ $\cdots$
Level k $Y_{k1} \; Y_{k2}\; \cdots \;Y_{kn_k}$ $\overline Y_{k\cdot}$
::: mainTable
Statistical model for the one-way analysis of variance is given as
follows: $$
\begin{align}
Y_{ij} &= \mu_i + \epsilon_{ij} \\
&= \mu + \alpha_i + \epsilon_{ij}, i=1,2,...,k; j=1,2,..., n_i \\
\end{align}
$$ $Y_{ij}$ represents the $j^{th}$ observed value of the
response variable for the $i^{th}$ level of factor. The population mean
of the $i^{th}$ level, $\mu_{i}$, is represented as $\mu + \alpha_{i}$
where $\mu$ is the mean of entire population and $\alpha_{i}$ is the
effect of $i^{th}$ level for the response variable. $\epsilon_{ij}$
denotes an error term of the $j^{th}$ observation for the $i^{th}$ level
and the all error terms are assumed independent of each other and follow
the same normal distribution with the mean 0 and variance $\sigma^{2}$.
The error term $\epsilon_{ij}$ is a random variable in the response
variable due to reasons other than levels of the factor. For example, in
the English score example, differences in English performance for each
grade can be caused by other variables besides the variables of grade,
such as individual English study hours, gender and IQ. However, by
assuming that these changes are relatively small compared to changes due
to differences in grade, the error term can be interpreted as the sum of
these various reasons.
The hypothesis to test can be represented using $\alpha_{i}$ instead of
$\mu_{i}$ as follows:
::: textL20
Null hypothesis $\qquad \quad \;\;\; H_0$:
$\alpha_1 = \alpha_2 = \alpha_3 = \alpha_4$ = 0\
:::
::: textL20
Alternative hypothesis $\quad H_1$: at least one $\alpha_i$ is not equal
to 0
:::
In order to test the hypothesis, the analysis of variance table as Table
9.1.3 is used.
:::
::: textLeft
Table 9.1.3 Analysis of variance table of the one-way ANOVA
:::
Factor Sum of Squares Degree of freedom Mean Squares F ratio
----------- ---------------- ------------------- ------------------------- --------------------------
Treatment SSTr $k-1$ MSTr=$\frac{SSTr}{k-1}$ $F_0 = \frac{MSTr}{MSE}$
Error SSE $n-k$ MSE=$\frac{SSE}{n-k}$
Total SST $n-1$
::: textL20
$\qquad n = \sum_{i=1}^{n} \; n_i$\
:::
::: mainTable
The three sum of squares for the variance analysis can be described as
follows: For an explanation, first define the following statistics:
::: textL20
${\overline Y}_{i \cdot} \;$ Mean of observations at the $i^{th}$ level\
${\overline Y}_{\cdot \cdot} \;$ Mean of total observations
:::
**SST** =
$\sum_{i=1}^{k} \sum_{j=1}^{n_i} ( Y_{ij} - {\overline Y}_{\cdot \cdot} )^2 \;$
:\
The sum of squared distances between observed values of the response
variable and the mean of total observations is called the **total sum of
squares** (SST).
**SSTr** =
$\sum_{i=1}^{k} \sum_{j=1}^{n_i} ( {\overline Y}_{i \cdot} - {\overline Y}_{\cdot \cdot} )^2 \;$
:\
The sum of squared distances between the mean of each level and the mean
of total observations is called the **treatment sum of squares** (SSTr).
It represents the variation between level means.
**SSE** =
$\sum_{i=1}^{k} \sum_{j=1}^{n_i} ( {Y}_{ij} - {\overline Y}_{i \cdot} )^2 \;$
:\
The sum of squared distances between observations of the $i^{th}$ level
and the mean of the $i^{th}$ level is referred to as 'within
variation,' and is called the **error sum of squares** (SSE).
The degree of freedom of each sum of squares is determined by the
following logic: The SST consists of $n$ number of squares,
$( Y_{ij} - {\overline Y}_{\cdot \cdot} )^2$, but
${\overline Y}_{\cdot \cdot}$ should be calculated first, before SST is
calculated, and hence the degree of freedom of SST is $n-1$. The SSE
consists of $n$ number of squares,
$( {Y}_{ij} - {\overline Y}_{i \cdot} )^2$, but the number of values,
${\overline Y}_{1 \cdot}, {\overline Y}_{2 \cdot}, ... , {\overline Y}_{k \cdot}$
should be calculated first, before SSE is calculated, and hence the
degree of freedom of SSE is $n-k$. The degree of freedom of SSTr is
calculated as the degree of freedom of SST minus the degree of freedom
of SSE which is . In the one-way analysis of variance, the following
facts are always established:
:::
::: mainTableYellow
**Partition of sum of squares and degrees of freedom**
Sum of squares: SST = SSTr + SSE\
Degrees of freedom: $(n-1) = (k-1) + (n-k)$
:::
::: mainTable
The sum of squares divided by the corresponding degrees of freedom is
referred to as the mean squares and [Table 9.1.3]{.table-ref} defines the treatment
mean squares (MSTr) and error mean squares (MSE). As in the meaning of
the sum of squares, the treatment mean square implies the average
variation between each level of the factor, and the error mean square
implies the average variation within observations in each level.
Therefore, if MSTr is relatively much larger than MSE, we can conclude
that the population means of each level, $\mu_i$, are not the same. So
by what criteria can you say it is relatively much larger?
The calculated $F$ value, $F_0$, in the last column of the ANOVA table
represents the relative size of MSTr and MSE. If the assumptions of
$\epsilon_{ij}$ based on statistical theory are satisfied, and if the
null hypothesis $\small H_0 : \alpha_1 = \alpha_2 = \cdots = \alpha_k$ =
0 is true, then the below test statistic follows a F distribution with
degrees of freedoms $k-1$ and $n-k$. $$
F_{0} = \frac { \frac{SSTr}{(k-1)} } { \frac{SSE}{(n-k)} }
$$ Therefore, when the significance level is $\alpha$ for a test,
if the calculated value $F_0$ is greater than the value of
$F_{k-1,n-k; α}$, then the null hypothesis is rejected. That is, it is
determined that the population means of each factor level are not all
the same.
:::
::: mainTableYellow
**One-way analysis of variance test**
::: textL20
Null hypothesis $\qquad \qquad \; H_0$:
$\alpha_1 = \alpha_2 = \alpha_3 = \alpha_4$\
:::
::: textL20
Alternative hypothesis $\quad H_1$: at least one $\alpha_i$ is not equal
to 0
:::
::: textL20
Test Statistic
$\;\; F_{0} = \frac { \frac{SSTr}{(k-1)} } { \frac{SSE}{(n-k)} }$
:::
::: textL20
Decision Rule If $\;\; F_0 > F_{k-1,n-k; α}$, then reject $H_0$
:::
(Note: 『eStat』 calculates the $p$-value of this test. Hence if the
$p$-value is smaller than the significance level $\alpha$, then reject
the null hypothesis. )
:::
::: mainTablePink
::: width:650px
<div>
<input class="qrBtn" onclick="window.open(addrStr[65])" src="QR/PR090101.svg" type="image"/>
</div>
<div>
**Practice 9.1.1** **(Plant Growth by Condition)**\
Results from an experiment to compare yields (as measured by dried
weight of plants) obtained under a control (leveled 'ctrl') and two
different treatment conditions (leveled 'trt1' and 'trt2'). The weight
data with 30 observations on control and two treatments ('crtl', 'trt1',
'trt2'), are saved at the following location of 『eStat』. Answer the
followings using 『eStat』 ,
::: textLeft
Ex ⇨ eBook ⇨ PR090101_Rdatasets_PlantGrowth.csv
:::
::: textL20M20
1\) Draw a dot graph of weights for each control and treatments.
:::
::: textL20M20
2\) Test a hypothesis whether the weights are the same or not. Use the
5% significance level.
:::
</div>
:::
:::
:::
### Multiple Comparison
::: presentation-video-link
[presentation](pdf/090101-02.pdf){.presentation-link target="_blank"}
[video](https://youtu.be/Re_gHPIkeNE){.video-link target="_blank"}
:::
::: mainTable
If the F test of the one-way ANOVA does not show a significant
difference between each level of the factor, it can be concluded that
there is no difference between each level of populations. However, if
you conclude that there are significant differences between each level
as shown in [Example 9.1.1]{.example-ref}, you need to examine which levels are
different from each other.
The analysis of differences between population means after ANOVA
requires several tests for the mean difference to be performed
simultaneously and it is called as the multiple comparison. The
hypothesis for the multiple comparison to test whether the level means,
$\mu_i$ and $\mu_j$, are equal is as follows: $$
H_0 : \mu_i = \mu_j , \quad H_1 : \mu_i \ne \mu_j \quad i=1,2,...,k-1,\; j=i+1,i+2,...,k
$$ It means that there are $_{k}C_{2}$ tests to be done
simultaneously for the multiple comparisons if there is $k$ level of the
factor.
There are many multiple comparison tests, but Tukey's Honestly
Significant Difference (HSD) test is most commonly used. The statistic
for Tukey's HSD test to compare means $\mu_i$ and $\mu_j$ is the sample
mean difference ${\overline y}_i - {\overline y}_j$ and the decision
rule to test $H_0 : \mu_i = \mu_j$ is as follows:
::: textL20
If $|{\overline y}_{i\cdot} - {\overline y}_{j\cdot} | > HSD_{ij}$, then
reject $H_0$\
where
$HSD_{ij} = q_{k,n-k; α} \cdot \sqrt{\frac{1}{2} ( \frac{1}{n_i } + \frac{1}{n_j} ) MSE }$,
$n_i$ and $n_j$ are the number of samples (repetitions) in $i^{th}$
level and $j^{th}$ level, $MSE$ is the mean squared error,
$q_{k,n-k; α}$ is the right tail 100$\times \alpha$ percentile of the
studentized range distribution with parameter $k$ and $n-k$ degrees of
freedom. (It can be found at『eStatU』 ([Figure 9.1.8]{.figure-ref})).
:::
::: width:650px
<div>
<input class="qrBtn" onclick="window.open(addrStr[120])" src="QR/eStatU995_StudentRangeD.svg" type="image"/>
</div>
<div>
![](Figure/Fig090108.png){.imgFig600400}
::: figText
[Figure 9.1.8]{.figure-ref}『eStatU』HSD percentile table
:::
</div>
:::
:::
::: mainTableGrey
**Example 9.1.2** In [Example 9.1.1]{.example-ref}, the analysis variance of English
scores by the grade concluded that the null hypothesis was rejected and
the average English scores for each grade were not all the same. Now
let's apply the multiple comparisons to check where the differences
exist among each school grade with the significance level of 5%. Use
『eStat』 to check the result.
**Answer**
The hypothesis of the multiple comparisons is
$\small H_0 : \mu_i = \mu_j , \quad H_1 : \mu_i \ne \mu_j$ and the
decision rule is as follows:
::: textL20
'If
$\small |{\overline y}_{i\cdot} - {\overline y}_{j\cdot}| > HSD_{ij}$,
then reject $\small H_0$'
:::
Since there are four school grades ($k=4$), $_{4}C_{2}$ = 6 multiple
comparisons are possible as follows. The 5 percentile from the right
tail of HSD distribution which is used to test is
$q_{k,n-k; α} = q_{4,21-4; 0.05}$ = 4.02.
1\) $\small H_0 : \mu_1 = \mu_2 , \quad H_1 : \mu_1 \ne \mu_2$
::: textL20
$\small |{\overline y}_{1\cdot} - {\overline y}_{2\cdot} | =|78.3 - 74.5|$
= 3.8\
$\small HSD_{12} = q_{k,n-k; α} \cdot \sqrt{\frac{1}{2} ( \frac{1}{n_1 } + \frac{1}{n_2} ) MSE }$
=
$\small q_{4,21-4; 0.05} \cdot \sqrt{\frac{1}{2} ( \frac{1}{6} + \frac{1}{6} ) 49.355 }$
= 11.530\
Therefore, accept $\small H_0$
:::
2\) $\small H_0 : \mu_1 = \mu_3 , \quad H_1 : \mu_1 \ne \mu_3$
::: textL20
$\small |{\overline y}_{1\cdot} - {\overline y}_{3\cdot} | =|78.3 - 71.4|$
= 6.9\
$\small HSD_{13} = q_{k,n-k; α} \cdot \sqrt{\frac{1}{2} ( \frac{1}{n_1 } + \frac{1}{n_3} ) MSE }$
=
$\small q_{4,21-4; 0.05} \cdot \sqrt{\frac{1}{2} ( \frac{1}{6} + \frac{1}{5} ) 49.355 }$
= 12.092\
Therefore, accept $\small H_0$
:::
3\) $\small H_0 : \mu_1 = \mu_4 , \quad H_1 : \mu_1 \ne \mu_4$
::: textL20
$\small |{\overline y}_{1\cdot} - {\overline y}_{4\cdot} | =|78.3 - 88.5|$
= 10.2\
$\small HSD_{14} = q_{k,n-k; α} \cdot \sqrt{\frac{1}{2} ( \frac{1}{n_1 } + \frac{1}{n_4} ) MSE }$
=
$\small q_{4,21-4; 0.05} \cdot \sqrt{\frac{1}{2} ( \frac{1}{6} + \frac{1}{4} ) 49.355 }$
= 12.891\
Therefore, accept $\small H_0$
:::
4\) $\small H_0 : \mu_2 = \mu_3 , \quad H_1 : \mu_2 \ne \mu_3$
::: textL20
$\small |{\overline y}_{2\cdot} - {\overline y}_{3\cdot} | =|74.5 - 71.4|$
= 3.1\
$\small HSD_{23} = q_{k,n-k; α} \cdot \sqrt{\frac{1}{2} ( \frac{1}{n_2 } + \frac{1}{n_3} ) MSE }$
=
$\small q_{4,21-4; 0.05} \cdot \sqrt{\frac{1}{2} ( \frac{1}{6} + \frac{1}{5} ) 49.355 }$
= 12.092\
Therefore, accept $\small H_0$
:::
5\) $\small H_0 : \mu_2 = \mu_4 , \quad H_1 : \mu_2 \ne \mu_4$
::: textL20
$\small |{\overline y}_{2\cdot} - {\overline y}_{4\cdot} | =|74.5 -88.5|$
= 14\
$\small HSD_{24} = q_{k,n-k; α} \cdot \sqrt{\frac{1}{2} ( \frac{1}{n_2 } + \frac{1}{n_4} ) MSE }$
=
$\small q_{4,21-4; 0.05} \cdot \sqrt{\frac{1}{2} ( \frac{1}{6} + \frac{1}{4} ) 49.355 }$
= 12.891\
Therefore, reject $\small H_0$
:::
6\) $\small H_0 : \mu_3 = \mu_4 , \quad H_1 : \mu_3 \ne \mu_4$
::: textL20
$\small |{\overline y}_{3\cdot} - {\overline y}_{4\cdot} | =|71.4 - 88.5|$
= 17.1\
$\small HSD_{34} = q_{k,n-k; α} \cdot \sqrt{\frac{1}{2} ( \frac{1}{n_3 } + \frac{1}{n_4} ) MSE }$
=
$\small q_{4,21-4; 0.05} \cdot \sqrt{\frac{1}{2} ( \frac{1}{5} + \frac{1}{4} ) 49.355 }$
= 13.396\
Therefore, reject $\small H_0$
:::
The result of the above multiple comparisons shows that there is a
difference between $\mu_2$ and $\mu_4$, $\mu_3$ and $\mu_4$ as can be
seen in the dot graph with average in [Figure 9.1.1]{.figure-ref}. It also shows
that $\mu_1$ has no significant difference from other means.
If you click 'Multiple Comparison' in the options of the ANOVA as in
[Figure 9.1.3]{.figure-ref}, 『eStat』shows the result of Tukey's multiple
comparisons as shown in [Figure 9.1.9]{.figure-ref}. 『eStat』also shows the mean
difference and 95% HSD value for the sample mean combination after
rearranging levels of rows and columns in ascending order of the sample
means.
The next table shows that, if the HSD test result for the combination of
the two levels is significant with the 5% significance level, then \*
will be marked and if it is significant with the 1% significance level,
then \*\* will be marked, if it is not significant, then the cell is
left blank.
![](Figure/Fig090109.png){.imgFig600400}
::: figText
[Figure 9.1.9]{.figure-ref} HSD Multiple Comarisons
:::
For the analysis of mean differences, confidence intervals for each
level may also be used. [Figure 9.1.2]{.figure-ref} shows the 95% confidence
interval for the mean for each level. This confidence interval is
created using the formula described in Chapter 6, but the only
difference is that the estimate of the variance for the error,
$\sigma^2$, is the pooled variance using overall observations rather
than the sample variance of observed values at each level. In the ANOVA
table, MSE is the pooled variance.
In post-analysis using these confidence intervals, there is a difference
between means if the confidence intervals are not overlapped, so the
same conclusion can be obtained as in the previous HSD test.
:::
::: mainTablePink
::: width:650px
<div>
<input class="qrBtn" onclick="window.open(addrStr[65])" src="QR/PR090101.svg" type="image"/>
</div>
<div>
**Practice 9.1.2** By using the data of \[Practice 9.1.1\]
::: textLeft
Ex ⇨ eBook ⇨ PR090101_Rdatasets_PlantGrowth.csv
:::
apply the multiple comparisons to check where differences exist among
Control and two treatments with the significance level of 5%.
Use『eStat』 .
</div>
:::
:::
### Residual Analysis
::: mainTable
Another statistical analysis related to the ANOVA is a residual
analysis. Various hypothesis tests in the ANOVA are performed on the
condition that assumptions hold about the error term $\epsilon_{ij}$.
Assumptions about error terms include independence ($\epsilon_{ij}$ are
independent of each other), homoscedasticity (each variance of
$\epsilon_{ij}$ is constant as $\sigma^2$), normality (each
$\epsilon_{ij}$ is normally distributed), etc. The validity of these
assumptions should always be investigated. However, since
$\epsilon_{ij}$ can not be observed, the residual as the estimate of
$\epsilon_{ij}$ is used to check the assumptions. The residuals in the
ANOVA are defined as the deviations used in the equation of the error
sum of squares, for example, $Y_{ij} - {\overline Y}_{i \cdot}$ in the
one-way variance analysis.
:::
::: mainTableGrey
**Example 9.1.3** In [Example 9.1.1]{.example-ref} of English score comparison by
the grade, apply the residual analysis using『eStat』.
**Answer**
If you click on 'Standardized Residual Plot' of the ANOVA option in
[Figure 9.1.3]{.figure-ref}, a scatter plot of residuals versus fitted values
appears as shown in [Figure 9.1.10]{.figure-ref}. In this scatter plot, if the
residuals show no unusual tendency around zero and appear randomly, then
the assumptions of independence and homoscedasticity are valid. There is
no unusual tendency in this scatter plot. Normality of the residuals can
be checked by drawing the histogram of residuals.
![](Figure/Fig090110.svg){.imgFig600400}
::: figText
[Figure 9.1.10]{.figure-ref} Residual plot of the ANOVA
:::
:::
::: mainTablePink
::: width:650px
<div>
<input class="qrBtn" onclick="window.open(addrStr[65])" src="QR/PR090101.svg" type="image"/>
</div>
<div>
**Practice 9.1.3** By using the data of \[Practice 9.1.1\]
::: textLeft
Ex ⇨ eBook ⇨ PR090101_Rdatasets_PlantGrowth.csv
:::
apply the residual analysis using 『eStat』.
</div>
:::
:::
::: mainTablePink
### Multiple Choice Exercise
Choose one answer and click Submit button
::: textL30M30
9.1 Who first announced the ANOVA method?
:::
<form name="Q1">
<label><input name="item" type="radio" value="1"/> Laspeyres</label><br/>
<label><input name="item" type="radio" value="2"/> Paasche</label><br/>
<label><input name="item" type="radio" value="3"/> Fisher</label><br/>
<label><input name="item" type="radio" value="4"/> Edgeworth</label><br/>
<p>
<input onclick="radio(9,1,Q1)" type="button" value="Submit"/>
<input id="ansQ1" size="15" type="text"/>
</p></form>
::: textL30M30
9.2 What are the abbreviation of the analysis of variance?
:::
<form name="Q2">
<label><input name="item" type="radio" value="1"/> ANOVA</label><br/>
<label><input name="item" type="radio" value="2"/> t</label><br/>
<label><input name="item" type="radio" value="3"/> F</label><br/>
<label><input name="item" type="radio" value="4"/> Chi-square</label><br/>
<p>
<input onclick="radio(9,2,Q2)" type="button" value="Submit"/>
<input id="ansQ2" size="15" type="text"/>
</p></form>
::: textL30M30
9.3 Which areas are not the area of application for the analysis of
variance?
<form name="Q3">
<label><input name="item" type="radio" value="1"/> marketing survey</label><br/>
<label><input name="item" type="radio" value="2"/> quality control </label><br/>
<label><input name="item" type="radio" value="3"/> economy forecasting</label><br/>
<label><input name="item" type="radio" value="4"/> medical experiment</label><br/>
<p>
<input onclick="radio(9,3,Q3)" type="button" value="Submit"/>
<input id="ansQ3" size="15" type="text"/>
</p></form>
::: textL30M30
9.4 Which sampling distribution is used for the analysis of variance?
:::
<form name="Q4">
<label><input name="item" type="radio" value="1"/> t-distribution</label><br/>
<label><input name="item" type="radio" value="2"/> F-distribution</label><br/>
<label><input name="item" type="radio" value="3"/> Chi-square distribution</label><br/>
<label><input name="item" type="radio" value="4"/> Normal distribution</label><br/>
<p>
<input onclick="radio(9,4,Q4)" type="button" value="Submit"/>
<input id="ansQ4" size="15" type="text"/>
</p></form>
::: textL30M30
9.5 Which is the correct process for the one-way ANOVA?
:::
::: textLeft
a\. Calculate Total SS, Treatment SS, Error SS
:::
::: textLeft
b\. Set the hypothesis
:::
::: textLeft
c\. Test the hypothesis
:::
::: textLeft
d\. Calculate the variance ration in the ANOVA table
:::
::: textLeft
e\. Find the value in the F distribution table
:::
<form name="Q5">
<label><input name="item" type="radio" value="1"/> a → b → c → d → e</label><br/>
<label><input name="item" type="radio" value="2"/> b → d → e → a → c</label><br/>
<label><input name="item" type="radio" value="3"/> b → a → d → e → c</label><br/>
<label><input name="item" type="radio" value="4"/> b → e → d → a → c</label><br/>
<p>
<input onclick="radio(9,5,Q5)" type="button" value="Submit"/>
<input id="ansQ5" size="15" type="text"/>
</p></form>
::: textL30M30
9.6 Which is the correct relationship between the total sum of squares
(SST), between sum of squares (SSB), error sum of squares (SSE)?
:::
<form name="Q6">
<label><input name="item" type="radio" value="1"/> SST = SSB + SSE</label><br/>
<label><input name="item" type="radio" value="2"/> SST = SSB - SSE</label><br/>
<label><input name="item" type="radio" value="3"/> SST = SSE - SSB</label><br/>
<label><input name="item" type="radio" value="4"/> SST = SSB * SSE</label><br/>
<p>
<input onclick="radio(9,6,Q6)" type="button" value="Submit"/>
<input id="ansQ6" size="15" type="text"/>
</p></form>
::: textL30M30
9.7 If $F_{4,30: 0.05} = 2.87$ and the observed $F$ ratio is 6.90 in the
ANOVA table, what is your conclusion with the 5% significance level?
:::
<form name="Q7">
<label><input name="item" type="radio" value="1"/> significantly different</label><br/>
<label><input name="item" type="radio" value="2"/> no significant difference</label><br/>
<label><input name="item" type="radio" value="3"/> very similar</label><br/>
<label><input name="item" type="radio" value="4"/> unknown</label><br/>
<p>
<input onclick="radio(9,7,Q7)" type="button" value="Submit"/>
<input id="ansQ7" size="15" type="text"/>
</p></form>
::: textL30M30
9.8 Which is not appeared in the analysis of variance table?
:::
<form name="Q8">
<label><input name="item" type="radio" value="1"/> sum of squares</label><br/>
<label><input name="item" type="radio" value="2"/> F ratio</label><br/>
<label><input name="item" type="radio" value="3"/> degrees of freedom</label><br/>