forked from IndrajeetPatil/ggstatsplot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
1927 lines (1903 loc) · 166 KB
/
index.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
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ggplot2 Based Plots with Statistical Details • ggstatsplot</title>
<!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script><!-- Bootstrap --><link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/lumen/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.7.1/css/all.min.css" integrity="sha256-nAmazAk6vS34Xqo0BSrTb+abbtFlgsFK7NKSi6o7Y78=" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.7.1/css/v4-shims.min.css" integrity="sha256-6qHlizsOWFskGlwVOKuns+D1nB6ssZrHQrNj1wGplHc=" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.9.4/headroom.min.js" integrity="sha256-DJFC1kqIhelURkuza0AvYal5RxMtpzLjFhsnVIeuk+U=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.9.4/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="pkgdown.css" rel="stylesheet">
<script src="pkgdown.js"></script><!-- docsearch --><script src="docsearch.js"></script><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/docsearch.js/2.6.1/docsearch.min.css" integrity="sha256-QOSRU/ra9ActyXkIBbiIB144aDBdtvXBcNc3OTNuX/Q=" crossorigin="anonymous">
<link href="docsearch.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/jquery.mark.min.js" integrity="sha256-4HLtjeVgH0eIB3aZ9mLYF6E8oU5chNdjU6p6rrXpl9U=" crossorigin="anonymous"></script><link href="extra.css" rel="stylesheet">
<meta property="og:title" content="ggplot2 Based Plots with Statistical Details">
<meta property="og:description" content="Extension of ggplot2, ggstatsplot creates
graphics with details from statistical tests included in the plots
themselves. It is targeted primarily at behavioral sciences community
to provide a one-line code to generate information-rich plots for
statistical analysis of continuous (violin plots, scatterplots,
histograms, dot plots, dot-and-whisker plots) or categorical (pie and
bar charts) data. Currently, it supports only the most common types of
statistical tests: parametric, nonparametric, robust, and bayesian
versions of t-test/anova, correlation analyses, contingency table
analysis, and regression analyses.">
<meta name="twitter:card" content="summary">
<!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-article">
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">ggstatsplot</a>
<span class="version label label-danger" data-toggle="tooltip" data-placement="bottom" title="Unreleased version">0.0.12.9000</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="index.html">
<span class="fas fa fas fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="articles/additional.html">additional vignettes</a>
</li>
<li>
<a href="articles/web_only/combine_plots.html">combine_plots</a>
</li>
<li>
<a href="articles/web_only/effsize_interpretation.html">effect size interpretation</a>
</li>
<li>
<a href="articles/web_only/faq.html">Frequently asked questions</a>
</li>
<li>
<a href="articles/web_only/gallery.html">Gallery of ggstatsplot examples</a>
</li>
<li>
<a href="articles/web_only/ggbetweenstats.html">ggbetweenstats</a>
</li>
<li>
<a href="articles/web_only/ggcoefstats.html">ggcoefstats</a>
</li>
<li>
<a href="articles/web_only/ggcorrmat.html">ggcorrmat</a>
</li>
<li>
<a href="articles/web_only/gghistostats.html">gghistostats</a>
</li>
<li>
<a href="articles/web_only/ggpiestats.html">ggpiestats</a>
</li>
<li>
<a href="articles/web_only/ggscatterstats.html">ggscatterstats</a>
</li>
<li>
<a href="articles/web_only/ggstatsplot_paper.html">ggstatsplot: ggplot2 Based Plots with Statistical Details</a>
</li>
<li>
<a href="articles/web_only/ggwithinstats.html">ggwithinstats</a>
</li>
<li>
<a href="articles/web_only/purrr_examples.html">using `ggstatsplot` with the `purrr` package</a>
</li>
<li>
<a href="articles/web_only/session_info.html">session information</a>
</li>
<li>
<a href="articles/web_only/theme_ggstatsplot.html">ggstatsplot theme</a>
</li>
</ul>
</li>
<li>
<a href="news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/IndrajeetPatil/ggstatsplot">
<span class="fab fa fab fa-github fa-lg"></span>
</a>
</li>
</ul>
<form class="navbar-form navbar-right hidden-xs hidden-sm" role="search">
<div class="form-group">
<input type="search" class="form-control" name="search-input" id="search-input" placeholder="Search..." aria-label="Search for..." autocomplete="off">
</div>
</form>
</div>
<!--/.nav-collapse -->
</div>
<!--/.container -->
</div>
<!--/.navbar -->
</header><div class="row">
<div class="col-md-9 contents">
<p><!-- README.md is generated from README.Rmd. Please edit that file --></p>
<div id="ggstatsplot-ggplot2-based-plots-with-statistical-details" class="section level1">
<div class="page-header"><h1 class="hasAnchor">
<a href="#ggstatsplot-ggplot2-based-plots-with-statistical-details" class="anchor"></a><code>ggstatsplot</code>: <code>ggplot2</code> Based Plots with Statistical Details</h1></div>
<table class="table table">
<colgroup>
<col width="20%">
<col width="20%">
<col width="20%">
<col width="20%">
<col width="20%">
</colgroup>
<thead><tr class="header">
<th>Package</th>
<th>Status</th>
<th>Usage</th>
<th>GitHub</th>
<th>References</th>
</tr></thead>
<tbody>
<tr class="odd">
<td><a href="https://CRAN.R-project.org/package=ggstatsplot"><img src="http://www.r-pkg.org/badges/version-ago/ggstatsplot" alt="CRAN_Release_Badge"></a></td>
<td><a href="https://travis-ci.org/IndrajeetPatil/ggstatsplot"><img src="https://travis-ci.org/IndrajeetPatil/ggstatsplot.svg?branch=master" alt="Travis Build Status"></a></td>
<td><a href="https://CRAN.R-project.org/package=ggstatsplot"><img src="https://cranlogs.r-pkg.org/badges/last-day/ggstatsplot?color=blue" alt="Daily downloads badge"></a></td>
<td><a href="https://github.com/IndrajeetPatil/ggstatsplot/"><img src="https://img.shields.io/badge/GitHub-0.0.12.9000-orange.svg?style=flat-square" alt="GitHub version"></a></td>
<td><a href="https://indrajeetpatil.github.io/ggstatsplot/"><img src="https://img.shields.io/badge/website-ggstatsplot-orange.svg?colorB=E91E63" alt="Website"></a></td>
</tr>
<tr class="even">
<td><a href="https://cran.r-project.org/web/checks/check_results_ggstatsplot.html"><img src="https://cranchecks.info/badges/summary/ggstatsplot" alt="CRAN Checks"></a></td>
<td><a href="https://ci.appveyor.com/project/IndrajeetPatil/ggstatsplot"><img src="https://ci.appveyor.com/api/projects/status/github/IndrajeetPatil/ggstatsplot?branch=master&svg=true" alt="AppVeyor Build Status"></a></td>
<td><a href="https://CRAN.R-project.org/package=ggstatsplot"><img src="https://cranlogs.r-pkg.org/badges/last-week/ggstatsplot?color=blue" alt="Weekly downloads badge"></a></td>
<td><a href="https://github.com/IndrajeetPatil/ggstatsplot/"><img src="https://img.shields.io/badge/forks-62-blue.svg" alt="Forks"></a></td>
<td><a href="https://www.rdocumentation.org/packages/ggstatsplot"><img src="https://www.rdocumentation.org/badges/version/ggstatsplot" alt="Rdoc"></a></td>
</tr>
<tr class="odd">
<td><a href="https://cran.r-project.org/"><img src="https://img.shields.io/badge/R%3E%3D-3.5.0-6666ff.svg" alt="minimal R version"></a></td>
<td><a href="https://www.tidyverse.org/lifecycle/"><img src="https://img.shields.io/badge/lifecycle-maturing-blue.svg" alt="lifecycle"></a></td>
<td><a href="https://CRAN.R-project.org/package=ggstatsplot"><img src="https://cranlogs.r-pkg.org/badges/last-month/ggstatsplot?color=blue" alt="Monthly downloads badge"></a></td>
<td><a href="https://github.com/IndrajeetPatil/ggstatsplot/issues"><img src="https://img.shields.io/badge/issues-20-red.svg" alt="Github Issues"></a></td>
<td><a href="https://CRAN.R-project.org/package=ggstatsplot/vignettes/"><img src="https://img.shields.io/badge/vignettes-0.0.12-orange.svg?colorB=FF5722" alt="vignettes"></a></td>
</tr>
<tr class="even">
<td><a href="https://github.com/IndrajeetPatil/ggstatsplot"><img src="https://img.shields.io/github/languages/code-size/IndrajeetPatil/ggstatsplot.svg" alt="GitHub code size in bytes"></a></td>
<td><a href="https://coveralls.io/github/IndrajeetPatil/ggstatsplot?branch=master"><img src="https://coveralls.io/repos/github/IndrajeetPatil/ggstatsplot/badge.svg?branch=master" alt="Coverage Status"></a></td>
<td><a href="https://CRAN.R-project.org/package=ggstatsplot"><img src="https://cranlogs.r-pkg.org/badges/grand-total/ggstatsplot?color=blue" alt="Total downloads badge"></a></td>
<td><a href="https://github.com/IndrajeetPatil/ggstatsplot"><img src="https://img.shields.io/github/stars/IndrajeetPatil/ggstatsplot.svg?style=social&label=Github" alt="Github Stars"></a></td>
<td><a href="https://doi.org/10.5281/zenodo.2074621"><img src="https://zenodo.org/badge/DOI/10.5281/zenodo.2074621.svg" alt="DOI"></a></td>
</tr>
<tr class="odd">
<td><a href="https://www.gnu.org/licenses/gpl-3.0.en.html"><img src="https://img.shields.io/badge/licence-GPL--3-blue.svg" alt="Licence"></a></td>
<td><a href="https://codecov.io/gh/IndrajeetPatil/ggstatsplot?branch=master"><img src="https://codecov.io/gh/IndrajeetPatil/ggstatsplot/branch/master/graph/badge.svg" alt="Codecov test coverage"></a></td>
<td><a href="http://hits.dwyl.io/IndrajeetPatil/ggstatsplot"><img src="http://hits.dwyl.io/IndrajeetPatil/ggstatsplot.svg" alt="HitCount"></a></td>
<td><a href="https://github.com/IndrajeetPatil/ggstatsplot/commits/master"><img src="https://img.shields.io/badge/last%20change-2019--07--12-yellowgreen.svg" alt="Last-changedate"></a></td>
<td><a href="https://github.com/IndrajeetPatil/ggstatsplot/commits/master"><img src="https://img.shields.io/github/last-commit/IndrajeetPatil/ggstatsplot.svg" alt="GitHub last commit"></a></td>
</tr>
<tr class="even">
<td><a href="https://CRAN.R-project.org/package=ggstatsplot"><img src="https://tinyverse.netlify.com/badge/ggstatsplot" alt="status"></a></td>
<td><a href="https://github.com/IndrajeetPatil/ggstatsplot/blob/master/tests/README.md"><img src="https://img.shields.io/badge/covrpage-Last_Build_2019_07_12-yellowgreen.svg" alt="Covrpage Summary"></a></td>
<td><a href="https://saythanks.io/to/IndrajeetPatil"><img src="https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg" alt="saythanks"></a></td>
<td><a href="http://www.repostatus.org/#active"><img src="http://www.repostatus.org/badges/latest/active.svg" alt="Project Status"></a></td>
<td><a href="https://github.com/IndrajeetPatil/ggstatsplot/issues"><img src="https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat" alt="contributions welcome"></a></td>
</tr>
<tr class="odd">
<td><a href="https://gitter.im/ggstatsplot/community"><img src="https://badges.gitter.im/gitterHQ/gitter.png" alt="Gitter chat"></a></td>
<td><a href="https://dependencyci.com/github/IndrajeetPatil/ggstatsplot"><img src="https://dependencyci.com/github/IndrajeetPatil/ggstatsplot/badge" alt="Dependency Status"></a></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div id="overview" class="section level1">
<h1 class="hasAnchor">
<a href="#overview" class="anchor"></a>Overview</h1>
<p><a href="https://indrajeetpatil.github.io/ggstatsplot/"><code>ggstatsplot</code></a> is an extension of <a href="https://github.com/tidyverse/ggplot2"><code>ggplot2</code></a> package for creating graphics with details from statistical tests included in the plots themselves and targeted primarily at behavioral sciences community to provide a one-line code to produce information-rich plots. In a typical exploratory data analysis workflow, data visualization and statistical modeling are two different phases: visualization informs modeling, and modeling in its turn can suggest a different visualization method, and so on and so forth. The central idea of <em>ggstatsplot</em> is simple: combine these two phases into one in the form of graphics with statistical details, which makes data exploration simpler and faster.</p>
</div>
<div id="summary-of-types-of-statistical-analyses" class="section level1">
<h1 class="hasAnchor">
<a href="#summary-of-types-of-statistical-analyses" class="anchor"></a>Summary of types of statistical analyses</h1>
<p>Currently, it supports only the most common types of statistical tests: <strong>parametric</strong>, <strong>nonparametric</strong>, <strong>robust</strong>, and <strong>bayesian</strong> versions of <strong>t-test</strong>/<strong>anova</strong>, <strong>correlation</strong> analyses, <strong>contingency table</strong> analysis, and <strong>regression</strong> analyses.</p>
<p>It, therefore, produces a limited kinds of plots for the supported analyses:</p>
<ul>
<li>
<strong>violin plots</strong> (for comparisons <em>between</em> groups or conditions),</li>
<li>
<strong>pie charts</strong> and <strong>bar charts</strong> (for categorical data),</li>
<li>
<strong>scatterplots</strong> (for correlations between two variables),</li>
<li>
<strong>correlation matrices</strong> (for correlations between multiple variables),</li>
<li>
<strong>histograms</strong> and <strong>dot plots/charts</strong> (for hypothesis about distributions),</li>
<li>
<strong>dot-and-whisker plots</strong> (for regression models).</li>
</ul>
<p>In addition to these basic plots, <code>ggstatsplot</code> also provides <strong><code>grouped_</code></strong> versions for most functions that makes it easy to repeat the same analysis for any grouping variable.</p>
<p>Future versions will include other types of statistical analyses and plots as well.</p>
<p>The table below summarizes all the different types of analyses currently supported in this package-</p>
<table class="table table">
<colgroup>
<col width="16%">
<col width="41%">
<col width="9%">
<col width="11%">
<col width="9%">
<col width="11%">
</colgroup>
<thead><tr class="header">
<th>Functions</th>
<th>Description</th>
<th>Parametric</th>
<th>Non-parametric</th>
<th>Robust</th>
<th>Bayes Factor</th>
</tr></thead>
<tbody>
<tr class="odd">
<td><code>ggbetweenstats</code></td>
<td>Between group/condition comparisons</td>
<td><font color="green">Yes</font></td>
<td><font color="green">Yes</font></td>
<td><font color="green">Yes</font></td>
<td><font color="green">Yes</font></td>
</tr>
<tr class="even">
<td><code>ggwithinstats</code></td>
<td>Within group/condition comparisons</td>
<td><font color="green">Yes</font></td>
<td><font color="green">Yes</font></td>
<td><font color="green">Yes</font></td>
<td><font color="green">Yes</font></td>
</tr>
<tr class="odd">
<td>
<code>gghistostats</code>, <code>ggdotplotstats</code>
</td>
<td>Distribution of a numeric variable</td>
<td><font color="green">Yes</font></td>
<td><font color="green">Yes</font></td>
<td><font color="green">Yes</font></td>
<td><font color="green">Yes</font></td>
</tr>
<tr class="even">
<td><code>ggcorrmat</code></td>
<td>Correlation matrix</td>
<td><font color="green">Yes</font></td>
<td><font color="green">Yes</font></td>
<td><font color="green">Yes</font></td>
<td><font color="red">No</font></td>
</tr>
<tr class="odd">
<td><code>ggscatterstats</code></td>
<td>Correlation between two variables</td>
<td><font color="green">Yes</font></td>
<td><font color="green">Yes</font></td>
<td><font color="green">Yes</font></td>
<td><font color="green">Yes</font></td>
</tr>
<tr class="even">
<td>
<code>ggpiestats</code>, <code>ggbarstats</code>
</td>
<td>Association between categorical variables</td>
<td><font color="green">Yes</font></td>
<td><code>NA</code></td>
<td><code>NA</code></td>
<td><font color="green">Yes</font></td>
</tr>
<tr class="odd">
<td>
<code>ggpiestats</code>, <code>ggbarstats</code>
</td>
<td>Equal proportions for categorical variable levels</td>
<td><font color="green">Yes</font></td>
<td><code>NA</code></td>
<td><code>NA</code></td>
<td><font color="green">Yes</font></td>
</tr>
<tr class="even">
<td><code>ggcoefstats</code></td>
<td>Regression model coefficients</td>
<td><font color="green">Yes</font></td>
<td><font color="red">No</font></td>
<td><font color="green">Yes</font></td>
<td><font color="red">No</font></td>
</tr>
</tbody>
</table>
</div>
<div id="statistical-reporting" class="section level1">
<h1 class="hasAnchor">
<a href="#statistical-reporting" class="anchor"></a>Statistical reporting</h1>
<p>For <strong>all</strong> statistical tests reported in the plots, the default template abides by the <a href="https://my.ilstu.edu/~jhkahn/apastats.html">APA</a> gold standard for statistical reporting. For example, here are results from Yuen’s test for trimmed means (robust <em>t</em>-test):</p>
<p><img src="reference/figures/stats_reporting_format.png" align="center"></p>
</div>
<div id="summary-of-statistical-tests-and-effect-sizes" class="section level1">
<h1 class="hasAnchor">
<a href="#summary-of-statistical-tests-and-effect-sizes" class="anchor"></a>Summary of statistical tests and effect sizes</h1>
<p>Here is a summary table of all the statistical tests currently supported across various functions:</p>
<table class="table table">
<colgroup>
<col width="17%">
<col width="17%">
<col width="28%">
<col width="28%">
<col width="7%">
</colgroup>
<thead><tr class="header">
<th>Functions</th>
<th>Type</th>
<th>Test</th>
<th>Effect size</th>
<th>95% CI available?</th>
</tr></thead>
<tbody>
<tr class="odd">
<td><code>ggbetweenstats</code></td>
<td>Parametric</td>
<td>Student’s and Welch’s <em>t</em>-test</td>
<td>Cohen’s <em>d</em>, Hedge’s <em>g</em>
</td>
<td><font color="green"><span class="math inline">\(\checkmark\)</span></font></td>
</tr>
<tr class="even">
<td><code>ggbetweenstats</code></td>
<td>Parametric</td>
<td>Fisher’s and Welch’s one-way ANOVA</td>
<td><span class="math display">\[\eta^2, \eta^2_p, \omega^2, \omega^2_p\]</span></td>
<td><font color="green"><span class="math inline">\(\checkmark\)</span></font></td>
</tr>
<tr class="odd">
<td><code>ggbetweenstats</code></td>
<td>Non-parametric</td>
<td>Mann-Whitney <em>U</em>-test</td>
<td><em>r</em></td>
<td><font color="green"><span class="math inline">\(\checkmark\)</span></font></td>
</tr>
<tr class="even">
<td><code>ggbetweenstats</code></td>
<td>Non-parametric</td>
<td>Kruskal-Wallis Rank Sum Test</td>
<td><span class="math display">\[\epsilon^2\]</span></td>
<td><font color="green"><span class="math inline">\(\checkmark\)</span></font></td>
</tr>
<tr class="odd">
<td><code>ggbetweenstats</code></td>
<td>Robust</td>
<td>Yuen’s test for trimmed means</td>
<td><span class="math display">\[\xi\]</span></td>
<td><font color="green"><span class="math inline">\(\checkmark\)</span></font></td>
</tr>
<tr class="even">
<td><code>ggbetweenstats</code></td>
<td>Robust</td>
<td>Heteroscedastic one-way ANOVA for trimmed means</td>
<td><span class="math display">\[\xi\]</span></td>
<td><font color="green"><span class="math inline">\(\checkmark\)</span></font></td>
</tr>
<tr class="odd">
<td><code>ggwithinstats</code></td>
<td>Parametric</td>
<td>Student’s <em>t</em>-test</td>
<td>Cohen’s <em>d</em>, Hedge’s <em>g</em>
</td>
<td><font color="green"><span class="math inline">\(\checkmark\)</span></font></td>
</tr>
<tr class="even">
<td><code>ggwithinstats</code></td>
<td>Parametric</td>
<td>Fisher’s one-way repeated measures ANOVA</td>
<td><span class="math display">\[\eta^2_p, \omega^2\]</span></td>
<td><font color="green"><span class="math inline">\(\checkmark\)</span></font></td>
</tr>
<tr class="odd">
<td><code>ggwithinstats</code></td>
<td>Non-parametric</td>
<td>Wilcoxon signed-rank test</td>
<td><em>r</em></td>
<td><font color="green"><span class="math inline">\(\checkmark\)</span></font></td>
</tr>
<tr class="even">
<td><code>ggwithinstats</code></td>
<td>Non-parametric</td>
<td>Friedman test</td>
<td><span class="math display">\[W_{Kendall}\]</span></td>
<td><font color="green"><span class="math inline">\(\checkmark\)</span></font></td>
</tr>
<tr class="odd">
<td><code>ggwithinstats</code></td>
<td>Robust</td>
<td>Yuen’s test on trimmed means for dependent samples</td>
<td><span class="math display">\[\xi\]</span></td>
<td><font color="green"><span class="math inline">\(\checkmark\)</span></font></td>
</tr>
<tr class="even">
<td><code>ggwithinstats</code></td>
<td>Robust</td>
<td>Heteroscedastic one-way repeated measures ANOVA for trimmed means</td>
<td><font color="red"><span class="math inline">\(\times\)</span></font></td>
<td><font color="red"><span class="math inline">\(\times\)</span></font></td>
</tr>
<tr class="odd">
<td><code>ggpiestats</code></td>
<td>Parametric</td>
<td><span class="math display">\[\text{Pearson's}~ \chi^2 ~\text{test}\]</span></td>
<td>Cramér’s <em>V</em>
</td>
<td><font color="green"><span class="math inline">\(\checkmark\)</span></font></td>
</tr>
<tr class="even">
<td><code>ggpiestats</code></td>
<td>Parametric</td>
<td>McNemar’s test</td>
<td>Cohen’s <em>g</em>
</td>
<td><font color="green"><span class="math inline">\(\checkmark\)</span></font></td>
</tr>
<tr class="odd">
<td><code>ggpiestats</code></td>
<td>Parametric</td>
<td>One-sample proportion test</td>
<td>Cramér’s <em>V</em>
</td>
<td><font color="green"><span class="math inline">\(\checkmark\)</span></font></td>
</tr>
<tr class="even">
<td>
<code>ggscatterstats</code>/<code>ggcorrmat</code>
</td>
<td>Parametric</td>
<td>Pearson’s <em>r</em>
</td>
<td><em>r</em></td>
<td><font color="green"><span class="math inline">\(\checkmark\)</span></font></td>
</tr>
<tr class="odd">
<td>
<code>ggscatterstats</code>/<code>ggcorrmat</code>
</td>
<td>Non-parametric</td>
<td><span class="math display">\[\text{Spearman's}~ \rho\]</span></td>
<td><span class="math display">\[\rho\]</span></td>
<td><font color="green"><span class="math inline">\(\checkmark\)</span></font></td>
</tr>
<tr class="even">
<td>
<code>ggscatterstats</code>/<code>ggcorrmat</code>
</td>
<td>Robust</td>
<td>Percentage bend correlation</td>
<td><em>r</em></td>
<td><font color="green"><span class="math inline">\(\checkmark\)</span></font></td>
</tr>
<tr class="odd">
<td>
<code>gghistostats</code>/<code>ggdotplotstats</code>
</td>
<td>Parametric</td>
<td>One-sample <em>t</em>-test</td>
<td>Cohen’s <em>d</em>, Hedge’s <em>g</em>
</td>
<td><font color="green"><span class="math inline">\(\checkmark\)</span></font></td>
</tr>
<tr class="even">
<td><code>gghistostats</code></td>
<td>Non-parametric</td>
<td>One-sample Wilcoxon signed rank test</td>
<td><em>r</em></td>
<td><font color="green"><span class="math inline">\(\checkmark\)</span></font></td>
</tr>
<tr class="odd">
<td>
<code>gghistostats</code>/<code>ggdotplotstats</code>
</td>
<td>Robust</td>
<td>One-sample percentile bootstrap</td>
<td>robust estimator</td>
<td><font color="green"><span class="math inline">\(\checkmark\)</span></font></td>
</tr>
<tr class="even">
<td>
<code>gghistostats</code>/<code>ggdotplotstats</code>
</td>
<td>Parametric</td>
<td>Regression models</td>
<td><span class="math display">\[\beta\]</span></td>
<td><font color="green"><span class="math inline">\(\checkmark\)</span></font></td>
</tr>
</tbody>
</table>
<p>Work is in progress to add some of the currently missing functionality.</p>
</div>
<div id="installation" class="section level1">
<h1 class="hasAnchor">
<a href="#installation" class="anchor"></a>Installation</h1>
<p>To get the latest, stable <code>CRAN</code> release (<code>0.0.12</code>):</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" title="1">utils<span class="op">::</span><span class="kw"><a href="https://rdrr.io/r/utils/install.packages.html">install.packages</a></span>(<span class="dt">pkgs =</span> <span class="st">"ggstatsplot"</span>)</a></code></pre></div>
<p><em>Note</em>: If you are on a linux machine, you will need to have OpenGL libraries installed (specifically, <code>libx11</code>, <code>mesa</code> and Mesa OpenGL Utility library - <code>glu</code>) for the dependency package <code>rgl</code> to work.</p>
<p>You can get the <strong>development</strong> version of the package from GitHub (<code>0.0.12.9000</code>). To see what new changes (and bug fixes) have been made to the package since the last release on <code>CRAN</code>, you can check the detailed log of changes here: <a href="https://indrajeetpatil.github.io/ggstatsplot/news/index.html" class="uri">https://indrajeetpatil.github.io/ggstatsplot/news/index.html</a></p>
<p>If you are in hurry and want to reduce the time of installation, prefer-</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" title="1"><span class="co"># needed package to download from GitHub repo</span></a>
<a class="sourceLine" id="cb2-2" title="2">utils<span class="op">::</span><span class="kw"><a href="https://rdrr.io/r/utils/install.packages.html">install.packages</a></span>(<span class="dt">pkgs =</span> <span class="st">"remotes"</span>)</a>
<a class="sourceLine" id="cb2-3" title="3"></a>
<a class="sourceLine" id="cb2-4" title="4"><span class="co"># downloading the package from GitHub</span></a>
<a class="sourceLine" id="cb2-5" title="5">remotes<span class="op">::</span><span class="kw"><a href="https://rdrr.io/pkg/remotes/man/install_github.html">install_github</a></span>(</a>
<a class="sourceLine" id="cb2-6" title="6"> <span class="dt">repo =</span> <span class="st">"IndrajeetPatil/ggstatsplot"</span>, <span class="co"># package path on GitHub</span></a>
<a class="sourceLine" id="cb2-7" title="7"> <span class="dt">dependencies =</span> <span class="ot">FALSE</span>, <span class="co"># assumes you have already installed needed packages</span></a>
<a class="sourceLine" id="cb2-8" title="8"> <span class="dt">quick =</span> <span class="ot">TRUE</span> <span class="co"># skips docs, demos, and vignettes</span></a>
<a class="sourceLine" id="cb2-9" title="9">)</a></code></pre></div>
<p>If time is not a constraint-</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" title="1">remotes<span class="op">::</span><span class="kw"><a href="https://rdrr.io/pkg/remotes/man/install_github.html">install_github</a></span>(</a>
<a class="sourceLine" id="cb3-2" title="2"> <span class="dt">repo =</span> <span class="st">"IndrajeetPatil/ggstatsplot"</span>, <span class="co"># package path on GitHub</span></a>
<a class="sourceLine" id="cb3-3" title="3"> <span class="dt">dependencies =</span> <span class="ot">TRUE</span>, <span class="co"># installs packages which ggstatsplot depends on</span></a>
<a class="sourceLine" id="cb3-4" title="4"> <span class="dt">upgrade_dependencies =</span> <span class="ot">TRUE</span> <span class="co"># updates any out of date dependencies</span></a>
<a class="sourceLine" id="cb3-5" title="5">)</a></code></pre></div>
<p>If you are not using the <a href="https://www.rstudio.com/">RStudio IDE</a> and you get an error related to “pandoc” you will either need to remove the argument <code>build_vignettes = TRUE</code> (to avoid building the vignettes) or install <a href="http://pandoc.org/">pandoc</a>. If you have the <code>rmarkdown</code> R package installed then you can check if you have pandoc by running the following in R:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" title="1">rmarkdown<span class="op">::</span><span class="kw"><a href="https://rdrr.io/pkg/rmarkdown/man/pandoc_available.html">pandoc_available</a></span>()</a>
<a class="sourceLine" id="cb4-2" title="2"><span class="co">#> [1] TRUE</span></a></code></pre></div>
</div>
<div id="citation" class="section level1">
<h1 class="hasAnchor">
<a href="#citation" class="anchor"></a>Citation</h1>
<p>If you want to cite this package in a scientific journal or in any other context, run the following code in your <code>R</code> console:</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" title="1"><span class="kw"><a href="https://rdrr.io/r/utils/citation.html">citation</a></span>(<span class="st">"ggstatsplot"</span>)</a></code></pre></div>
<p>There is currently a publication in preparation corresponding to this package and the citation will be updated once it’s published.</p>
</div>
<div id="documentation-and-examples" class="section level1">
<h1 class="hasAnchor">
<a href="#documentation-and-examples" class="anchor"></a>Documentation and Examples</h1>
<p>To see the detailed documentation for each function in the stable <strong>CRAN</strong> version of the package, see:</p>
<ul>
<li>README: <a href="https://CRAN.R-project.org/package=ggstatsplot/readme/README.html" class="uri">https://CRAN.R-project.org/package=ggstatsplot/readme/README.html</a>
</li>
<li>Presentation: <a href="https://indrajeetpatil.github.io/ggstatsplot_slides/slides/ggstatsplot_presentation.html#1" class="uri">https://indrajeetpatil.github.io/ggstatsplot_slides/slides/ggstatsplot_presentation.html#1</a>
</li>
<li>Vignettes: <a href="https://CRAN.R-project.org/package=ggstatsplot/vignettes/additional.html" class="uri">https://CRAN.R-project.org/package=ggstatsplot/vignettes/additional.html</a>
</li>
</ul>
<p>To see the documentation relevant for the <strong>development</strong> version of the package, see the dedicated website for <code>ggstatplot</code>, which is updated after every new commit: <a href="https://indrajeetpatil.github.io/ggstatsplot/" class="uri">https://indrajeetpatil.github.io/ggstatsplot/</a>.</p>
<div id="help" class="section level2">
<h2 class="hasAnchor">
<a href="#help" class="anchor"></a>Help</h2>
<p>In <code>R</code>, documentation for any function can be accessed with the standard <code>help</code> command (e.g., <code><a href="reference/ggbetweenstats.html">?ggbetweenstats</a></code>).</p>
<p>Another handy tool to see arguments to any of the functions is <code>args</code>. For example-</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" title="1"><span class="kw"><a href="https://rdrr.io/r/base/args.html">args</a></span>(<span class="dt">name =</span> ggstatsplot<span class="op">::</span>specify_decimal_p)</a>
<a class="sourceLine" id="cb6-2" title="2"><span class="co">#> function (x, k = 3, p.value = FALSE) </span></a>
<a class="sourceLine" id="cb6-3" title="3"><span class="co">#> NULL</span></a></code></pre></div>
<p>In case you want to look at the function body for any of the functions, just type the name of the function without the parentheses:</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" title="1"><span class="co"># function to convert class of any object to `ggplot` class</span></a>
<a class="sourceLine" id="cb7-2" title="2">ggstatsplot<span class="op">::</span>ggplot_converter</a>
<a class="sourceLine" id="cb7-3" title="3"><span class="co">#> function(plot) {</span></a>
<a class="sourceLine" id="cb7-4" title="4"><span class="co">#> # convert the saved plot</span></a>
<a class="sourceLine" id="cb7-5" title="5"><span class="co">#> p <- cowplot::ggdraw() +</span></a>
<a class="sourceLine" id="cb7-6" title="6"><span class="co">#> cowplot::draw_grob(grid::grobTree(plot))</span></a>
<a class="sourceLine" id="cb7-7" title="7"><span class="co">#> </span></a>
<a class="sourceLine" id="cb7-8" title="8"><span class="co">#> # returning the converted plot</span></a>
<a class="sourceLine" id="cb7-9" title="9"><span class="co">#> return(p)</span></a>
<a class="sourceLine" id="cb7-10" title="10"><span class="co">#> }</span></a>
<a class="sourceLine" id="cb7-11" title="11"><span class="co">#> <bytecode: 0x00000000331a1778></span></a>
<a class="sourceLine" id="cb7-12" title="12"><span class="co">#> <environment: namespace:ggstatsplot></span></a></code></pre></div>
<p>If you are not familiar either with what the namespace <code>::</code> does or how to use pipe operator <code><a href="https://rdrr.io/pkg/magrittr/man/pipe.html">%>%</a></code>, something this package and its documentation relies a lot on, you can check out these links-</p>
<ul>
<li><a href="http://r-pkgs.had.co.nz/namespace.html" class="uri">http://r-pkgs.had.co.nz/namespace.html</a></li>
<li><a href="http://r4ds.had.co.nz/pipes.html" class="uri">http://r4ds.had.co.nz/pipes.html</a></li>
</ul>
</div>
</div>
<div id="usage-and-syntax" class="section level1">
<h1 class="hasAnchor">
<a href="#usage-and-syntax" class="anchor"></a>Usage and syntax</h1>
<p><code>ggstatsplot</code> relies on non-standard evaluation (NSE), i.e., rather than looking at the values of arguments (<code>x</code>, <code>y</code>), it instead looks at their expressions. This means that you <strong>shouldn’t</strong> enter arguments with the <code><a href="https://rdrr.io/r/base/Extract.html">$</a></code> operator and set <code>data = NULL</code> (e.g., <code>data = NULL, x = data$x, y = data$y</code>). You <strong>must</strong> always specify the <code>data</code> argument for all functions. On the plus side, you can enter arguments either as a string (<code>x = "x", y = "y"</code>) or as a bare expression (<code>x = x, y = y</code>) and it wouldn’t matter. To read more about NSE, see- <a href="http://adv-r.had.co.nz/Computing-on-the-language.html" class="uri">http://adv-r.had.co.nz/Computing-on-the-language.html</a></p>
<p><code>ggstatsplot</code> is a very chatty package and will by default print helpful notes on assumptions about statistical tests, warnings, etc. If you don’t want your console to be cluttered with such messages, they can be turned off by setting argument <code>messages = FALSE</code> in the function call.</p>
<p>Most functions share a <code>type</code> (of test) argument that is helpful to specify the type of statistical analysis:</p>
<ul>
<li>
<code>"p"</code> (for <strong>parametric</strong>)</li>
<li>
<code>"np"</code> (for <strong>non-parametric</strong>)</li>
<li>
<code>"r"</code> (for <strong>robust</strong>)</li>
<li>
<code>"bf"</code> (for <strong>Bayes Factor</strong>)</li>
</ul>
<p>All relevant functions in <code>ggstatsplot</code> have a <code>return</code> argument which can be used to not only return plots (which is the default), but also to return a <code>subtitle</code> or <code>caption</code>, which are objects of type <code>call</code> and can be used to display statistical details in conjunction with a custom plot and at a custom location in the plot.</p>
<p>Additionally, all functions share the <code>ggtheme</code> and <code>palette</code> arguments that can be used to specify your favorite <code>ggplot</code> theme and color palette.</p>
</div>
<div id="primary-functions" class="section level1">
<h1 class="hasAnchor">
<a href="#primary-functions" class="anchor"></a>Primary functions</h1>
<p>Here are examples of the main functions currently supported in <code>ggstatsplot</code>.</p>
<p><strong>Note</strong>: If you are reading this on <code>GitHub</code> repository, the documentation below is for the <strong>development</strong> version of the package. So you may see some features available here that are not currently present in the stable version of this package on <strong>CRAN</strong>. For documentation relevant for the <code>CRAN</code> version, see: <a href="https://CRAN.R-project.org/package=ggstatsplot/readme/README.html" class="uri">https://CRAN.R-project.org/package=ggstatsplot/readme/README.html</a></p>
<div id="ggbetweenstats" class="section level2">
<h2 class="hasAnchor">
<a href="#ggbetweenstats" class="anchor"></a><code>ggbetweenstats</code>
</h2>
<p>This function creates either a violin plot, a box plot, or a mix of two for <strong>between</strong>-group or <strong>between</strong>-condition comparisons with results from statistical tests in the subtitle. The simplest function call looks like this-</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb8-1" title="1"><span class="co"># loading needed libraries</span></a>
<a class="sourceLine" id="cb8-2" title="2"><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span>(ggstatsplot)</a>
<a class="sourceLine" id="cb8-3" title="3"></a>
<a class="sourceLine" id="cb8-4" title="4"><span class="co"># for reproducibility</span></a>
<a class="sourceLine" id="cb8-5" title="5"><span class="kw"><a href="https://rdrr.io/r/base/Random.html">set.seed</a></span>(<span class="dv">123</span>)</a>
<a class="sourceLine" id="cb8-6" title="6"></a>
<a class="sourceLine" id="cb8-7" title="7"><span class="co"># plot</span></a>
<a class="sourceLine" id="cb8-8" title="8">ggstatsplot<span class="op">::</span><span class="kw"><a href="https://indrajeetpatil.github.io/ggstatsplot//reference/ggbetweenstats.html">ggbetweenstats</a></span>(</a>
<a class="sourceLine" id="cb8-9" title="9"> <span class="dt">data =</span> iris,</a>
<a class="sourceLine" id="cb8-10" title="10"> <span class="dt">x =</span> Species,</a>
<a class="sourceLine" id="cb8-11" title="11"> <span class="dt">y =</span> Sepal.Length,</a>
<a class="sourceLine" id="cb8-12" title="12"> <span class="dt">messages =</span> <span class="ot">FALSE</span></a>
<a class="sourceLine" id="cb8-13" title="13">) <span class="op">+</span><span class="st"> </span><span class="co"># further modification outside of ggstatsplot</span></a>
<a class="sourceLine" id="cb8-14" title="14"><span class="st"> </span>ggplot2<span class="op">::</span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/coord_cartesian.html">coord_cartesian</a></span>(<span class="dt">ylim =</span> <span class="kw"><a href="https://rdrr.io/r/base/c.html">c</a></span>(<span class="dv">3</span>, <span class="dv">8</span>)) <span class="op">+</span></a>
<a class="sourceLine" id="cb8-15" title="15"><span class="st"> </span>ggplot2<span class="op">::</span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/scale_continuous.html">scale_y_continuous</a></span>(<span class="dt">breaks =</span> <span class="kw"><a href="https://rdrr.io/r/base/seq.html">seq</a></span>(<span class="dv">3</span>, <span class="dv">8</span>, <span class="dt">by =</span> <span class="dv">1</span>))</a></code></pre></div>
<p><img src="reference/figures/README-ggbetweenstats1-1.png" width="100%"></p>
<p>Note that this function returns a <code>ggplot2</code> object and thus any of the graphics layers can be further modified.</p>
<p>The <code>type</code> (of test) argument also accepts the following abbreviations: <code>"p"</code> (for <em>parametric</em>) or <code>"np"</code> (for <em>nonparametric</em>) or <code>"r"</code> (for <em>robust</em>) or <code>"bf"</code> (for <em>Bayes Factor</em>). Additionally, the type of plot to be displayed can also be modified (<code>"box"</code>, <code>"violin"</code>, or <code>"boxviolin"</code>).</p>
<p>A number of other arguments can be specified to make this plot even more informative or change some of the default options.</p>
<div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb9-1" title="1"><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span>(ggplot2)</a>
<a class="sourceLine" id="cb9-2" title="2"></a>
<a class="sourceLine" id="cb9-3" title="3"><span class="co"># for reproducibility</span></a>
<a class="sourceLine" id="cb9-4" title="4"><span class="kw"><a href="https://rdrr.io/r/base/Random.html">set.seed</a></span>(<span class="dv">123</span>)</a>
<a class="sourceLine" id="cb9-5" title="5"></a>
<a class="sourceLine" id="cb9-6" title="6"><span class="co"># let's leave out one of the factor levels and see if instead of anova, a t-test will be run</span></a>
<a class="sourceLine" id="cb9-7" title="7">iris2 <-<span class="st"> </span>dplyr<span class="op">::</span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span>(<span class="dt">.data =</span> iris, Species <span class="op">!=</span><span class="st"> "setosa"</span>)</a>
<a class="sourceLine" id="cb9-8" title="8"></a>
<a class="sourceLine" id="cb9-9" title="9"><span class="co"># let's change the levels of our factors, a common routine in data analysis</span></a>
<a class="sourceLine" id="cb9-10" title="10"><span class="co"># pipeline, to see if this function respects the new factor levels</span></a>
<a class="sourceLine" id="cb9-11" title="11">iris2<span class="op">$</span>Species <-</a>
<a class="sourceLine" id="cb9-12" title="12"><span class="st"> </span>base<span class="op">::</span><span class="kw"><a href="https://rdrr.io/r/base/factor.html">factor</a></span>(</a>
<a class="sourceLine" id="cb9-13" title="13"> <span class="dt">x =</span> iris2<span class="op">$</span>Species,</a>
<a class="sourceLine" id="cb9-14" title="14"> <span class="dt">levels =</span> <span class="kw"><a href="https://rdrr.io/r/base/c.html">c</a></span>(<span class="st">"virginica"</span>, <span class="st">"versicolor"</span>)</a>
<a class="sourceLine" id="cb9-15" title="15"> )</a>
<a class="sourceLine" id="cb9-16" title="16"></a>
<a class="sourceLine" id="cb9-17" title="17"><span class="co"># plot</span></a>
<a class="sourceLine" id="cb9-18" title="18">ggstatsplot<span class="op">::</span><span class="kw"><a href="https://indrajeetpatil.github.io/ggstatsplot//reference/ggbetweenstats.html">ggbetweenstats</a></span>(</a>
<a class="sourceLine" id="cb9-19" title="19"> <span class="dt">data =</span> iris2,</a>
<a class="sourceLine" id="cb9-20" title="20"> <span class="dt">x =</span> Species,</a>
<a class="sourceLine" id="cb9-21" title="21"> <span class="dt">y =</span> Sepal.Length,</a>
<a class="sourceLine" id="cb9-22" title="22"> <span class="dt">notch =</span> <span class="ot">TRUE</span>, <span class="co"># show notched box plot</span></a>
<a class="sourceLine" id="cb9-23" title="23"> <span class="dt">mean.plotting =</span> <span class="ot">TRUE</span>, <span class="co"># whether mean for each group is to be displayed</span></a>
<a class="sourceLine" id="cb9-24" title="24"> <span class="dt">mean.ci =</span> <span class="ot">TRUE</span>, <span class="co"># whether to display confidence interval for means</span></a>
<a class="sourceLine" id="cb9-25" title="25"> <span class="dt">mean.label.size =</span> <span class="fl">2.5</span>, <span class="co"># size of the label for mean</span></a>
<a class="sourceLine" id="cb9-26" title="26"> <span class="dt">type =</span> <span class="st">"p"</span>, <span class="co"># which type of test is to be run</span></a>
<a class="sourceLine" id="cb9-27" title="27"> <span class="dt">k =</span> <span class="dv">3</span>, <span class="co"># number of decimal places for statistical results</span></a>
<a class="sourceLine" id="cb9-28" title="28"> <span class="dt">outlier.tagging =</span> <span class="ot">TRUE</span>, <span class="co"># whether outliers need to be tagged</span></a>
<a class="sourceLine" id="cb9-29" title="29"> <span class="dt">outlier.label =</span> Sepal.Width, <span class="co"># variable to be used for the outlier tag</span></a>
<a class="sourceLine" id="cb9-30" title="30"> <span class="dt">outlier.label.color =</span> <span class="st">"darkgreen"</span>, <span class="co"># changing the color for the text label</span></a>
<a class="sourceLine" id="cb9-31" title="31"> <span class="dt">xlab =</span> <span class="st">"Type of Species"</span>, <span class="co"># label for the x-axis variable</span></a>
<a class="sourceLine" id="cb9-32" title="32"> <span class="dt">ylab =</span> <span class="st">"Attribute: Sepal Length"</span>, <span class="co"># label for the y-axis variable</span></a>
<a class="sourceLine" id="cb9-33" title="33"> <span class="dt">title =</span> <span class="st">"Dataset: Iris flower data set"</span>, <span class="co"># title text for the plot</span></a>
<a class="sourceLine" id="cb9-34" title="34"> <span class="dt">ggtheme =</span> ggthemes<span class="op">::</span><span class="kw"><a href="https://rdrr.io/pkg/ggthemes/man/theme_fivethirtyeight.html">theme_fivethirtyeight</a></span>(), <span class="co"># choosing a different theme</span></a>
<a class="sourceLine" id="cb9-35" title="35"> <span class="dt">ggstatsplot.layer =</span> <span class="ot">FALSE</span>, <span class="co"># turn off ggstatsplot theme layer</span></a>
<a class="sourceLine" id="cb9-36" title="36"> <span class="dt">package =</span> <span class="st">"wesanderson"</span>, <span class="co"># package from which color palette is to be taken</span></a>
<a class="sourceLine" id="cb9-37" title="37"> <span class="dt">palette =</span> <span class="st">"Darjeeling1"</span>, <span class="co"># choosing a different color palette</span></a>
<a class="sourceLine" id="cb9-38" title="38"> <span class="dt">messages =</span> <span class="ot">FALSE</span></a>
<a class="sourceLine" id="cb9-39" title="39">)</a></code></pre></div>
<p><img src="reference/figures/README-ggbetweenstats2-1.png" width="100%"></p>
<p>As can be seen from the plot, the function by default returns Bayes Factor for the test (here, Student’s <em>t</em>-test). If the null hypothesis can’t be rejected with the null hypothesis significance testing (NHST) approach, the Bayesian approach can help index evidence in favor of the null hypothesis (i.e., <span class="math inline">\(BF_{01}\)</span>).</p>
<p>By default, natural logarithms are shown because Bayes Factor values can sometimes be pretty large. Having values on logarithmic scale also makes it easy to compare evidence in favor alternative (<span class="math inline">\(BF_{10}\)</span>) versus null (<span class="math inline">\(BF_{01}\)</span>) hypotheses (since <span class="math inline">\(log_{e}(BF_{01}) = - log_{e}(BF_{01})\)</span>).</p>
<p>Additionally, there is also a <code>grouped_</code> variant of this function that makes it easy to repeat the same operation across a <strong>single</strong> grouping variable:</p>
<div class="sourceCode" id="cb10"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb10-1" title="1"><span class="co"># for reproducibility</span></a>
<a class="sourceLine" id="cb10-2" title="2"><span class="kw"><a href="https://rdrr.io/r/base/Random.html">set.seed</a></span>(<span class="dv">123</span>)</a>
<a class="sourceLine" id="cb10-3" title="3"></a>
<a class="sourceLine" id="cb10-4" title="4"><span class="co"># plot</span></a>
<a class="sourceLine" id="cb10-5" title="5">ggstatsplot<span class="op">::</span><span class="kw"><a href="https://indrajeetpatil.github.io/ggstatsplot//reference/grouped_ggbetweenstats.html">grouped_ggbetweenstats</a></span>(</a>
<a class="sourceLine" id="cb10-6" title="6"> <span class="dt">data =</span> dplyr<span class="op">::</span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span>(</a>
<a class="sourceLine" id="cb10-7" title="7"> <span class="dt">.data =</span> ggstatsplot<span class="op">::</span>movies_long,</a>
<a class="sourceLine" id="cb10-8" title="8"> genre <span class="op">%in%</span><span class="st"> </span><span class="kw"><a href="https://rdrr.io/r/base/c.html">c</a></span>(<span class="st">"Action"</span>, <span class="st">"Action Comedy"</span>, <span class="st">"Action Drama"</span>, <span class="st">"Comedy"</span>)</a>
<a class="sourceLine" id="cb10-9" title="9"> ),</a>
<a class="sourceLine" id="cb10-10" title="10"> <span class="dt">x =</span> mpaa,</a>
<a class="sourceLine" id="cb10-11" title="11"> <span class="dt">y =</span> length,</a>
<a class="sourceLine" id="cb10-12" title="12"> <span class="dt">grouping.var =</span> genre, <span class="co"># grouping variable</span></a>
<a class="sourceLine" id="cb10-13" title="13"> <span class="dt">pairwise.comparisons =</span> <span class="ot">TRUE</span>, <span class="co"># display significant pairwise comparisons</span></a>
<a class="sourceLine" id="cb10-14" title="14"> <span class="dt">pairwise.annotation =</span> <span class="st">"p.value"</span>, <span class="co"># how do you want to annotate the pairwise comparisons</span></a>
<a class="sourceLine" id="cb10-15" title="15"> <span class="dt">p.adjust.method =</span> <span class="st">"bonferroni"</span>, <span class="co"># method for adjusting p-values for multiple comparisons</span></a>
<a class="sourceLine" id="cb10-16" title="16"> <span class="dt">conf.level =</span> <span class="fl">0.99</span>, <span class="co"># changing confidence level to 99%</span></a>
<a class="sourceLine" id="cb10-17" title="17"> <span class="dt">ggplot.component =</span> <span class="kw"><a href="https://rdrr.io/r/base/list.html">list</a></span>( <span class="co"># adding new components to `ggstatsplot` default</span></a>
<a class="sourceLine" id="cb10-18" title="18"> ggplot2<span class="op">::</span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/scale_continuous.html">scale_y_continuous</a></span>(<span class="dt">sec.axis =</span> ggplot2<span class="op">::</span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/sec_axis.html">dup_axis</a></span>())</a>
<a class="sourceLine" id="cb10-19" title="19"> ),</a>
<a class="sourceLine" id="cb10-20" title="20"> <span class="dt">k =</span> <span class="dv">3</span>,</a>
<a class="sourceLine" id="cb10-21" title="21"> <span class="dt">title.prefix =</span> <span class="st">"Movie genre"</span>,</a>
<a class="sourceLine" id="cb10-22" title="22"> <span class="dt">caption =</span> <span class="kw"><a href="https://rdrr.io/r/base/substitute.html">substitute</a></span>(<span class="kw"><a href="https://rdrr.io/r/base/paste.html">paste</a></span>(</a>
<a class="sourceLine" id="cb10-23" title="23"> <span class="kw"><a href="https://rdrr.io/r/grDevices/plotmath.html">italic</a></span>(<span class="st">"Source"</span>),</a>
<a class="sourceLine" id="cb10-24" title="24"> <span class="st">":IMDb (Internet Movie Database)"</span></a>
<a class="sourceLine" id="cb10-25" title="25"> )),</a>
<a class="sourceLine" id="cb10-26" title="26"> <span class="dt">palette =</span> <span class="st">"default_jama"</span>,</a>
<a class="sourceLine" id="cb10-27" title="27"> <span class="dt">package =</span> <span class="st">"ggsci"</span>,</a>
<a class="sourceLine" id="cb10-28" title="28"> <span class="dt">messages =</span> <span class="ot">FALSE</span>,</a>
<a class="sourceLine" id="cb10-29" title="29"> <span class="dt">nrow =</span> <span class="dv">2</span>,</a>
<a class="sourceLine" id="cb10-30" title="30"> <span class="dt">title.text =</span> <span class="st">"Differences in movie length by mpaa ratings for different genres"</span></a>
<a class="sourceLine" id="cb10-31" title="31">)</a></code></pre></div>
<p><img src="reference/figures/README-ggbetweenstats3-1.png" width="100%"></p>
<div id="summary-of-tests" class="section level3">
<h3 class="hasAnchor">
<a href="#summary-of-tests" class="anchor"></a>Summary of tests</h3>
<p>Following (between-subjects) tests are carried out for each type of analyses-</p>
<table class="table table">
<thead><tr class="header">
<th>Type</th>
<th>No. of groups</th>
<th>Test</th>
</tr></thead>
<tbody>
<tr class="odd">
<td>Parametric</td>
<td>> 2</td>
<td>Student’s or Welch’s one-way ANOVA</td>
</tr>
<tr class="even">
<td>Non-parametric</td>
<td>> 2</td>
<td>Kruskal–Wallis one-way ANOVA</td>
</tr>
<tr class="odd">
<td>Robust</td>
<td>> 2</td>
<td>Heteroscedastic one-way ANOVA for trimmed means</td>
</tr>
<tr class="even">
<td>Bayes Factor</td>
<td>> 2</td>
<td>Student’s ANOVA</td>
</tr>
<tr class="odd">
<td>Parametric</td>
<td>2</td>
<td>Student’s or Welch’s <em>t</em>-test</td>
</tr>
<tr class="even">
<td>Non-parametric</td>
<td>2</td>
<td>Mann–Whitney <em>U</em> test</td>
</tr>
<tr class="odd">
<td>Robust</td>
<td>2</td>
<td>Yuen’s test for trimmed means</td>
</tr>
<tr class="even">
<td>Bayes Factor</td>
<td>2</td>
<td>Student’s <em>t</em>-test</td>
</tr>
</tbody>
</table>
<p>The omnibus effect in one-way ANOVA design can also be followed up with more focal pairwise comparison tests. Here is a summary of <em>multiple pairwise comparison</em> tests supported in <em>ggbetweenstats</em>-</p>
<table class="table table">
<thead><tr class="header">
<th>Type</th>
<th>Equal variance?</th>
<th>Test</th>
<th>
<em>p</em>-value adjustment?</th>
</tr></thead>
<tbody>
<tr class="odd">
<td>Parametric</td>
<td>No</td>
<td>Games-Howell test</td>
<td><font color="green">Yes</font></td>
</tr>
<tr class="even">
<td>Parametric</td>
<td>Yes</td>
<td>Student’s <em>t</em>-test</td>
<td><font color="green">Yes</font></td>
</tr>
<tr class="odd">
<td>Non-parametric</td>
<td>No</td>
<td>Dwass-Steel-Crichtlow-Fligner test</td>
<td><font color="green">Yes</font></td>
</tr>
<tr class="even">
<td>Robust</td>
<td>No</td>
<td>Yuen’s trimmed means test</td>
<td><font color="green">Yes</font></td>
</tr>
<tr class="odd">
<td>Bayes Factor</td>
<td>No</td>
<td><font color="red">No</font></td>
<td><font color="red">No</font></td>
</tr>
<tr class="even">
<td>Bayes Factor</td>
<td>Yes</td>
<td><font color="red">No</font></td>
<td><font color="red">No</font></td>
</tr>
</tbody>
</table>
<p>For more, see the <code>ggbetweenstats</code> vignette: <a href="https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggbetweenstats.html" class="uri">https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggbetweenstats.html</a></p>
</div>
</div>
<div id="ggwithinstats" class="section level2">
<h2 class="hasAnchor">
<a href="#ggwithinstats" class="anchor"></a><code>ggwithinstats</code>
</h2>
<p><code>ggbetweenstats</code> function has an identical twin function <code>ggwithinstats</code> for repeated measures designs that behaves in the same fashion with a few minor tweaks introduced to properly visualize the repeated measures design. As can be seen from an example below, the only difference between the plot structure is that now the group means are connected by paths to highlight the fact that these data are paired with each other.</p>
<div class="sourceCode" id="cb11"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb11-1" title="1"><span class="co"># for reproducibility and data</span></a>
<a class="sourceLine" id="cb11-2" title="2"><span class="kw"><a href="https://rdrr.io/r/base/Random.html">set.seed</a></span>(<span class="dv">123</span>)</a>
<a class="sourceLine" id="cb11-3" title="3"><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span>(WRS2)</a>
<a class="sourceLine" id="cb11-4" title="4"></a>
<a class="sourceLine" id="cb11-5" title="5"><span class="co"># plot</span></a>
<a class="sourceLine" id="cb11-6" title="6">ggstatsplot<span class="op">::</span><span class="kw"><a href="https://indrajeetpatil.github.io/ggstatsplot//reference/ggwithinstats.html">ggwithinstats</a></span>(</a>
<a class="sourceLine" id="cb11-7" title="7"> <span class="dt">data =</span> WRS2<span class="op">::</span>WineTasting,</a>
<a class="sourceLine" id="cb11-8" title="8"> <span class="dt">x =</span> Wine,</a>
<a class="sourceLine" id="cb11-9" title="9"> <span class="dt">y =</span> Taste,</a>
<a class="sourceLine" id="cb11-10" title="10"> <span class="dt">sort =</span> <span class="st">"descending"</span>, <span class="co"># ordering groups along the x-axis based on</span></a>
<a class="sourceLine" id="cb11-11" title="11"> <span class="dt">sort.fun =</span> median, <span class="co"># values of `y` variable</span></a>
<a class="sourceLine" id="cb11-12" title="12"> <span class="dt">pairwise.comparisons =</span> <span class="ot">TRUE</span>,</a>
<a class="sourceLine" id="cb11-13" title="13"> <span class="dt">pairwise.display =</span> <span class="st">"s"</span>,</a>
<a class="sourceLine" id="cb11-14" title="14"> <span class="dt">pairwise.annotation =</span> <span class="st">"p"</span>,</a>
<a class="sourceLine" id="cb11-15" title="15"> <span class="dt">title =</span> <span class="st">"Wine tasting"</span>,</a>
<a class="sourceLine" id="cb11-16" title="16"> <span class="dt">caption =</span> <span class="st">"Data from: `WRS2` R package"</span>,</a>
<a class="sourceLine" id="cb11-17" title="17"> <span class="dt">ggtheme =</span> ggthemes<span class="op">::</span><span class="kw"><a href="https://rdrr.io/pkg/ggthemes/man/theme_fivethirtyeight.html">theme_fivethirtyeight</a></span>(),</a>
<a class="sourceLine" id="cb11-18" title="18"> <span class="dt">ggstatsplot.layer =</span> <span class="ot">FALSE</span>,</a>
<a class="sourceLine" id="cb11-19" title="19"> <span class="dt">messages =</span> <span class="ot">FALSE</span></a>
<a class="sourceLine" id="cb11-20" title="20">)</a></code></pre></div>
<p><img src="reference/figures/README-ggwithinstats1-1.png" width="100%"></p>
<p>As with the <code>ggbetweenstats</code>, this function also has a <code>grouped_</code> variant that makes repeating the same analysis across a single grouping variable quicker. We will see an example with only repeated measurements-</p>
<div class="sourceCode" id="cb12"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb12-1" title="1"><span class="co"># common setup</span></a>
<a class="sourceLine" id="cb12-2" title="2"><span class="kw"><a href="https://rdrr.io/r/base/Random.html">set.seed</a></span>(<span class="dv">123</span>)</a>
<a class="sourceLine" id="cb12-3" title="3"><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span>(jmv)</a>
<a class="sourceLine" id="cb12-4" title="4"><span class="kw"><a href="https://rdrr.io/r/utils/data.html">data</a></span>(<span class="st">"bugs"</span>, <span class="dt">package =</span> <span class="st">"jmv"</span>)</a>
<a class="sourceLine" id="cb12-5" title="5"></a>
<a class="sourceLine" id="cb12-6" title="6"><span class="co"># getting data in tidy format</span></a>
<a class="sourceLine" id="cb12-7" title="7">data_bugs <-<span class="st"> </span>bugs <span class="op">%>%</span></a>
<a class="sourceLine" id="cb12-8" title="8"><span class="st"> </span>tibble<span class="op">::</span><span class="kw"><a href="https://tibble.tidyverse.org/reference/as_tibble.html">as_tibble</a></span>(<span class="dt">x =</span> .) <span class="op">%>%</span></a>
<a class="sourceLine" id="cb12-9" title="9"><span class="st"> </span>tidyr<span class="op">::</span><span class="kw"><a href="https://tidyr.tidyverse.org/reference/gather.html">gather</a></span>(<span class="dt">data =</span> ., key, value, LDLF<span class="op">:</span>HDHF) <span class="op">%>%</span></a>
<a class="sourceLine" id="cb12-10" title="10"><span class="st"> </span>dplyr<span class="op">::</span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span>(<span class="dt">.data =</span> ., Region <span class="op">%in%</span><span class="st"> </span><span class="kw"><a href="https://rdrr.io/r/base/c.html">c</a></span>(<span class="st">"Europe"</span>, <span class="st">"North America"</span>))</a>
<a class="sourceLine" id="cb12-11" title="11"></a>
<a class="sourceLine" id="cb12-12" title="12"><span class="co"># plot</span></a>
<a class="sourceLine" id="cb12-13" title="13">ggstatsplot<span class="op">::</span><span class="kw"><a href="https://indrajeetpatil.github.io/ggstatsplot//reference/grouped_ggwithinstats.html">grouped_ggwithinstats</a></span>(</a>
<a class="sourceLine" id="cb12-14" title="14"> <span class="dt">data =</span> dplyr<span class="op">::</span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span>(data_bugs, key <span class="op">%in%</span><span class="st"> </span><span class="kw"><a href="https://rdrr.io/r/base/c.html">c</a></span>(<span class="st">"LDLF"</span>, <span class="st">"LDHF"</span>)),</a>
<a class="sourceLine" id="cb12-15" title="15"> <span class="dt">x =</span> key,</a>
<a class="sourceLine" id="cb12-16" title="16"> <span class="dt">y =</span> value,</a>
<a class="sourceLine" id="cb12-17" title="17"> <span class="dt">xlab =</span> <span class="st">"Condition"</span>,</a>
<a class="sourceLine" id="cb12-18" title="18"> <span class="dt">ylab =</span> <span class="st">"Desire to kill an artrhopod"</span>,</a>
<a class="sourceLine" id="cb12-19" title="19"> <span class="dt">grouping.var =</span> Region,</a>
<a class="sourceLine" id="cb12-20" title="20"> <span class="dt">outlier.tagging =</span> <span class="ot">TRUE</span>,</a>
<a class="sourceLine" id="cb12-21" title="21"> <span class="dt">outlier.label =</span> Education,</a>
<a class="sourceLine" id="cb12-22" title="22"> <span class="dt">ggtheme =</span> hrbrthemes<span class="op">::</span><span class="kw"><a href="https://rdrr.io/pkg/hrbrthemes/man/theme_ipsum_tw.html">theme_ipsum_tw</a></span>(),</a>
<a class="sourceLine" id="cb12-23" title="23"> <span class="dt">ggstatsplot.layer =</span> <span class="ot">FALSE</span>,</a>
<a class="sourceLine" id="cb12-24" title="24"> <span class="dt">messages =</span> <span class="ot">FALSE</span></a>
<a class="sourceLine" id="cb12-25" title="25">)</a></code></pre></div>
<p><img src="reference/figures/README-ggwithinstats2-1.png" width="100%"></p>
<div id="summary-of-tests-1" class="section level3">
<h3 class="hasAnchor">
<a href="#summary-of-tests-1" class="anchor"></a>Summary of tests</h3>
<p>Following (within-subjects) tests are carried out for each type of analyses-</p>
<table class="table table">
<colgroup>
<col width="28%">
<col width="7%">
<col width="64%">
</colgroup>
<thead><tr class="header">
<th>Type</th>
<th>No. of groups</th>
<th>Test</th>
</tr></thead>
<tbody>
<tr class="odd">
<td>Parametric</td>
<td>> 2</td>
<td>One-way repeated measures ANOVA</td>
</tr>
<tr class="even">
<td>Non-parametric</td>
<td>> 2</td>
<td>Friedman test</td>
</tr>
<tr class="odd">
<td>Robust</td>
<td>> 2</td>
<td>Heteroscedastic one-way repeated measures ANOVA for trimmed means</td>
</tr>
<tr class="even">
<td>Bayes Factor</td>
<td>> 2</td>
<td>One-way repeated measures ANOVA</td>
</tr>
<tr class="odd">
<td>Parametric</td>
<td>2</td>
<td>Student’s <em>t</em>-test</td>
</tr>
<tr class="even">
<td>Non-parametric</td>
<td>2</td>
<td>Wilcoxon signed-rank test</td>
</tr>
<tr class="odd">
<td>Robust</td>
<td>2</td>
<td>Yuen’s test on trimmed means for dependent samples</td>
</tr>
<tr class="even">
<td>Bayes Factor</td>
<td>2</td>
<td>Student’s <em>t</em>-test</td>
</tr>
</tbody>
</table>
<p>The omnibus effect in one-way ANOVA design can also be followed up with more focal pairwise comparison tests. Here is a summary of <em>multiple pairwise comparison</em> tests supported in <em>ggwithinstats</em>-</p>
<table class="table table">
<thead><tr class="header">
<th>Type</th>
<th>Test</th>
<th>
<em>p</em>-value adjustment?</th>
</tr></thead>
<tbody>
<tr class="odd">
<td>Parametric</td>
<td>Student’s <em>t</em>-test</td>
<td><font color="green">Yes</font></td>
</tr>
<tr class="even">
<td>Non-parametric</td>
<td>Durbin-Conover test</td>
<td><font color="green">Yes</font></td>
</tr>
<tr class="odd">
<td>Robust</td>
<td>Yuen’s trimmed means test</td>
<td><font color="green">Yes</font></td>
</tr>
<tr class="even">
<td>Bayes Factor</td>
<td><font color="red">No</font></td>
<td><font color="red">No</font></td>
</tr>
</tbody>
</table>
<p>For more, see the <code>ggwithinstats</code> vignette: <a href="https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggwithinstats.html" class="uri">https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggwithinstats.html</a></p>
</div>
</div>
<div id="ggscatterstats" class="section level2">
<h2 class="hasAnchor">
<a href="#ggscatterstats" class="anchor"></a><code>ggscatterstats</code>
</h2>
<p>This function creates a scatterplot with marginal distributions overlaid on the axes (from <code><a href="https://rdrr.io/pkg/ggExtra/man/ggMarginal.html">ggExtra::ggMarginal</a></code>) and results from statistical tests in the subtitle:</p>
<div class="sourceCode" id="cb13"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb13-1" title="1">ggstatsplot<span class="op">::</span><span class="kw"><a href="https://indrajeetpatil.github.io/ggstatsplot//reference/ggscatterstats.html">ggscatterstats</a></span>(</a>
<a class="sourceLine" id="cb13-2" title="2"> <span class="dt">data =</span> ggplot2<span class="op">::</span>msleep,</a>
<a class="sourceLine" id="cb13-3" title="3"> <span class="dt">x =</span> sleep_rem,</a>
<a class="sourceLine" id="cb13-4" title="4"> <span class="dt">y =</span> awake,</a>
<a class="sourceLine" id="cb13-5" title="5"> <span class="dt">xlab =</span> <span class="st">"REM sleep (in hours)"</span>,</a>