-
Notifications
You must be signed in to change notification settings - Fork 1
/
Chapter_24.html
990 lines (951 loc) · 85.3 KB
/
Chapter_24.html
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
<!DOCTYPE html>
<html lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Chapter 24 Analysis of variance | Fundamental statistical concepts and techniques in the biological and environmental sciences: With jamovi</title>
<meta name="description" content="This is an introductory statistics textbook for students in the biological and environmental sciences with examples using jamovi statistical software." />
<meta name="generator" content="bookdown 0.39 and GitBook 2.6.7" />
<meta property="og:title" content="Chapter 24 Analysis of variance | Fundamental statistical concepts and techniques in the biological and environmental sciences: With jamovi" />
<meta property="og:type" content="book" />
<meta property="og:image" content="/img/cover.png" />
<meta property="og:description" content="This is an introductory statistics textbook for students in the biological and environmental sciences with examples using jamovi statistical software." />
<meta name="github-repo" content="bradduthie/stats" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="Chapter 24 Analysis of variance | Fundamental statistical concepts and techniques in the biological and environmental sciences: With jamovi" />
<meta name="twitter:description" content="This is an introductory statistics textbook for students in the biological and environmental sciences with examples using jamovi statistical software." />
<meta name="twitter:image" content="/img/cover.png" />
<meta name="author" content="A. Bradley Duthie" />
<meta name="date" content="2024-08-06" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="prev" href="Chapter_23.html"/>
<link rel="next" href="Chapter_25.html"/>
<script src="libs/jquery-3.6.0/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/fuse.js@6.4.6/dist/fuse.min.js"></script>
<link href="libs/gitbook-2.6.7/css/style.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-table.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-bookdown.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-highlight.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-search.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-fontsettings.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-clipboard.css" rel="stylesheet" />
<link href="libs/anchor-sections-1.1.0/anchor-sections.css" rel="stylesheet" />
<link href="libs/anchor-sections-1.1.0/anchor-sections-hash.css" rel="stylesheet" />
<script src="libs/anchor-sections-1.1.0/anchor-sections.js"></script>
<style type="text/css">
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
}
pre.numberSource { margin-left: 3em; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { font-weight: bold; } /* Alert */
code span.an { font-style: italic; } /* Annotation */
code span.cf { font-weight: bold; } /* ControlFlow */
code span.co { font-style: italic; } /* Comment */
code span.cv { font-style: italic; } /* CommentVar */
code span.do { font-style: italic; } /* Documentation */
code span.dt { text-decoration: underline; } /* DataType */
code span.er { font-weight: bold; } /* Error */
code span.in { font-style: italic; } /* Information */
code span.kw { font-weight: bold; } /* Keyword */
code span.pp { font-weight: bold; } /* Preprocessor */
code span.wa { font-style: italic; } /* Warning */
</style>
<style type="text/css">
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
</style>
<style type="text/css">
/* Used with Pandoc 2.11+ new --citeproc when CSL is used */
div.csl-bib-body { }
div.csl-entry {
clear: both;
}
.hanging div.csl-entry {
margin-left:2em;
text-indent:-2em;
}
div.csl-left-margin {
min-width:2em;
float:left;
}
div.csl-right-inline {
margin-left:2em;
padding-left:1em;
}
div.csl-indent {
margin-left: 2em;
}
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<div class="book without-animation with-summary font-size-2 font-family-1" data-basepath=".">
<div class="book-summary">
<nav role="navigation">
<ul class="summary">
<li><a href="./">Statistics with jamovi</a></li>
<li class="divider"></li>
<li class="chapter" data-level="" data-path="index.html"><a href="index.html"><i class="fa fa-check"></i>Preface</a>
<ul>
<li class="chapter" data-level="" data-path="index.html"><a href="index.html#structure"><i class="fa fa-check"></i>How this book is structured</a></li>
<li class="chapter" data-level="" data-path="index.html"><a href="index.html#datasets"><i class="fa fa-check"></i>Datasets used in this book</a></li>
<li class="chapter" data-level="" data-path="index.html"><a href="index.html#acknowledgements"><i class="fa fa-check"></i>Acknowledgements</a></li>
<li class="chapter" data-level="" data-path="index.html"><a href="index.html#author"><i class="fa fa-check"></i>About the author</a></li>
</ul></li>
<li class="chapter" data-level="1" data-path="Chapter_1.html"><a href="Chapter_1.html"><i class="fa fa-check"></i><b>1</b> Background mathematics</a>
<ul>
<li class="chapter" data-level="1.1" data-path="Chapter_1.html"><a href="Chapter_1.html#numbers-and-operations"><i class="fa fa-check"></i><b>1.1</b> Numbers and operations</a></li>
<li class="chapter" data-level="1.2" data-path="Chapter_1.html"><a href="Chapter_1.html#logarithms"><i class="fa fa-check"></i><b>1.2</b> Logarithms</a></li>
<li class="chapter" data-level="1.3" data-path="Chapter_1.html"><a href="Chapter_1.html#order-of-operations"><i class="fa fa-check"></i><b>1.3</b> Order of operations</a></li>
</ul></li>
<li class="chapter" data-level="2" data-path="Chapter_2.html"><a href="Chapter_2.html"><i class="fa fa-check"></i><b>2</b> Data organisation</a>
<ul>
<li class="chapter" data-level="2.1" data-path="Chapter_2.html"><a href="Chapter_2.html#tidy-data"><i class="fa fa-check"></i><b>2.1</b> Tidy data</a></li>
<li class="chapter" data-level="2.2" data-path="Chapter_2.html"><a href="Chapter_2.html#data-files"><i class="fa fa-check"></i><b>2.2</b> Data files</a></li>
<li class="chapter" data-level="2.3" data-path="Chapter_2.html"><a href="Chapter_2.html#managing-data-files"><i class="fa fa-check"></i><b>2.3</b> Managing data files</a></li>
</ul></li>
<li class="chapter" data-level="3" data-path="Chapter_3.html"><a href="Chapter_3.html"><i class="fa fa-check"></i><b>3</b> <em>Practical</em>. Preparing data</a>
<ul>
<li class="chapter" data-level="3.1" data-path="Chapter_3.html"><a href="Chapter_3.html#transferring-data-to-a-spreadsheet"><i class="fa fa-check"></i><b>3.1</b> Transferring data to a spreadsheet</a></li>
<li class="chapter" data-level="3.2" data-path="Chapter_3.html"><a href="Chapter_3.html#making-spreadsheet-data-tidy"><i class="fa fa-check"></i><b>3.2</b> Making spreadsheet data tidy</a></li>
<li class="chapter" data-level="3.3" data-path="Chapter_3.html"><a href="Chapter_3.html#making-data-tidy-again"><i class="fa fa-check"></i><b>3.3</b> Making data tidy again</a></li>
<li class="chapter" data-level="3.4" data-path="Chapter_3.html"><a href="Chapter_3.html#tidy-data-and-spreadsheet-calculations"><i class="fa fa-check"></i><b>3.4</b> Tidy data and spreadsheet calculations</a></li>
<li class="chapter" data-level="3.5" data-path="Chapter_3.html"><a href="Chapter_3.html#summary"><i class="fa fa-check"></i><b>3.5</b> Summary</a></li>
</ul></li>
<li class="chapter" data-level="4" data-path="Chapter_4.html"><a href="Chapter_4.html"><i class="fa fa-check"></i><b>4</b> Populations and samples</a></li>
<li class="chapter" data-level="5" data-path="Chapter_5.html"><a href="Chapter_5.html"><i class="fa fa-check"></i><b>5</b> Types of variables</a></li>
<li class="chapter" data-level="6" data-path="Chapter_6.html"><a href="Chapter_6.html"><i class="fa fa-check"></i><b>6</b> Accuracy, precision, and units</a>
<ul>
<li class="chapter" data-level="6.1" data-path="Chapter_6.html"><a href="Chapter_6.html#accuracy"><i class="fa fa-check"></i><b>6.1</b> Accuracy</a></li>
<li class="chapter" data-level="6.2" data-path="Chapter_6.html"><a href="Chapter_6.html#precision"><i class="fa fa-check"></i><b>6.2</b> Precision</a></li>
<li class="chapter" data-level="6.3" data-path="Chapter_6.html"><a href="Chapter_6.html#systems-of-units"><i class="fa fa-check"></i><b>6.3</b> Systems of units</a></li>
</ul></li>
<li class="chapter" data-level="7" data-path="Chapter_7.html"><a href="Chapter_7.html"><i class="fa fa-check"></i><b>7</b> Uncertainty propagation</a>
<ul>
<li class="chapter" data-level="7.1" data-path="Chapter_7.html"><a href="Chapter_7.html#adding-or-subtracting-errors"><i class="fa fa-check"></i><b>7.1</b> Adding or subtracting errors</a></li>
<li class="chapter" data-level="7.2" data-path="Chapter_7.html"><a href="Chapter_7.html#multiplying-or-dividing-errors"><i class="fa fa-check"></i><b>7.2</b> Multiplying or dividing errors</a></li>
</ul></li>
<li class="chapter" data-level="8" data-path="Chapter_8.html"><a href="Chapter_8.html"><i class="fa fa-check"></i><b>8</b> <em>Practical</em>. Introduction to jamovi</a>
<ul>
<li class="chapter" data-level="8.1" data-path="Chapter_8.html"><a href="Chapter_8.html#summary_statistics_02"><i class="fa fa-check"></i><b>8.1</b> Summary statistics</a></li>
<li class="chapter" data-level="8.2" data-path="Chapter_8.html"><a href="Chapter_8.html#transforming_variables_02"><i class="fa fa-check"></i><b>8.2</b> Transforming variables</a></li>
<li class="chapter" data-level="8.3" data-path="Chapter_8.html"><a href="Chapter_8.html#computing_variables_02"><i class="fa fa-check"></i><b>8.3</b> Computing variables</a></li>
<li class="chapter" data-level="8.4" data-path="Chapter_8.html"><a href="Chapter_8.html#summary-1"><i class="fa fa-check"></i><b>8.4</b> Summary</a></li>
</ul></li>
<li class="chapter" data-level="9" data-path="Chapter_9.html"><a href="Chapter_9.html"><i class="fa fa-check"></i><b>9</b> Decimal places, significant figures, and rounding</a>
<ul>
<li class="chapter" data-level="9.1" data-path="Chapter_9.html"><a href="Chapter_9.html#decimal-places-and-significant-figures"><i class="fa fa-check"></i><b>9.1</b> Decimal places and significant figures</a></li>
<li class="chapter" data-level="9.2" data-path="Chapter_9.html"><a href="Chapter_9.html#rounding"><i class="fa fa-check"></i><b>9.2</b> Rounding</a></li>
</ul></li>
<li class="chapter" data-level="10" data-path="Chapter_10.html"><a href="Chapter_10.html"><i class="fa fa-check"></i><b>10</b> Graphs</a>
<ul>
<li class="chapter" data-level="10.1" data-path="Chapter_10.html"><a href="Chapter_10.html#histograms"><i class="fa fa-check"></i><b>10.1</b> Histograms</a></li>
<li class="chapter" data-level="10.2" data-path="Chapter_10.html"><a href="Chapter_10.html#barplots-and-pie-charts"><i class="fa fa-check"></i><b>10.2</b> Barplots and pie charts</a></li>
<li class="chapter" data-level="10.3" data-path="Chapter_10.html"><a href="Chapter_10.html#box-whisker-plots"><i class="fa fa-check"></i><b>10.3</b> Box-whisker plots</a></li>
</ul></li>
<li class="chapter" data-level="11" data-path="Chapter_11.html"><a href="Chapter_11.html"><i class="fa fa-check"></i><b>11</b> Measures of central tendency</a>
<ul>
<li class="chapter" data-level="11.1" data-path="Chapter_11.html"><a href="Chapter_11.html#the-mean"><i class="fa fa-check"></i><b>11.1</b> The mean</a></li>
<li class="chapter" data-level="11.2" data-path="Chapter_11.html"><a href="Chapter_11.html#the-mode"><i class="fa fa-check"></i><b>11.2</b> The mode</a></li>
<li class="chapter" data-level="11.3" data-path="Chapter_11.html"><a href="Chapter_11.html#the-median-and-quantiles"><i class="fa fa-check"></i><b>11.3</b> The median and quantiles</a></li>
</ul></li>
<li class="chapter" data-level="12" data-path="Chapter_12.html"><a href="Chapter_12.html"><i class="fa fa-check"></i><b>12</b> Measures of spread</a>
<ul>
<li class="chapter" data-level="12.1" data-path="Chapter_12.html"><a href="Chapter_12.html#the-range"><i class="fa fa-check"></i><b>12.1</b> The range</a></li>
<li class="chapter" data-level="12.2" data-path="Chapter_12.html"><a href="Chapter_12.html#the-inter-quartile-range"><i class="fa fa-check"></i><b>12.2</b> The inter-quartile range</a></li>
<li class="chapter" data-level="12.3" data-path="Chapter_12.html"><a href="Chapter_12.html#the-variance"><i class="fa fa-check"></i><b>12.3</b> The variance</a></li>
<li class="chapter" data-level="12.4" data-path="Chapter_12.html"><a href="Chapter_12.html#the-standard-deviation"><i class="fa fa-check"></i><b>12.4</b> The standard deviation</a></li>
<li class="chapter" data-level="12.5" data-path="Chapter_12.html"><a href="Chapter_12.html#the-coefficient-of-variation"><i class="fa fa-check"></i><b>12.5</b> The coefficient of variation</a></li>
<li class="chapter" data-level="12.6" data-path="Chapter_12.html"><a href="Chapter_12.html#the-standard-error"><i class="fa fa-check"></i><b>12.6</b> The standard error</a></li>
</ul></li>
<li class="chapter" data-level="13" data-path="Chapter_13.html"><a href="Chapter_13.html"><i class="fa fa-check"></i><b>13</b> Skew and kurtosis</a>
<ul>
<li class="chapter" data-level="13.1" data-path="Chapter_13.html"><a href="Chapter_13.html#skew"><i class="fa fa-check"></i><b>13.1</b> Skew</a></li>
<li class="chapter" data-level="13.2" data-path="Chapter_13.html"><a href="Chapter_13.html#kurtosis"><i class="fa fa-check"></i><b>13.2</b> Kurtosis</a></li>
<li class="chapter" data-level="13.3" data-path="Chapter_13.html"><a href="Chapter_13.html#moments"><i class="fa fa-check"></i><b>13.3</b> Moments</a></li>
</ul></li>
<li class="chapter" data-level="14" data-path="Chapter_14.html"><a href="Chapter_14.html"><i class="fa fa-check"></i><b>14</b> <em>Practical</em>. Plotting and statistical summaries in jamovi</a>
<ul>
<li class="chapter" data-level="14.1" data-path="Chapter_14.html"><a href="Chapter_14.html#reorganise-the-dataset-into-a-tidy-format"><i class="fa fa-check"></i><b>14.1</b> Reorganise the dataset into a tidy format</a></li>
<li class="chapter" data-level="14.2" data-path="Chapter_14.html"><a href="Chapter_14.html#histograms-and-box-whisker-plots"><i class="fa fa-check"></i><b>14.2</b> Histograms and box-whisker plots</a></li>
<li class="chapter" data-level="14.3" data-path="Chapter_14.html"><a href="Chapter_14.html#calculate-summary-statistics"><i class="fa fa-check"></i><b>14.3</b> Calculate summary statistics</a></li>
<li class="chapter" data-level="14.4" data-path="Chapter_14.html"><a href="Chapter_14.html#reporting-decimals-and-significant-figures"><i class="fa fa-check"></i><b>14.4</b> Reporting decimals and significant figures</a></li>
<li class="chapter" data-level="14.5" data-path="Chapter_14.html"><a href="Chapter_14.html#comparing-across-sites"><i class="fa fa-check"></i><b>14.5</b> Comparing across sites</a></li>
</ul></li>
<li class="chapter" data-level="15" data-path="Chapter_15.html"><a href="Chapter_15.html"><i class="fa fa-check"></i><b>15</b> Introduction to probability models</a>
<ul>
<li class="chapter" data-level="15.1" data-path="Chapter_15.html"><a href="Chapter_15.html#instructive-example"><i class="fa fa-check"></i><b>15.1</b> Instructive example</a></li>
<li class="chapter" data-level="15.2" data-path="Chapter_15.html"><a href="Chapter_15.html#biological-applications"><i class="fa fa-check"></i><b>15.2</b> Biological applications</a></li>
<li class="chapter" data-level="15.3" data-path="Chapter_15.html"><a href="Chapter_15.html#sampling-with-and-without-replacement"><i class="fa fa-check"></i><b>15.3</b> Sampling with and without replacement</a></li>
<li class="chapter" data-level="15.4" data-path="Chapter_15.html"><a href="Chapter_15.html#probability-distributions"><i class="fa fa-check"></i><b>15.4</b> Probability distributions</a>
<ul>
<li class="chapter" data-level="15.4.1" data-path="Chapter_15.html"><a href="Chapter_15.html#binomial-distribution"><i class="fa fa-check"></i><b>15.4.1</b> Binomial distribution</a></li>
<li class="chapter" data-level="15.4.2" data-path="Chapter_15.html"><a href="Chapter_15.html#poisson-distribution"><i class="fa fa-check"></i><b>15.4.2</b> Poisson distribution</a></li>
<li class="chapter" data-level="15.4.3" data-path="Chapter_15.html"><a href="Chapter_15.html#uniform-distribution"><i class="fa fa-check"></i><b>15.4.3</b> Uniform distribution</a></li>
<li class="chapter" data-level="15.4.4" data-path="Chapter_15.html"><a href="Chapter_15.html#normal-distribution"><i class="fa fa-check"></i><b>15.4.4</b> Normal distribution</a></li>
</ul></li>
<li class="chapter" data-level="15.5" data-path="Chapter_15.html"><a href="Chapter_15.html#summary-2"><i class="fa fa-check"></i><b>15.5</b> Summary</a></li>
</ul></li>
<li class="chapter" data-level="16" data-path="Chapter_16.html"><a href="Chapter_16.html"><i class="fa fa-check"></i><b>16</b> Central Limit Theorem</a>
<ul>
<li class="chapter" data-level="16.1" data-path="Chapter_16.html"><a href="Chapter_16.html#the-distribution-of-means-is-normal"><i class="fa fa-check"></i><b>16.1</b> The distribution of means is normal</a></li>
<li class="chapter" data-level="16.2" data-path="Chapter_16.html"><a href="Chapter_16.html#probability-and-z-scores"><i class="fa fa-check"></i><b>16.2</b> Probability and z-scores</a></li>
</ul></li>
<li class="chapter" data-level="17" data-path="Chapter_17.html"><a href="Chapter_17.html"><i class="fa fa-check"></i><b>17</b> <em>Practical</em>. Probability and simulation</a>
<ul>
<li class="chapter" data-level="17.1" data-path="Chapter_17.html"><a href="Chapter_17.html#probabilities-from-a-dataset"><i class="fa fa-check"></i><b>17.1</b> Probabilities from a dataset</a></li>
<li class="chapter" data-level="17.2" data-path="Chapter_17.html"><a href="Chapter_17.html#probabilities-from-a-normal-distribution"><i class="fa fa-check"></i><b>17.2</b> Probabilities from a normal distribution</a></li>
<li class="chapter" data-level="17.3" data-path="Chapter_17.html"><a href="Chapter_17.html#central-limit-theorem"><i class="fa fa-check"></i><b>17.3</b> Central limit theorem</a></li>
</ul></li>
<li class="chapter" data-level="18" data-path="Chapter_18.html"><a href="Chapter_18.html"><i class="fa fa-check"></i><b>18</b> Confidence intervals</a>
<ul>
<li class="chapter" data-level="18.1" data-path="Chapter_18.html"><a href="Chapter_18.html#normal-distribution-cis"><i class="fa fa-check"></i><b>18.1</b> Normal distribution CIs</a></li>
<li class="chapter" data-level="18.2" data-path="Chapter_18.html"><a href="Chapter_18.html#binomial-distribution-cis"><i class="fa fa-check"></i><b>18.2</b> Binomial distribution CIs</a></li>
</ul></li>
<li class="chapter" data-level="19" data-path="Chapter_19.html"><a href="Chapter_19.html"><i class="fa fa-check"></i><b>19</b> The t-interval</a></li>
<li class="chapter" data-level="20" data-path="Chapter_20.html"><a href="Chapter_20.html"><i class="fa fa-check"></i><b>20</b> <em>Practical</em>. z- and t-intervals</a>
<ul>
<li class="chapter" data-level="20.1" data-path="Chapter_20.html"><a href="Chapter_20.html#confidence-intervals-with-distraction"><i class="fa fa-check"></i><b>20.1</b> Confidence intervals with distrACTION</a></li>
<li class="chapter" data-level="20.2" data-path="Chapter_20.html"><a href="Chapter_20.html#confidence-intervals-from-z--and-t-scores"><i class="fa fa-check"></i><b>20.2</b> Confidence intervals from z- and t-scores</a></li>
<li class="chapter" data-level="20.3" data-path="Chapter_20.html"><a href="Chapter_20.html#confidence-intervals-for-different-sample-sizes"><i class="fa fa-check"></i><b>20.3</b> Confidence intervals for different sample sizes</a></li>
<li class="chapter" data-level="20.4" data-path="Chapter_20.html"><a href="Chapter_20.html#proportion-confidence-intervals"><i class="fa fa-check"></i><b>20.4</b> Proportion confidence intervals</a></li>
<li class="chapter" data-level="20.5" data-path="Chapter_20.html"><a href="Chapter_20.html#another-proportion-confidence-interval"><i class="fa fa-check"></i><b>20.5</b> Another proportion confidence interval</a></li>
</ul></li>
<li class="chapter" data-level="21" data-path="Chapter_21.html"><a href="Chapter_21.html"><i class="fa fa-check"></i><b>21</b> What is hypothesis testing?</a>
<ul>
<li class="chapter" data-level="21.1" data-path="Chapter_21.html"><a href="Chapter_21.html#how-ridiculous-is-our-hypothesis"><i class="fa fa-check"></i><b>21.1</b> How ridiculous is our hypothesis?</a></li>
<li class="chapter" data-level="21.2" data-path="Chapter_21.html"><a href="Chapter_21.html#statistical-hypothesis-testing"><i class="fa fa-check"></i><b>21.2</b> Statistical hypothesis testing</a></li>
<li class="chapter" data-level="21.3" data-path="Chapter_21.html"><a href="Chapter_21.html#p-values-false-positives-and-power"><i class="fa fa-check"></i><b>21.3</b> P-values, false positives, and power</a></li>
</ul></li>
<li class="chapter" data-level="22" data-path="Chapter_22.html"><a href="Chapter_22.html"><i class="fa fa-check"></i><b>22</b> The t-test</a>
<ul>
<li class="chapter" data-level="22.1" data-path="Chapter_22.html"><a href="Chapter_22.html#one-sample-t-test"><i class="fa fa-check"></i><b>22.1</b> One sample t-test</a></li>
<li class="chapter" data-level="22.2" data-path="Chapter_22.html"><a href="Chapter_22.html#independent-samples-t-test"><i class="fa fa-check"></i><b>22.2</b> Independent samples t-test</a></li>
<li class="chapter" data-level="22.3" data-path="Chapter_22.html"><a href="Chapter_22.html#paired-samples-t-test"><i class="fa fa-check"></i><b>22.3</b> Paired samples t-test</a></li>
<li class="chapter" data-level="22.4" data-path="Chapter_22.html"><a href="Chapter_22.html#assumptions-of-t-tests"><i class="fa fa-check"></i><b>22.4</b> Assumptions of t-tests</a></li>
<li class="chapter" data-level="22.5" data-path="Chapter_22.html"><a href="Chapter_22.html#non-parametric-alternatives"><i class="fa fa-check"></i><b>22.5</b> Non-parametric alternatives</a>
<ul>
<li class="chapter" data-level="22.5.1" data-path="Chapter_22.html"><a href="Chapter_22.html#wilcoxon-test"><i class="fa fa-check"></i><b>22.5.1</b> Wilcoxon test</a></li>
<li class="chapter" data-level="22.5.2" data-path="Chapter_22.html"><a href="Chapter_22.html#mann-whitney-u-test"><i class="fa fa-check"></i><b>22.5.2</b> Mann-Whitney U test</a></li>
</ul></li>
<li class="chapter" data-level="22.6" data-path="Chapter_22.html"><a href="Chapter_22.html#summary-3"><i class="fa fa-check"></i><b>22.6</b> Summary</a></li>
</ul></li>
<li class="chapter" data-level="23" data-path="Chapter_23.html"><a href="Chapter_23.html"><i class="fa fa-check"></i><b>23</b> <em>Practical</em>. Hypothesis testing and t-tests</a>
<ul>
<li class="chapter" data-level="23.1" data-path="Chapter_23.html"><a href="Chapter_23.html#one-sample-t-test-1"><i class="fa fa-check"></i><b>23.1</b> One sample t-test</a></li>
<li class="chapter" data-level="23.2" data-path="Chapter_23.html"><a href="Chapter_23.html#paired-t-test"><i class="fa fa-check"></i><b>23.2</b> Paired t-test</a></li>
<li class="chapter" data-level="23.3" data-path="Chapter_23.html"><a href="Chapter_23.html#wilcoxon-test-1"><i class="fa fa-check"></i><b>23.3</b> Wilcoxon test</a></li>
<li class="chapter" data-level="23.4" data-path="Chapter_23.html"><a href="Chapter_23.html#independent-samples-t-test-1"><i class="fa fa-check"></i><b>23.4</b> Independent samples t-test</a></li>
<li class="chapter" data-level="23.5" data-path="Chapter_23.html"><a href="Chapter_23.html#mann-whitney-u-test-1"><i class="fa fa-check"></i><b>23.5</b> Mann-Whitney U Test</a></li>
</ul></li>
<li class="chapter" data-level="24" data-path="Chapter_24.html"><a href="Chapter_24.html"><i class="fa fa-check"></i><b>24</b> Analysis of variance</a>
<ul>
<li class="chapter" data-level="24.1" data-path="Chapter_24.html"><a href="Chapter_24.html#f-distribution"><i class="fa fa-check"></i><b>24.1</b> F-distribution</a></li>
<li class="chapter" data-level="24.2" data-path="Chapter_24.html"><a href="Chapter_24.html#one-way-anova"><i class="fa fa-check"></i><b>24.2</b> One-way ANOVA</a>
<ul>
<li class="chapter" data-level="24.2.1" data-path="Chapter_24.html"><a href="Chapter_24.html#anova-mean-variance-among-groups"><i class="fa fa-check"></i><b>24.2.1</b> ANOVA mean variance among groups</a></li>
<li class="chapter" data-level="24.2.2" data-path="Chapter_24.html"><a href="Chapter_24.html#anova-mean-variance-within-groups"><i class="fa fa-check"></i><b>24.2.2</b> ANOVA mean variance within groups</a></li>
<li class="chapter" data-level="24.2.3" data-path="Chapter_24.html"><a href="Chapter_24.html#anova-f-statistic-calculation"><i class="fa fa-check"></i><b>24.2.3</b> ANOVA F-statistic calculation</a></li>
</ul></li>
<li class="chapter" data-level="24.3" data-path="Chapter_24.html"><a href="Chapter_24.html#assumptions-of-anova"><i class="fa fa-check"></i><b>24.3</b> Assumptions of ANOVA</a></li>
</ul></li>
<li class="chapter" data-level="25" data-path="Chapter_25.html"><a href="Chapter_25.html"><i class="fa fa-check"></i><b>25</b> Multiple comparisons</a></li>
<li class="chapter" data-level="26" data-path="Chapter_26.html"><a href="Chapter_26.html"><i class="fa fa-check"></i><b>26</b> Kruskal-Wallis H test</a></li>
<li class="chapter" data-level="27" data-path="Chapter_27.html"><a href="Chapter_27.html"><i class="fa fa-check"></i><b>27</b> Two-way ANOVA</a></li>
<li class="chapter" data-level="28" data-path="Chapter_28.html"><a href="Chapter_28.html"><i class="fa fa-check"></i><b>28</b> <em>Practical</em>. ANOVA and associated tests</a>
<ul>
<li class="chapter" data-level="28.1" data-path="Chapter_28.html"><a href="Chapter_28.html#one-way-anova-site"><i class="fa fa-check"></i><b>28.1</b> One-way ANOVA (site)</a></li>
<li class="chapter" data-level="28.2" data-path="Chapter_28.html"><a href="Chapter_28.html#one-way-anova-profile"><i class="fa fa-check"></i><b>28.2</b> One-way ANOVA (profile)</a></li>
<li class="chapter" data-level="28.3" data-path="Chapter_28.html"><a href="Chapter_28.html#multiple-comparisons"><i class="fa fa-check"></i><b>28.3</b> Multiple comparisons</a></li>
<li class="chapter" data-level="28.4" data-path="Chapter_28.html"><a href="Chapter_28.html#kruskal-wallis-h-test"><i class="fa fa-check"></i><b>28.4</b> Kruskal-Wallis H test</a></li>
<li class="chapter" data-level="28.5" data-path="Chapter_28.html"><a href="Chapter_28.html#two-way-anova"><i class="fa fa-check"></i><b>28.5</b> Two-way ANOVA</a></li>
</ul></li>
<li class="chapter" data-level="29" data-path="Chapter_29.html"><a href="Chapter_29.html"><i class="fa fa-check"></i><b>29</b> Frequency and count data</a>
<ul>
<li class="chapter" data-level="29.1" data-path="Chapter_29.html"><a href="Chapter_29.html#chi-square-distribution"><i class="fa fa-check"></i><b>29.1</b> Chi-square distribution</a></li>
<li class="chapter" data-level="29.2" data-path="Chapter_29.html"><a href="Chapter_29.html#chi-square-goodness-of-fit"><i class="fa fa-check"></i><b>29.2</b> Chi-square goodness of fit</a></li>
<li class="chapter" data-level="29.3" data-path="Chapter_29.html"><a href="Chapter_29.html#chi-square-test-of-association"><i class="fa fa-check"></i><b>29.3</b> Chi-square test of association</a></li>
</ul></li>
<li class="chapter" data-level="30" data-path="Chapter_30.html"><a href="Chapter_30.html"><i class="fa fa-check"></i><b>30</b> Correlation</a>
<ul>
<li class="chapter" data-level="30.1" data-path="Chapter_30.html"><a href="Chapter_30.html#scatterplots"><i class="fa fa-check"></i><b>30.1</b> Scatterplots</a></li>
<li class="chapter" data-level="30.2" data-path="Chapter_30.html"><a href="Chapter_30.html#correlation-coefficient"><i class="fa fa-check"></i><b>30.2</b> Correlation coefficient</a>
<ul>
<li class="chapter" data-level="30.2.1" data-path="Chapter_30.html"><a href="Chapter_30.html#pearson-product-moment-correlation-coefficient"><i class="fa fa-check"></i><b>30.2.1</b> Pearson product moment correlation coefficient</a></li>
<li class="chapter" data-level="30.2.2" data-path="Chapter_30.html"><a href="Chapter_30.html#spearmans-rank-correlation-coefficient"><i class="fa fa-check"></i><b>30.2.2</b> Spearman’s rank correlation coefficient</a></li>
</ul></li>
<li class="chapter" data-level="30.3" data-path="Chapter_30.html"><a href="Chapter_30.html#correlation-hypothesis-testing"><i class="fa fa-check"></i><b>30.3</b> Correlation hypothesis testing</a></li>
</ul></li>
<li class="chapter" data-level="31" data-path="Chapter_31.html"><a href="Chapter_31.html"><i class="fa fa-check"></i><b>31</b> <em>Practical</em>. Analysis of counts and correlations</a>
<ul>
<li class="chapter" data-level="31.1" data-path="Chapter_31.html"><a href="Chapter_31.html#survival-goodness-of-fit"><i class="fa fa-check"></i><b>31.1</b> Survival goodness of fit</a></li>
<li class="chapter" data-level="31.2" data-path="Chapter_31.html"><a href="Chapter_31.html#colony-goodness-of-fit"><i class="fa fa-check"></i><b>31.2</b> Colony goodness of fit</a></li>
<li class="chapter" data-level="31.3" data-path="Chapter_31.html"><a href="Chapter_31.html#chi-square-test-of-association-1"><i class="fa fa-check"></i><b>31.3</b> Chi-Square test of association</a></li>
<li class="chapter" data-level="31.4" data-path="Chapter_31.html"><a href="Chapter_31.html#pearson-product-moment-correlation-test"><i class="fa fa-check"></i><b>31.4</b> Pearson product moment correlation test</a></li>
<li class="chapter" data-level="31.5" data-path="Chapter_31.html"><a href="Chapter_31.html#spearmans-rank-correlation-test"><i class="fa fa-check"></i><b>31.5</b> Spearman’s rank correlation test</a></li>
<li class="chapter" data-level="31.6" data-path="Chapter_31.html"><a href="Chapter_31.html#untidy-goodness-of-fit"><i class="fa fa-check"></i><b>31.6</b> Untidy goodness of fit</a></li>
</ul></li>
<li class="chapter" data-level="32" data-path="Chapter_32.html"><a href="Chapter_32.html"><i class="fa fa-check"></i><b>32</b> Simple linear regression</a>
<ul>
<li class="chapter" data-level="32.1" data-path="Chapter_32.html"><a href="Chapter_32.html#visual-interpretation-of-regression"><i class="fa fa-check"></i><b>32.1</b> Visual interpretation of regression</a></li>
<li class="chapter" data-level="32.2" data-path="Chapter_32.html"><a href="Chapter_32.html#intercepts-slopes-and-residuals"><i class="fa fa-check"></i><b>32.2</b> Intercepts, slopes, and residuals</a></li>
<li class="chapter" data-level="32.3" data-path="Chapter_32.html"><a href="Chapter_32.html#regression-coefficients"><i class="fa fa-check"></i><b>32.3</b> Regression coefficients</a></li>
<li class="chapter" data-level="32.4" data-path="Chapter_32.html"><a href="Chapter_32.html#regression-line-calculation"><i class="fa fa-check"></i><b>32.4</b> Regression line calculation</a></li>
<li class="chapter" data-level="32.5" data-path="Chapter_32.html"><a href="Chapter_32.html#coefficient-of-determination"><i class="fa fa-check"></i><b>32.5</b> Coefficient of determination</a></li>
<li class="chapter" data-level="32.6" data-path="Chapter_32.html"><a href="Chapter_32.html#regression-assumptions"><i class="fa fa-check"></i><b>32.6</b> Regression assumptions</a></li>
<li class="chapter" data-level="32.7" data-path="Chapter_32.html"><a href="Chapter_32.html#regression-hypothesis-testing"><i class="fa fa-check"></i><b>32.7</b> Regression hypothesis testing</a>
<ul>
<li class="chapter" data-level="32.7.1" data-path="Chapter_32.html"><a href="Chapter_32.html#overall-model-significance"><i class="fa fa-check"></i><b>32.7.1</b> Overall model significance</a></li>
<li class="chapter" data-level="32.7.2" data-path="Chapter_32.html"><a href="Chapter_32.html#significance-of-the-intercept"><i class="fa fa-check"></i><b>32.7.2</b> Significance of the intercept</a></li>
<li class="chapter" data-level="32.7.3" data-path="Chapter_32.html"><a href="Chapter_32.html#significance-of-the-slope"><i class="fa fa-check"></i><b>32.7.3</b> Significance of the slope</a></li>
<li class="chapter" data-level="32.7.4" data-path="Chapter_32.html"><a href="Chapter_32.html#simple-regression-output"><i class="fa fa-check"></i><b>32.7.4</b> Simple regression output</a></li>
</ul></li>
<li class="chapter" data-level="32.8" data-path="Chapter_32.html"><a href="Chapter_32.html#prediction-with-linear-models"><i class="fa fa-check"></i><b>32.8</b> Prediction with linear models</a></li>
<li class="chapter" data-level="32.9" data-path="Chapter_32.html"><a href="Chapter_32.html#conclusion"><i class="fa fa-check"></i><b>32.9</b> Conclusion</a></li>
</ul></li>
<li class="chapter" data-level="33" data-path="Chapter_33.html"><a href="Chapter_33.html"><i class="fa fa-check"></i><b>33</b> Multiple regression</a>
<ul>
<li class="chapter" data-level="33.1" data-path="Chapter_33.html"><a href="Chapter_33.html#adjusted-coefficient-of-determination"><i class="fa fa-check"></i><b>33.1</b> Adjusted coefficient of determination</a></li>
</ul></li>
<li class="chapter" data-level="34" data-path="Chapter_34.html"><a href="Chapter_34.html"><i class="fa fa-check"></i><b>34</b> <em>Practical</em>. Using regression</a>
<ul>
<li class="chapter" data-level="34.1" data-path="Chapter_34.html"><a href="Chapter_34.html#predicting-pyrogenic-carbon-from-soil-depth"><i class="fa fa-check"></i><b>34.1</b> Predicting pyrogenic carbon from soil depth</a></li>
<li class="chapter" data-level="34.2" data-path="Chapter_34.html"><a href="Chapter_34.html#predicting-pyrogenic-carbon-from-fire-frequency"><i class="fa fa-check"></i><b>34.2</b> Predicting pyrogenic carbon from fire frequency</a></li>
<li class="chapter" data-level="34.3" data-path="Chapter_34.html"><a href="Chapter_34.html#multiple-regression-depth-and-fire-frequency"><i class="fa fa-check"></i><b>34.3</b> Multiple regression depth and fire frequency</a></li>
<li class="chapter" data-level="34.4" data-path="Chapter_34.html"><a href="Chapter_34.html#large-multiple-regression"><i class="fa fa-check"></i><b>34.4</b> Large multiple regression</a></li>
<li class="chapter" data-level="34.5" data-path="Chapter_34.html"><a href="Chapter_34.html#predicting-temperature-from-fire-frequency"><i class="fa fa-check"></i><b>34.5</b> Predicting temperature from fire frequency</a></li>
</ul></li>
<li class="chapter" data-level="35" data-path="Chapter_35.html"><a href="Chapter_35.html"><i class="fa fa-check"></i><b>35</b> Randomisation</a>
<ul>
<li class="chapter" data-level="35.1" data-path="Chapter_35.html"><a href="Chapter_35.html#summary-of-parametric-hypothesis-testing"><i class="fa fa-check"></i><b>35.1</b> Summary of parametric hypothesis testing</a></li>
<li class="chapter" data-level="35.2" data-path="Chapter_35.html"><a href="Chapter_35.html#randomisation-approach"><i class="fa fa-check"></i><b>35.2</b> Randomisation approach</a></li>
<li class="chapter" data-level="35.3" data-path="Chapter_35.html"><a href="Chapter_35.html#randomisation-for-hypothesis-testing"><i class="fa fa-check"></i><b>35.3</b> Randomisation for hypothesis testing</a></li>
<li class="chapter" data-level="35.4" data-path="Chapter_35.html"><a href="Chapter_35.html#randomisation-assumptions"><i class="fa fa-check"></i><b>35.4</b> Randomisation assumptions</a></li>
<li class="chapter" data-level="35.5" data-path="Chapter_35.html"><a href="Chapter_35.html#bootstrapping"><i class="fa fa-check"></i><b>35.5</b> Bootstrapping</a></li>
<li class="chapter" data-level="35.6" data-path="Chapter_35.html"><a href="Chapter_35.html#randomisation-conclusions"><i class="fa fa-check"></i><b>35.6</b> Randomisation conclusions</a></li>
</ul></li>
<li class="appendix"><span><b>Appendix</b></span></li>
<li class="chapter" data-level="A" data-path="appendexA.html"><a href="appendexA.html"><i class="fa fa-check"></i><b>A</b> Answers to chapter exercises</a>
<ul>
<li class="chapter" data-level="A.1" data-path="appendexA.html"><a href="appendexA.html#chapter-3"><i class="fa fa-check"></i><b>A.1</b> Chapter 3</a>
<ul>
<li class="chapter" data-level="A.1.1" data-path="appendexA.html"><a href="appendexA.html#exercise-3.1"><i class="fa fa-check"></i><b>A.1.1</b> Exercise 3.1:</a></li>
<li class="chapter" data-level="A.1.2" data-path="appendexA.html"><a href="appendexA.html#exercise-3.2"><i class="fa fa-check"></i><b>A.1.2</b> Exercise 3.2</a></li>
<li class="chapter" data-level="A.1.3" data-path="appendexA.html"><a href="appendexA.html#exercise-3.3"><i class="fa fa-check"></i><b>A.1.3</b> Exercise 3.3</a></li>
<li class="chapter" data-level="A.1.4" data-path="appendexA.html"><a href="appendexA.html#exercise-3.4"><i class="fa fa-check"></i><b>A.1.4</b> Exercise 3.4</a></li>
</ul></li>
<li class="chapter" data-level="A.2" data-path="appendexA.html"><a href="appendexA.html#chapter-8"><i class="fa fa-check"></i><b>A.2</b> Chapter 8</a>
<ul>
<li class="chapter" data-level="A.2.1" data-path="appendexA.html"><a href="appendexA.html#exercise-8.1"><i class="fa fa-check"></i><b>A.2.1</b> Exercise 8.1</a></li>
<li class="chapter" data-level="A.2.2" data-path="appendexA.html"><a href="appendexA.html#exercise-8.2"><i class="fa fa-check"></i><b>A.2.2</b> Exercise 8.2</a></li>
<li class="chapter" data-level="A.2.3" data-path="appendexA.html"><a href="appendexA.html#exercise-8.3"><i class="fa fa-check"></i><b>A.2.3</b> Exercise 8.3</a></li>
</ul></li>
<li class="chapter" data-level="A.3" data-path="appendexA.html"><a href="appendexA.html#chapter-14"><i class="fa fa-check"></i><b>A.3</b> Chapter 14</a>
<ul>
<li class="chapter" data-level="A.3.1" data-path="appendexA.html"><a href="appendexA.html#exercise-14.1"><i class="fa fa-check"></i><b>A.3.1</b> Exercise 14.1</a></li>
<li class="chapter" data-level="A.3.2" data-path="appendexA.html"><a href="appendexA.html#exercise-14.2"><i class="fa fa-check"></i><b>A.3.2</b> Exercise 14.2</a></li>
<li class="chapter" data-level="A.3.3" data-path="appendexA.html"><a href="appendexA.html#exercise-14.3"><i class="fa fa-check"></i><b>A.3.3</b> Exercise 14.3</a></li>
<li class="chapter" data-level="A.3.4" data-path="appendexA.html"><a href="appendexA.html#exercise-14.4"><i class="fa fa-check"></i><b>A.3.4</b> Exercise 14.4</a></li>
<li class="chapter" data-level="A.3.5" data-path="appendexA.html"><a href="appendexA.html#exercise-14.5"><i class="fa fa-check"></i><b>A.3.5</b> Exercise 14.5</a></li>
</ul></li>
<li class="chapter" data-level="A.4" data-path="appendexA.html"><a href="appendexA.html#chapter-17"><i class="fa fa-check"></i><b>A.4</b> Chapter 17</a>
<ul>
<li class="chapter" data-level="A.4.1" data-path="appendexA.html"><a href="appendexA.html#exercise-17.1"><i class="fa fa-check"></i><b>A.4.1</b> Exercise 17.1</a></li>
<li class="chapter" data-level="A.4.2" data-path="appendexA.html"><a href="appendexA.html#exercise-17.2"><i class="fa fa-check"></i><b>A.4.2</b> Exercise 17.2</a></li>
<li class="chapter" data-level="A.4.3" data-path="appendexA.html"><a href="appendexA.html#exercise-17.3"><i class="fa fa-check"></i><b>A.4.3</b> Exercise 17.3</a></li>
</ul></li>
<li class="chapter" data-level="A.5" data-path="appendexA.html"><a href="appendexA.html#chapter-20"><i class="fa fa-check"></i><b>A.5</b> Chapter 20</a>
<ul>
<li class="chapter" data-level="A.5.1" data-path="appendexA.html"><a href="appendexA.html#exercise-20.1"><i class="fa fa-check"></i><b>A.5.1</b> Exercise 20.1</a></li>
<li class="chapter" data-level="A.5.2" data-path="appendexA.html"><a href="appendexA.html#exercise-20.2"><i class="fa fa-check"></i><b>A.5.2</b> Exercise 20.2</a></li>
<li class="chapter" data-level="A.5.3" data-path="appendexA.html"><a href="appendexA.html#exercise-20.3"><i class="fa fa-check"></i><b>A.5.3</b> Exercise 20.3</a></li>
<li class="chapter" data-level="A.5.4" data-path="appendexA.html"><a href="appendexA.html#exercise-20.4"><i class="fa fa-check"></i><b>A.5.4</b> Exercise 20.4</a></li>
<li class="chapter" data-level="A.5.5" data-path="appendexA.html"><a href="appendexA.html#exercise-20.5"><i class="fa fa-check"></i><b>A.5.5</b> Exercise 20.5</a></li>
</ul></li>
<li class="chapter" data-level="A.6" data-path="appendexA.html"><a href="appendexA.html#chapter-23"><i class="fa fa-check"></i><b>A.6</b> Chapter 23</a>
<ul>
<li class="chapter" data-level="A.6.1" data-path="appendexA.html"><a href="appendexA.html#exercise-23.1"><i class="fa fa-check"></i><b>A.6.1</b> Exercise 23.1</a></li>
<li class="chapter" data-level="A.6.2" data-path="appendexA.html"><a href="appendexA.html#exercise-23.2"><i class="fa fa-check"></i><b>A.6.2</b> Exercise 23.2</a></li>
<li class="chapter" data-level="A.6.3" data-path="appendexA.html"><a href="appendexA.html#exercise-23.3"><i class="fa fa-check"></i><b>A.6.3</b> Exercise 23.3</a></li>
<li class="chapter" data-level="A.6.4" data-path="appendexA.html"><a href="appendexA.html#exercise-23.4"><i class="fa fa-check"></i><b>A.6.4</b> Exercise 23.4</a></li>
<li class="chapter" data-level="A.6.5" data-path="appendexA.html"><a href="appendexA.html#exercise-23.5"><i class="fa fa-check"></i><b>A.6.5</b> Exercise 23.5</a></li>
</ul></li>
<li class="chapter" data-level="A.7" data-path="appendexA.html"><a href="appendexA.html#chapter-28"><i class="fa fa-check"></i><b>A.7</b> Chapter 28</a>
<ul>
<li class="chapter" data-level="A.7.1" data-path="appendexA.html"><a href="appendexA.html#exercise-28.1"><i class="fa fa-check"></i><b>A.7.1</b> Exercise 28.1</a></li>
<li class="chapter" data-level="A.7.2" data-path="appendexA.html"><a href="appendexA.html#exercise-28.2"><i class="fa fa-check"></i><b>A.7.2</b> Exercise 28.2</a></li>
<li class="chapter" data-level="A.7.3" data-path="appendexA.html"><a href="appendexA.html#exercise-28.3"><i class="fa fa-check"></i><b>A.7.3</b> Exercise 28.3</a></li>
<li class="chapter" data-level="A.7.4" data-path="appendexA.html"><a href="appendexA.html#exercise-28.4"><i class="fa fa-check"></i><b>A.7.4</b> Exercise 28.4</a></li>
</ul></li>
<li class="chapter" data-level="A.8" data-path="appendexA.html"><a href="appendexA.html#chapter-31"><i class="fa fa-check"></i><b>A.8</b> Chapter 31</a>
<ul>
<li class="chapter" data-level="A.8.1" data-path="appendexA.html"><a href="appendexA.html#exercise-31.1"><i class="fa fa-check"></i><b>A.8.1</b> Exercise 31.1</a></li>
<li class="chapter" data-level="A.8.2" data-path="appendexA.html"><a href="appendexA.html#exercise-31.2"><i class="fa fa-check"></i><b>A.8.2</b> Exercise 31.2</a></li>
<li class="chapter" data-level="A.8.3" data-path="appendexA.html"><a href="appendexA.html#exercise-31.3"><i class="fa fa-check"></i><b>A.8.3</b> Exercise 31.3</a></li>
<li class="chapter" data-level="A.8.4" data-path="appendexA.html"><a href="appendexA.html#exercise-31.4"><i class="fa fa-check"></i><b>A.8.4</b> Exercise 31.4</a></li>
<li class="chapter" data-level="A.8.5" data-path="appendexA.html"><a href="appendexA.html#exercise-31.5"><i class="fa fa-check"></i><b>A.8.5</b> Exercise 31.5</a></li>
</ul></li>
<li class="chapter" data-level="A.9" data-path="appendexA.html"><a href="appendexA.html#chapter-34"><i class="fa fa-check"></i><b>A.9</b> Chapter 34</a>
<ul>
<li class="chapter" data-level="A.9.1" data-path="appendexA.html"><a href="appendexA.html#exercise-34.1"><i class="fa fa-check"></i><b>A.9.1</b> Exercise 34.1</a></li>
<li class="chapter" data-level="A.9.2" data-path="appendexA.html"><a href="appendexA.html#exercise-34.2"><i class="fa fa-check"></i><b>A.9.2</b> Exercise 34.2</a></li>
<li class="chapter" data-level="A.9.3" data-path="appendexA.html"><a href="appendexA.html#exercise-34.3"><i class="fa fa-check"></i><b>A.9.3</b> Exercise 34.3</a></li>
<li class="chapter" data-level="A.9.4" data-path="appendexA.html"><a href="appendexA.html#exercise-34.4"><i class="fa fa-check"></i><b>A.9.4</b> Exercise 34.4</a></li>
<li class="chapter" data-level="A.9.5" data-path="appendexA.html"><a href="appendexA.html#exercise-33.5"><i class="fa fa-check"></i><b>A.9.5</b> Exercise 33.5</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="B" data-path="uncertainty_derivation.html"><a href="uncertainty_derivation.html"><i class="fa fa-check"></i><b>B</b> Uncertainty derivation</a>
<ul>
<li class="chapter" data-level="B.1" data-path="uncertainty_derivation.html"><a href="uncertainty_derivation.html#propagation-of-error-for-addition-and-subtraction"><i class="fa fa-check"></i><b>B.1</b> Propagation of error for addition and subtraction</a></li>
<li class="chapter" data-level="B.2" data-path="uncertainty_derivation.html"><a href="uncertainty_derivation.html#propagation-of-error-for-multiplication-and-division"><i class="fa fa-check"></i><b>B.2</b> Propagation of error for multiplication and division</a></li>
</ul></li>
<li class="chapter" data-level="" data-path="references.html"><a href="references.html"><i class="fa fa-check"></i>References</a></li>
<li class="divider"></li>
<li><a href="https://github.com/rstudio/bookdown" target="blank">Published with bookdown</a></li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i><a href="./">Fundamental statistical concepts and techniques in the biological and environmental sciences: With jamovi</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<section class="normal" id="section-">
<div id="Chapter_24" class="section level1 hasAnchor" number="24">
<h1><span class="header-section-number">Chapter 24</span> Analysis of variance<a href="Chapter_24.html#Chapter_24" class="anchor-section" aria-label="Anchor link to header"></a></h1>
<p>An ANalysis Of VAriance (ANOVA) is, as the name implies, a method for analysing variances in a dataset.
This is confusing, at first, because the most common application of an ANOVA is to test for differences among group <em>means</em>.
That is, an ANOVA can be used to test the same null hypothesis as the independent samples Student’s t-test introduced in <a href="Chapter_22.html#independent-samples-t-test">Section 22.2</a>; are two groups sampled from a population that has the same mean?
The t-test works fine when we have only two groups, but it does not work when there are three or more groups, and we want to know if the groups all have the same mean.
An ANOVA can be used to test the null hypothesis that <em>all</em> groups in a dataset are sampled from a population with the same mean.
For example, we might want to know if mean wing length is the same for five species of fig wasps sampled from the same area <span class="citation">(<a href="#ref-Duthie2015b" role="doc-biblioref">Duthie et al., 2015</a>)</span>.
What follows is an explanation of why this can be done by looking at the variance within and between groups (note, ‘groups’ are also sometimes called ‘factors’ or ‘levels’).
Groups are categorical data (see <a href="Chapter_5.html#Chapter_5">Chapter 5</a>).
In the case of the fig wasp example, the groups are the different species (Table 24.1).</p>
<table style="width:56%;">
<caption><strong>TABLE 24.1</strong> Wing lengths (mm) measured for five unnamed species of non-pollinating fig wasps collected from fig trees in 2010 near La Paz in Baja, Mexico.</caption>
<colgroup>
<col width="11%" />
<col width="11%" />
<col width="11%" />
<col width="11%" />
<col width="11%" />
</colgroup>
<thead>
<tr class="header">
<th align="center">Het1</th>
<th align="center">Het2</th>
<th align="center">LO1</th>
<th align="center">SO1</th>
<th align="center">SO2</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center">2.122</td>
<td align="center">1.810</td>
<td align="center">1.869</td>
<td align="center">1.557</td>
<td align="center">1.635</td>
</tr>
<tr class="even">
<td align="center">1.938</td>
<td align="center">1.821</td>
<td align="center">1.957</td>
<td align="center">1.493</td>
<td align="center">1.700</td>
</tr>
<tr class="odd">
<td align="center">1.765</td>
<td align="center">1.653</td>
<td align="center">1.589</td>
<td align="center">1.470</td>
<td align="center">1.407</td>
</tr>
<tr class="even">
<td align="center">1.700</td>
<td align="center">1.547</td>
<td align="center">1.430</td>
<td align="center">1.541</td>
<td align="center">1.378</td>
</tr>
</tbody>
</table>
<p>Why is any of this necessary?
If we want to know if the five species of fig wasps in Table 24.1 have the same mean wing length, can we not just use t-tests to compare the means between each species?
There are a couple of problems with this approach.
First, there are a lot of group combinations to compare (Het1 vs Het2, Het1 vs LO1, Het1 vs SO1, etc.).
For the five fig wasp species in Table 24.1, there are 10 pair-wise combinations that would need to be tested.
And the number of combinations grows exponentially<a href="#fn54" class="footnote-ref" id="fnref54"><sup>54</sup></a> with each new group added to the dataset (Table 24.2).</p>
<table style="width:76%;">
<caption><strong>TABLE 24.2</strong> Number of individual t-tests that would need to be run to compare the means given different numbers of groups (e.g., if a dataset had measurements from 2–10 species).</caption>
<colgroup>
<col width="18%" />
<col width="5%" />
<col width="5%" />
<col width="5%" />
<col width="6%" />
<col width="6%" />
<col width="6%" />
<col width="6%" />
<col width="6%" />
<col width="6%" />
</colgroup>
<tbody>
<tr class="odd">
<td align="center"><strong>Groups</strong></td>
<td align="center">2</td>
<td align="center">3</td>
<td align="center">4</td>
<td align="center">5</td>
<td align="center">6</td>
<td align="center">7</td>
<td align="center">8</td>
<td align="center">9</td>
<td align="center">10</td>
</tr>
<tr class="even">
<td align="center"><strong>Tests</strong></td>
<td align="center">1</td>
<td align="center">3</td>
<td align="center">6</td>
<td align="center">10</td>
<td align="center">15</td>
<td align="center">21</td>
<td align="center">28</td>
<td align="center">36</td>
<td align="center">45</td>
</tr>
</tbody>
</table>
<p>Aside from the tedium of testing every possible combination of group means, there is a more serious problem having to do with the Type I error.
Recall from <a href="Chapter_21.html#p-values-false-positives-and-power">Section 21.3</a> that a Type I error occurs when we rejected the null hypothesis (<span class="math inline">\(H_{0}\)</span>) and erroneously conclude that <span class="math inline">\(H_{0}\)</span> is false when it is actually true (i.e., a false positive).
If we reject <span class="math inline">\(H_{0}\)</span> at a threshold level of <span class="math inline">\(\alpha = 0.05\)</span> (i.e., reject <span class="math inline">\(H_{0}\)</span> when <span class="math inline">\(P < 0.05\)</span>, as usual), then we will erroneously reject the null hypothesis about 5% of the time that we run a statistical test and <span class="math inline">\(H_{0}\)</span> is true.
But if we run 10 separate t-tests to see if the fig wasp species in Table 24.1 have different mean wing lengths, then the probability of making an error increases considerably.
The probability of erroneously rejecting <strong>at least 1</strong> of the 10 null hypotheses increases from 0.05 to about 0.40.
In other words, about 40% of the time, we would conclude that at least two species differ in their mean wing lengths<a href="#fn55" class="footnote-ref" id="fnref55"><sup>55</sup></a> even when all species <em>really do</em> have the same wing length.
This is not a mistake that we want to make, which is why we should first test if all of the means are equal:</p>
<ul>
<li><span class="math inline">\(H_{0}:\)</span> Mean species wing lengths are all the same</li>
<li><span class="math inline">\(H_{A}:\)</span> Mean species wing lengths are not all the same</li>
</ul>
<p>We can use an ANOVA to test the null hypothesis above against the alternative hypothesis.
If we reject <span class="math inline">\(H_{0}\)</span>, then we can start comparing pairs of group means (more on this in <a href="Chapter_26.html#Chapter_26">Chapter 26</a>).</p>
<p>How do we test the above <span class="math inline">\(H_{0}\)</span> by looking at <em>variances</em> instead of <em>means</em>?
Before getting into the details of how an ANOVA works, we will first look at the F-distribution.
This is relevant because the test statistic calculated in an ANOVA is called an F-statistic, which is compared to an F-distribution in the same way that a t-statistic is compared to a t-distribution for a t-test (see <a href="Chapter_22.html#Chapter_22">Chapter 22</a>).</p>
<div id="f-distribution" class="section level2 hasAnchor" number="24.1">
<h2><span class="header-section-number">24.1</span> F-distribution<a href="Chapter_24.html#f-distribution" class="anchor-section" aria-label="Anchor link to header"></a></h2>
<p>If we want to test whether or not two variances are the same, then we need to know what the null distribution should be if two different samples came from a population with the same variance.
The general idea is the same as it was for the distributions introduced in <a href="Chapter_15.html#probability-distributions">Section 15.4</a>.
For example, if we wanted to test whether or not a coin is fair, then we could flip it 10 times and compare the number of times it comes up heads to probabilities predicted by the binomial distribution when <span class="math inline">\(P(Heads) = 0.5\)</span> and <span class="math inline">\(N = 10\)</span> (see <a href="Chapter_15.html#binomial-distribution">Section 15.4.1</a> and Figure 15.5).
To test variances, we will calculate the ratio of variances (<span class="math inline">\(F\)</span>), then compare it to the <span class="math inline">\(F\)</span> probability density function<a href="#fn56" class="footnote-ref" id="fnref56"><sup>56</sup></a>.
For example, the ratio of the variances for two samples, 1 and 2, is <span class="citation">(<a href="#ref-Sokal1995" role="doc-biblioref">Sokal & Rohlf, 1995</a>)</span>,</p>
<p><span class="math display">\[F = \frac{\mathrm{Variance}\:1}{\mathrm{Variance}\:2}.\]</span></p>
<p>Note that if the variances of samples 1 and 2 are the exact same, then <span class="math inline">\(F = 1\)</span>.
If the variances are very different, then <span class="math inline">\(F\)</span> is either very low (if Variance 1 < Variance 2) or very high (if Variance 1 > Variance 2).
To test the null hypothesis that samples 1 and 2 have the same variance, we therefore need to map the calculated <span class="math inline">\(F\)</span> to the probability density of the F-distribution.
Again, the general idea is the same as comparing a t-score to the t-distribution in <a href="Chapter_22.html#one-sample-t-test">Section 22.1</a>.
Recall that the shape of the t-distribution is slightly different for different degrees of freedom (<span class="math inline">\(df\)</span>).
As <span class="math inline">\(df\)</span> increases, the t-distribution starts to resemble the normal distribution.
For the F-distribution, there are actually two degrees of freedom to consider.
One degree of freedom is needed for Variance 1, and a second degree of freedom is needed for Variance 2.
Together, these two degrees of freedom will determine the shape of the F-distribution (Figure 24.1).</p>
<div class="figure"><span style="display:block;" id="fig:unnamed-chunk-96"></span>
<img src="bookdown-demo_files/figure-html/unnamed-chunk-96-1.png" alt="A plot is shown with 3 different curve lines, which show 3 different F-distributions with different degrees of freedom." width="672" />
<p class="caption">
Figure 24.1: Probability density functions for three different F-distributions, each of which has different degrees of freedom for the variances in the numerator (df1) and denominator (df2).
</p>
</div>
<p>Figure 24.1 shows an F-distribution for three different combinations of degrees of freedom.
The F-distribution changes its shape considerably given different df values (visualising this is easier with an interactive application<a href="#fn57" class="footnote-ref" id="fnref57"><sup>57</sup></a>).</p>
<p>It is not necessary to memorise how the F-distribution changes with different degrees of freedom.
The point is that the probability distribution changes given different degrees of freedom, and that the relationship between probability and the value on the x-axis (<span class="math inline">\(F\)</span>) works like other distributions such as the normal or t-distribution.
The entire area under the curve must sum to 1, and we can calculate the area above and below any <span class="math inline">\(F\)</span> value (rather, we can get jamovi to do this for us).
Consequently, we can use the F-distribution as the null distribution for the ratio of two variances.
If the null hypothesis that the two variances are the same is true (i.e., <span class="math inline">\(F = 1\)</span>), then the F-distribution gives us the probability of the ratio of two variances being as or more extreme (i.e., further from 1) than a specific value.</p>
</div>
<div id="one-way-anova" class="section level2 hasAnchor" number="24.2">
<h2><span class="header-section-number">24.2</span> One-way ANOVA<a href="Chapter_24.html#one-way-anova" class="anchor-section" aria-label="Anchor link to header"></a></h2>
<p>We can use the F-distribution to test the null hypothesis mentioned at the beginning of the chapter (that fig wasp species have the same mean wing length).
The general idea is to compare the mean variance among groups to the mean variance within groups, so our F value (i.e., ‘F-statistic’) is calculated,</p>
<p><span class="math display">\[F = \frac{\mathrm{Mean\:variance\:among\:\:groups}}{\mathrm{Mean\:variance\:within\:\:groups}}.\]</span></p>
<p>The rest of this section works through the details of how to calculate this F-statistic.
It is easy to get lost in these details, but the calculations that follow do not need to be done by hand.
As usual, jamovi will do all of this work for us <span class="citation">(<a href="#ref-Jamovi2022" role="doc-biblioref">The jamovi project, 2024</a>)</span>.
The reason for going through the ANOVA step-by-step process is to show how the total variation in the dataset is being partitioned into the variance among versus within groups, and to provide some conceptual understanding of what the numbers in an ANOVA output actually mean.</p>
<div id="anova-mean-variance-among-groups" class="section level3 hasAnchor" number="24.2.1">
<h3><span class="header-section-number">24.2.1</span> ANOVA mean variance among groups<a href="Chapter_24.html#anova-mean-variance-among-groups" class="anchor-section" aria-label="Anchor link to header"></a></h3>
<p>To get the mean variance among groups (i.e., mean squares; <span class="math inline">\(MS_{\mathrm{among}}\)</span>), we need to use the sum of squares (<span class="math inline">\(SS\)</span>).
The <span class="math inline">\(SS\)</span> was introduced to show how the variance is calculated in <a href="Chapter_12.html#the-variance">Section 12.3</a>,</p>
<p><span class="math display">\[SS = \sum_{i = 1}^{N}\left(x_{i} - \bar{x} \right)^{2}.\]</span></p>
<p>Instead of dividing <span class="math inline">\(SS\)</span> by <span class="math inline">\(N - 1\)</span> (i.e., the total <span class="math inline">\(df\)</span>), as we would do to get a sample variance, we will need to divide it by the <span class="math inline">\(df\)</span> <em>among groups</em> (<span class="math inline">\(df_{\mathrm{among}}\)</span>) and <span class="math inline">\(df\)</span> within groups (<span class="math inline">\(df_{\mathrm{within}}\)</span>).
We can then use these <span class="math inline">\(SS_{\mathrm{among}}/df_{\mathrm{among}}\)</span> and <span class="math inline">\(SS_{\mathrm{within}}/df_{\mathrm{within}}\)</span> values to calculate our F<a href="#fn58" class="footnote-ref" id="fnref58"><sup>58</sup></a>.</p>
<p>This all sounds a bit abstract at first, so an example will be helpful.
We can again consider the wing length measurements from the five species of fig wasps shown in Table 24.1.
First, note that the <strong>grand mean</strong> (i.e., the mean across all species) is <span class="math inline">\(\bar{\bar{x}} =\)</span> 1.6691.
We can also get the sample mean values of each group, individually.
For example, for Het1,</p>
<p><span class="math display">\[\bar{x}_{\mathrm{Het1}} = \frac{2.122 + 1.938 + 1.765 + 1.7}{4} = 1.88125.\]</span></p>
<p>We can calculate the means for all five fig wasps (Table 24.3).</p>
<table style="width:69%;">
<caption><strong>TABLE 24.3</strong> Mean wing lengths (mm) from five unnamed species of non-pollinating fig wasps collected from fig trees in 2010 near La Paz in Baja, Mexico. Each species mean was calculated from four wasps (<span class="math inline">\(N = 4\)</span>).</caption>
<colgroup>
<col width="13%" />
<col width="13%" />
<col width="13%" />
<col width="13%" />
<col width="13%" />
</colgroup>
<thead>
<tr class="header">
<th align="center">Het1</th>
<th align="center">Het2</th>
<th align="center">LO1</th>
<th align="center">SO1</th>
<th align="center">SO2</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center">1.88125</td>
<td align="center">1.70775</td>
<td align="center">1.71125</td>
<td align="center">1.51525</td>
<td align="center">1.53000</td>
</tr>
</tbody>
</table>
<p>To get the mean variance among groups, we need to calculate the sum of the squared deviations of each species wing length (<span class="math inline">\(\bar{x}_{\mathrm{Het1}} =\)</span> 1.88125, <span class="math inline">\(\bar{x}_{\mathrm{Het2}} =\)</span> 1.70775, etc.) from the grand mean (<span class="math inline">\(\bar{\bar{x}} =\)</span> 1.6691).
We also need to weigh the squared deviation of each species by the number of samples for each species<a href="#fn59" class="footnote-ref" id="fnref59"><sup>59</sup></a>.
For example, for Het1, the squared deviation would be <span class="math inline">\(4(1.88125 - 1.6691)^{2}\)</span> because there are four fig wasps, so we multiply the squared deviation from the mean by 4.
We can then calculate the sum of squared deviations of the species means from the grand mean,</p>
<p><span class="math display">\[SS_{\mathrm{among}} = 4(1.88125 - 1.6691)^{2} +
4(1.70775 - 1.6691)^{2}\:+\: ... \:
+\:4(1.53 - 1.6691)^{2}.\]</span></p>
<p>Calculating the above across the five species of wasps gives a value of <span class="math inline">\(SS_{\mathrm{among}} =\)</span> 0.3651868.
To get our mean variance among groups, we now just need to divide by the appropriate degrees of freedom (<span class="math inline">\(df_{\mathrm{among}}\)</span>).
Because there are five total species (<span class="math inline">\(N_{\mathrm{species}} = 5\)</span>), <span class="math inline">\(df_{\mathrm{among}} = 5 - 1 = 4\)</span>.
The mean variance among groups is therefore <span class="math inline">\(MS_{\mathrm{among}} =\)</span> 0.3651868/4 = 0.0912967.</p>
</div>
<div id="anova-mean-variance-within-groups" class="section level3 hasAnchor" number="24.2.2">
<h3><span class="header-section-number">24.2.2</span> ANOVA mean variance within groups<a href="Chapter_24.html#anova-mean-variance-within-groups" class="anchor-section" aria-label="Anchor link to header"></a></h3>
<p>To get the mean variance within groups (<span class="math inline">\(MS_{\mathrm{within}}\)</span>), we need to calculate the sum of squared deviations of wing lengths from <em>species means</em>.
That is, we need to take the wing length of each wasp, subtract the mean species wing length, then square it.
For example, for Het1, we calculate,</p>
<p><span class="math display">\[SS_{\mathrm{Het1}} = (2.122 - 1.88125)^{2} +
(1.765 - 1.88125)^{2}
\:+\: ... \:
+\:
(1.7 - 1.88125)^{2}.\]</span></p>
<p>If we subtract the mean and square each term of the above,</p>
<p><span class="math display">\[SS_{\mathrm{Het1}} = 0.0579606 +
0.0032206 +
0.0135141 +
0.0328516 = 0.1075467.\]</span></p>
<p>Table 24.4 shows what happens after taking the wing lengths from Table 24.1, subtracting the means, then squaring.</p>
<table style="width:99%;">
<caption><strong>TABLE 24.4</strong> Squared deviations from species means for each wing length presented in Table 24.1.</caption>
<colgroup>
<col width="19%" />
<col width="19%" />
<col width="18%" />
<col width="20%" />
<col width="20%" />
</colgroup>
<thead>
<tr class="header">
<th align="center">Het1</th>
<th align="center">Het2</th>
<th align="center">LO1</th>
<th align="center">SO1</th>
<th align="center">SO2</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center">0.057960563</td>
<td align="center">0.010455063</td>
<td align="center">0.02488506</td>
<td align="center">0.0017430625</td>
<td align="center">0.01102500</td>
</tr>
<tr class="even">
<td align="center">0.003220563</td>
<td align="center">0.012825563</td>
<td align="center">0.06039306</td>
<td align="center">0.0004950625</td>
<td align="center">0.02890000</td>
</tr>
<tr class="odd">
<td align="center">0.013514062</td>
<td align="center">0.002997562</td>
<td align="center">0.01494506</td>
<td align="center">0.0020475625</td>
<td align="center">0.01512900</td>
</tr>
<tr class="even">
<td align="center">0.032851562</td>
<td align="center">0.025840562</td>
<td align="center">0.07910156</td>
<td align="center">0.0006630625</td>
<td align="center">0.02310400</td>
</tr>
</tbody>
</table>
<p>If we sum each column (i.e., do what we did for <span class="math inline">\(SS_{\mathrm{Het1}}\)</span> for each species), then we get the <span class="math inline">\(SS\)</span> for each species (Table 24.5).</p>
<table style="width:90%;">
<caption><strong>TABLE 24.5</strong> Sum of squared deviations from species means for each wing length presented in Table 24.1.</caption>
<colgroup>
<col width="18%" />
<col width="18%" />
<col width="18%" />
<col width="18%" />
<col width="18%" />
</colgroup>
<thead>
<tr class="header">
<th align="center">Het1</th>
<th align="center">Het2</th>
<th align="center">LO1</th>
<th align="center">SO1</th>
<th align="center">SO2</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center">0.10754675</td>
<td align="center">0.05211875</td>
<td align="center">0.17932475</td>
<td align="center">0.00494875</td>
<td align="center">0.07815800</td>
</tr>
</tbody>
</table>
<p>If we sum the squared deviations in Table 24.5, we get <span class="math inline">\(SS_{\mathrm{within}} =\)</span> 0.422097.
Note that each species included four wing lengths.
We lose a degree of freedom for each of the five species (because we had to calculate the species mean), so our total <span class="math inline">\(df\)</span> is 3 for each species, and <span class="math inline">\(5 \times 3 = 15\)</span> degrees of freedom within groups (<span class="math inline">\(df_{\mathrm{within}}\)</span>).
To get the mean variance within groups (denominator of <span class="math inline">\(F\)</span>), we calculate <span class="math inline">\(MS_{\mathrm{within}} = SS_{\mathrm{within}} / df_{\mathrm{within}} =\)</span> 0.0281398.</p>
</div>
<div id="anova-f-statistic-calculation" class="section level3 hasAnchor" number="24.2.3">
<h3><span class="header-section-number">24.2.3</span> ANOVA F-statistic calculation<a href="Chapter_24.html#anova-f-statistic-calculation" class="anchor-section" aria-label="Anchor link to header"></a></h3>
<p>From <a href="Chapter_24.html#anova-mean-variance-among-groups">Section 24.2.1</a>, we have the mean variance among groups,</p>
<p><span class="math display">\[MS_{\mathrm{among}} = 0.0912967.\]</span></p>
<p>From <a href="Chapter_24.html#anova-mean-variance-among-groups">Section 24.2.2</a>, we have the mean variance within groups,</p>
<p><span class="math display">\[MS_{\mathrm{within}} = 0.0281398.\]</span></p>
<p>To calculate <span class="math inline">\(F\)</span>, we just need to divide <span class="math inline">\(MS_{\mathrm{among}}\)</span> by <span class="math inline">\(MS_{\mathrm{within}}\)</span>,</p>
<p><span class="math display">\[F = \frac{0.0912967}{0.0281398} = 3.2443976.\]</span></p>
<p>Remember that if the mean variance among groups is the same as the mean variance within groups (i.e., <span class="math inline">\(MS_{\mathrm{among}} = MS_{\mathrm{within}}\)</span>), then <span class="math inline">\(F = 1\)</span>.
We can test the null hypothesis that <span class="math inline">\(MS_{\mathrm{among}} = MS_{\mathrm{within}}\)</span> against the alternative hypothesis that there is more variation among groups than within groups (<span class="math inline">\(H_{A}: MS_{\mathrm{among}} > MS_{\mathrm{within}}\)</span>) using the F-distribution (note that this is a one-tailed test).
In the example of five fig wasp species, <span class="math inline">\(df_{\mathrm{among}} = 4\)</span> and <span class="math inline">\(df_{\mathrm{within}} = 15\)</span>,
so we need an F-distribution with four degrees of freedom in the numerator and 15 degrees of freedom in the denominator<a href="#fn60" class="footnote-ref" id="fnref60"><sup>60</sup></a>.
We can use an interactive app (see <a href="Chapter_24.html#f-distribution">Section 24.1</a>) to get the F-distribution and p-value (Figure 24.2).</p>
<div class="figure"><span style="display:block;" id="fig:unnamed-chunk-100"></span>
<img src="bookdown-demo_files/figure-html/unnamed-chunk-100-1.png" alt="A plot is shown with an F probabilty density distribution and values on the x-axis from 0-4. The area under the curve where F > 3.244 is shaded in grey, and F = 3.244 is indicated with an arrow." width="672" />
<p class="caption">
Figure 24.2: F-distribution with <span class="math inline">\(df = 4\)</span> for the numerator and <span class="math inline">\(df = 15\)</span> for the denominator. The arrow indicates an <span class="math inline">\(F\)</span> value calculated from fig wasp species wing length measurements for five different species and four measurements per species. Fig wasp wing lengths were collected from a site near La Paz in Baja, Mexico 2010.
</p>
</div>
<p>The area shaded in grey in Figure 24.2, where <span class="math inline">\(F\)</span> > 3.2443976, is approximately <span class="math inline">\(P =\)</span> 0.041762.
This is our p-value.
Since <span class="math inline">\(P < 0.05\)</span>, we can reject the null hypothesis that all mean species wing lengths are the same, because the variance among species wing lengths is significantly higher than the variance within species wing lengths.
Note that the critical value of <span class="math inline">\(F\)</span> (i.e., for which <span class="math inline">\(P = 0.05\)</span>) is 3.0555683, so for any <span class="math inline">\(F\)</span> value above this (for <span class="math inline">\(df1 = 5\)</span> and <span class="math inline">\(df2 = 19\)</span>), we would reject <span class="math inline">\(H_{0}\)</span>.</p>
<p>When running an ANOVA in a statistical program, output includes (at least) the calculated F-statistic, degrees of freedom, and the p-value.
Figure 24.3 shows the one-way ANOVA output of the test of fig wasp wing lengths in jamovi.</p>
<div class="figure"><span style="display:block;" id="fig:unnamed-chunk-101"></span>
<img src="img/jamovi_ANOVA_output.png" alt="Jamovi output is shown with a table called 'One-Way ANOVA', which includes a single measurement for F, df1, df2, and p." width="100%" />
<p class="caption">
Figure 24.3: Jamovi output for a one-way ANOVA of wing length measurements in five species of fig wasps collected in 2010 near La Paz in Baja, Mexico.
</p>
</div>
<p>Jamovi is quite minimalist for a one-way ANOVA <span class="citation">(<a href="#ref-Jamovi2022" role="doc-biblioref">The jamovi project, 2024</a>)</span>, but these four statistics (<span class="math inline">\(F\)</span>, <span class="math inline">\(df1\)</span>, <span class="math inline">\(df2\)</span>, and <span class="math inline">\(p\)</span>) are all that is really needed.
Most statistical programs will show ANOVA output that includes the <span class="math inline">\(SS\)</span> and mean squares among (<span class="math inline">\(MS_{\mathrm{among}}\)</span>) and within (<span class="math inline">\(MS_{\mathrm{within}}\)</span>) groups.</p>
<pre><code>Analysis of Variance Table
Response: wing_length
Df Sum Sq Mean Sq F value Pr(>F)
Species 4 0.36519 0.091297 3.2444 0.04176 *
Residuals 15 0.42210 0.028140
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1</code></pre>
<p>The above output, taken from R <span class="citation">(<a href="#ref-Rproject" role="doc-biblioref">R Core Team, 2022</a>)</span>, includes the same information as jamovi (<span class="math inline">\(F\)</span>, <span class="math inline">\(df1\)</span>, <span class="math inline">\(df2\)</span>, and <span class="math inline">\(p\)</span>), but also includes <span class="math inline">\(SS\)</span> and mean variances.
We can also get this information from jamovi if we want it (see <a href="Chapter_27.html#Chapter_27">Chapter 27</a>).</p>
</div>
</div>
<div id="assumptions-of-anova" class="section level2 hasAnchor" number="24.3">
<h2><span class="header-section-number">24.3</span> Assumptions of ANOVA<a href="Chapter_24.html#assumptions-of-anova" class="anchor-section" aria-label="Anchor link to header"></a></h2>
<p>As with the t-test (see <a href="Chapter_22.html#assumptions-of-t-tests">Section 22.4</a>), there are some important assumptions that we make when using an ANOVA.
Violating these assumptions will mean that our Type I error rate (<span class="math inline">\(\alpha\)</span>) is, again, potentially misleading.
Assumptions of ANOVA include the following <span class="citation">(<a href="#ref-Box1978" role="doc-biblioref">Box et al., 1978</a>; <a href="#ref-Sokal1995" role="doc-biblioref">Sokal & Rohlf, 1995</a>)</span>:</p>
<ol style="list-style-type: decimal">
<li>Observations are sampled randomly</li>
<li>Observations are independent of one another</li>
<li>Groups have the same variance</li>
<li>Errors are normally distributed</li>
</ol>
<p>Assumption 1 just means that observations are not biased in any particular way.
For example, if the fig wasps introduced at the start of this chapter were used because they were the largest wasps that were collected for each species, then this would violate the assumption that the wing lengths were sampled randomly from the population.</p>
<p>Assumption 2 means that observations are not related to one another in some confounding way.
For example, if all of the Het1 wasps came from one fig tree, and all of the Het2 wasps came from a different fig tree, then wing length measurements are not really independent within species.
In this case, we could not attribute differences in mean wing length to species.
The differences could instead be attributable to wasps being sampled from different trees (more on this in <a href="Chapter_27.html#Chapter_27">Chapter 27</a>).</p>
<p>Assumption 3 is fairly self-explanatory.
The ANOVA assumes that all of the groups in the dataset (e.g., species in the case of the fig wasp wing measurements) have the same variance, that is, we assume homogeneity of variances (as opposed to heterogeneity of variances).
In general, ANOVA is reasonably robust to deviations from homogeneity, especially if groups have similar sample sizes <span class="citation">(<a href="#ref-Blanca2018" role="doc-biblioref">Blanca et al., 2018</a>)</span>.
This means that the Type I error rate is about what we want it to be (usually <span class="math inline">\(\alpha = 0.05\)</span>), even when the assumption of homogeneity of variances is violated.
In other words, we are not rejecting the null hypothesis when it is true more frequently than we intend!
We can test the assumption that group variances are the same using a Levene’s test in the same way that we did for the independent samples t-test in <a href="Chapter_23.html#independent-samples-t-test-1">Chapter 23</a>.
If we reject the null hypothesis that groups have the same variance, then we should potentially consider a non-parametric alternative test such as the Kruskal-Wallis H test (see <a href="Chapter_26.html#Chapter_26">Chapter 26</a>).</p>
<p>Assumption 4 is the equivalent of the t-test assumption from <a href="Chapter_22.html#assumptions-of-t-tests">Section 22.4</a> that sample means are normally distributed around the true mean.
What the assumption means is that if we were to repeatedly resample data from a population, the sample means that we calculate would be normally distributed.
For the fig wasp wing measurements, this means that if we were to go back out and repeatedly collect four fig wasps from each of the five species, then sample means of species wing length and overall wing length would be normally distributed around the true means.
Due to the central limit theorem (see <a href="Chapter_16.html#Chapter_16">Chapter 16</a>), this assumption becomes less problematic with increasing sample size.
We can test if the sample data are normally distributed using a Q-Q plot or Shapiro-Wilk test (the same procedure used for the t-test).
Fortunately, the ANOVA is quite robust to deviations from normality <span class="citation">(<a href="#ref-Schmider2010" role="doc-biblioref">Schmider et al., 2010</a>)</span>, but if data are not normally distributed, we should again consider a non-parametric alternative test such as the Kruskal-Wallis H test (see <a href="Chapter_26.html#Chapter_26">Chapter 26</a>).</p>
</div>
</div>
<h3>References<a href="references.html#references" class="anchor-section" aria-label="Anchor link to header"></a></h3>
<div id="refs" class="references csl-bib-body hanging-indent" line-spacing="2">
<div id="ref-Blanca2018" class="csl-entry">
Blanca, M. J., Alarcón, R., Arnau, J., Bono, R., & Bendayan, R. (2018). <span class="nocase">Effect of variance ratio on ANOVA robustness: Might 1.5 be the limit?</span> <em>Behavior Research Methods</em>, <em>50</em>(3), 937–962. <a href="https://doi.org/10.3758/s13428-017-0918-2">https://doi.org/10.3758/s13428-017-0918-2</a>
</div>
<div id="ref-Box1978" class="csl-entry">
Box, G. E. P., Hunter, W. G., & Hunter, S. J. (1978). <em><span class="nocase">Statistics for Experimenters: An Introduction to Design, Data Analysis, and Model Building</span></em>. John Wiley & Sons, New York, USA.
</div>
<div id="ref-Duthie2015b" class="csl-entry">
Duthie, A. B., Abbott, K. C., & Nason, J. D. (2015). <span class="nocase">Trade-offs and coexistence in fluctuating environments: evidence for a key dispersal-fecundity trade-off in five nonpollinating fig wasps</span>. <em>American Naturalist</em>, <em>186</em>(1), 151–158. <a href="https://doi.org/10.1086/681621">https://doi.org/10.1086/681621</a>
</div>
<div id="ref-Miller2004" class="csl-entry">
Miller, I., & Miller, M. (2004). <em><span class="nocase">John E. Freund’s mathematical statistics</span></em> (7th ed., p. 614). Pearson Prentice Hall, Upper Saddle River, New Jersey, USA.
</div>
<div id="ref-Rproject" class="csl-entry">
R Core Team. (2022). <em>R: A language and environment for statistical computing</em>. R Foundation for Statistical Computing. <a href="https://www.R-project.org/">https://www.R-project.org/</a>
</div>
<div id="ref-Schmider2010" class="csl-entry">
Schmider, E., Ziegler, M., Danay, E., Beyer, L., & Bühner, M. (2010). Is it really robust?: Reinvestigating the robustness of ANOVA against violations of the normal distribution assumption. <em>Methodology</em>, <em>6</em>(4), 147–151. <a href="https://doi.org/10.1027/1614-2241/a000016">https://doi.org/10.1027/1614-2241/a000016</a>
</div>
<div id="ref-Sokal1995" class="csl-entry">
Sokal, R. R., & Rohlf, F. J. (1995). <em><span>Biometry</span></em> (3rd ed., p. 887). W. H. Freeman & Company, New York, USA.
</div>
<div id="ref-Jamovi2022" class="csl-entry">
The jamovi project. (2024). <em>Jamovi (version 2.5)</em>. <a href="https://www.jamovi.org">https://www.jamovi.org</a>
</div>
</div>
<div class="footnotes">
<hr />
<ol start="54">
<li id="fn54"><p>Technically polynomially, but the distinction really is not important for understanding the concept. In general, the number of possible comparisons between groups is described by a binomial coefficient, <span class="math display">\[\binom{g}{2} = \frac{g!}{2\left(g - 2 \right)!}.\]</span> The number of combinations therefore increases with increasing group number (g).<a href="Chapter_24.html#fnref54" class="footnote-back">↩︎</a></p></li>
<li id="fn55"><p>To get the 0.4, we can first calculate the probability that we (correctly) do not reject <span class="math inline">\(H_{0}\)</span> for all 10 pair-wise species combinations <span class="math inline">\((1 - 0.05)^{10} \approx 0.60\)</span>, then subtract from 1, <span class="math inline">\(P(Reject\:H_{0}) = 1 - (1 - 0.05)^{10} \approx 0.4\)</span>. That is, we find the probability of there not being a Type I error in the first test <span class="math inline">\((1 - 0.05)\)</span>, <strong>and</strong> the second test <span class="math inline">\((1 - 0.05)\)</span>, and so forth, thereby multiplying <span class="math inline">\((1 - 0.05)\)</span> by itself 10 times. This gives the probability of not committing any Type I error across all 10 tests, so the probability that we commit at least one Type I error is 1 minus this probability.<a href="Chapter_24.html#fnref55" class="footnote-back">↩︎</a></p></li>
<li id="fn56"><p>The F-distribution was originally discovered in the context of the ratio of random variables with Chi-square distributions, with each variable being divided by its own degree of freedom <span class="citation">(<a href="#ref-Miller2004" role="doc-biblioref">Miller & Miller, 2004</a>)</span>. We will look at the Chi-square distribution in <a href="Chapter_29.html#Chapter_29">Chapter 29</a>.<a href="Chapter_24.html#fnref56" class="footnote-back">↩︎</a></p></li>
<li id="fn57"><p><a href="https://bradduthie.github.io/stats/app/f_distribution/" class="uri">https://bradduthie.github.io/stats/app/f_distribution/</a><a href="Chapter_24.html#fnref57" class="footnote-back">↩︎</a></p></li>
<li id="fn58"><p>Note that the <span class="math inline">\(SS\)</span> divided by the degrees of freedom (<span class="math inline">\(N - 1\)</span>) is a variance. For technical reasons <span class="citation">(<a href="#ref-Sokal1995" role="doc-biblioref">Sokal & Rohlf, 1995</a>)</span>, we cannot simply calculate the mean variance of groups (i.e., the mean of <span class="math inline">\(s^{2}_{\mathrm{Het1}}\)</span>, <span class="math inline">\(s^{2}_{\mathrm{Het2}}\)</span>, etc.). We need to sum up all the squared deviations from group means <em>before</em> dividing by the relevant degrees of freedom (i.e., dfs for the among and within group variation).<a href="Chapter_24.html#fnref58" class="footnote-back">↩︎</a></p></li>
<li id="fn59"><p>In this case, weighing by sample size is not so important because each species has the same number of samples. But when different groups have different numbers of samples, we need to multiply by sample number so that each group contributes proportionally to the SS.<a href="Chapter_24.html#fnref59" class="footnote-back">↩︎</a></p></li>
<li id="fn60"><p>Note that <span class="math inline">\(df_{\mathrm{among}} = 4\)</span> and <span class="math inline">\(df_{\mathrm{within}} = 15\)</span> sum to 19, which is the total df of the entire dataset (<span class="math inline">\(N - 1 = 20 - 1 = 19\)</span>). This is always the case for the ANOVA; the overall df constrains the degrees of freedom among and within groups.<a href="Chapter_24.html#fnref60" class="footnote-back">↩︎</a></p></li>
</ol>
</div>
</section>
</div>
</div>
</div>
<a href="Chapter_23.html" class="navigation navigation-prev " aria-label="Previous page"><i class="fa fa-angle-left"></i></a>
<a href="Chapter_25.html" class="navigation navigation-next " aria-label="Next page"><i class="fa fa-angle-right"></i></a>
</div>
</div>
<script src="libs/gitbook-2.6.7/js/app.min.js"></script>
<script src="libs/gitbook-2.6.7/js/clipboard.min.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-search.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-sharing.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-fontsettings.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-bookdown.js"></script>
<script src="libs/gitbook-2.6.7/js/jquery.highlight.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-clipboard.js"></script>
<script>
gitbook.require(["gitbook"], function(gitbook) {
gitbook.start({
"sharing": {
"github": false,
"facebook": true,
"twitter": true,
"linkedin": false,
"weibo": false,
"instapaper": false,
"vk": false,
"whatsapp": false,
"all": ["facebook", "twitter", "linkedin", "weibo", "instapaper"]
},
"fontsettings": {
"theme": "white",
"family": "sans",
"size": 2
},
"edit": {
"link": "https://github.com/rstudio/bookdown-demo/edit/master/07-ANOVA.Rmd",
"text": "Edit"
},
"history": {
"link": null,
"text": null
},
"view": {
"link": null,
"text": null
},
"download": null,
"search": {
"engine": "fuse",
"options": null
},
"toc": {
"collapse": "subsection"
}
});
});
</script>
<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
(function () {
var script = document.createElement("script");
script.type = "text/javascript";
var src = "true";
if (src === "" || src === "true") src = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/latest.js?config=TeX-MML-AM_CHTML";
if (location.protocol !== "file:")
if (/^https?:/.test(src))
src = src.replace(/^https?:/, '');
script.src = src;
document.getElementsByTagName("head")[0].appendChild(script);
})();
</script>
</body>
</html>