diff --git a/news/index.html b/news/index.html
index c9dee276f..86d62846a 100644
--- a/news/index.html
+++ b/news/index.html
@@ -62,6 +62,10 @@
ggstatsplot 0.12.5
CRAN release: 2024-11-01
diff --git a/pkgdown.yml b/pkgdown.yml
index 09d5e3ced..d1904f052 100644
--- a/pkgdown.yml
+++ b/pkgdown.yml
@@ -1,6 +1,6 @@
pandoc: '3.5'
pkgdown: 2.1.1.9000
-pkgdown_sha: ffe60d5f60934e95285d416dae12c05e24ed1dac
+pkgdown_sha: c40ba2c989e786bbb2829b431114d26375bbe19a
articles:
additional: additional.html
web_only/faq: web_only/faq.html
@@ -17,7 +17,7 @@ articles:
web_only/pairwise: web_only/pairwise.html
web_only/principles: web_only/principles.html
web_only/purrr_examples: web_only/purrr_examples.html
-last_built: 2024-11-01T09:31Z
+last_built: 2024-11-10T21:11Z
urls:
reference: https://indrajeetpatil.github.io/ggstatsplot/reference
article: https://indrajeetpatil.github.io/ggstatsplot/articles
diff --git a/search.json b/search.json
index 4eaec0b05..03975414b 100644
--- a/search.json
+++ b/search.json
@@ -1 +1 @@
-[{"path":[]},{"path":"https://indrajeetpatil.github.io/ggstatsplot/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement patilindrajeet.science@gmail.com. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.1, available https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. Community Impact Guidelines inspired [Mozilla’s code conduct enforcement ladder][https://github.com/mozilla/inclusion]. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contributing to ggstatsplot","title":"Contributing to ggstatsplot","text":"outlines propose change ggstatsplot. detailed info contributing , tidyverse packages, please see development contributing guide.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/CONTRIBUTING.html","id":"fixing-typos","dir":"","previous_headings":"","what":"Fixing typos","title":"Contributing to ggstatsplot","text":"Small typos grammatical errors documentation may edited directly using GitHub web interface, long changes made source file. YES: edit roxygen comment .R file R/. : edit .Rd file man/.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/CONTRIBUTING.html","id":"prerequisites","dir":"","previous_headings":"","what":"Prerequisites","title":"Contributing to ggstatsplot","text":"make substantial pull request, always file issue make sure someone team agrees ’s problem. ’ve found bug, create associated issue illustrate bug minimal reprex.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/CONTRIBUTING.html","id":"pull-request-process","dir":"","previous_headings":"","what":"Pull request process","title":"Contributing to ggstatsplot","text":"recommend create Git branch pull request (PR). Look Travis AppVeyor build status making changes. README contain badges continuous integration services used package. New code follow tidyverse style guide. can use styler package apply styles, please don’t restyle code nothing PR. use roxygen2, Markdown syntax, documentation. use testthat. Contributions test cases included easier accept. user-facing changes, add bullet top NEWS.md current development version header describing changes made followed GitHub username, links relevant issue(s)/PR(s).","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/CONTRIBUTING.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Contributing to ggstatsplot","text":"Please note ggstatsplot project released Contributor Code Conduct. contributing project agree abide terms.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/CONTRIBUTING.html","id":"see-tidyverse-development-contributing-guide","dir":"","previous_headings":"","what":"See tidyverse development contributing guide","title":"Contributing to ggstatsplot","text":"details.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"GNU General Public License","title":"GNU General Public License","text":"Version 3, 29 June 2007Copyright © 2007 Free Software Foundation, Inc.
Everyone permitted copy distribute verbatim copies license document, changing allowed.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/LICENSE.html","id":"preamble","dir":"","previous_headings":"","what":"Preamble","title":"GNU General Public License","text":"GNU General Public License free, copyleft license software kinds works. licenses software practical works designed take away freedom share change works. contrast, GNU General Public License intended guarantee freedom share change versions program–make sure remains free software users. , Free Software Foundation, use GNU General Public License software; applies also work released way authors. can apply programs, . speak free software, referring freedom, price. General Public Licenses designed make sure freedom distribute copies free software (charge wish), receive source code can get want , can change software use pieces new free programs, know can things. protect rights, need prevent others denying rights asking surrender rights. Therefore, certain responsibilities distribute copies software, modify : responsibilities respect freedom others. example, distribute copies program, whether gratis fee, must pass recipients freedoms received. must make sure , , receive can get source code. must show terms know rights. Developers use GNU GPL protect rights two steps: (1) assert copyright software, (2) offer License giving legal permission copy, distribute /modify . developers’ authors’ protection, GPL clearly explains warranty free software. users’ authors’ sake, GPL requires modified versions marked changed, problems attributed erroneously authors previous versions. devices designed deny users access install run modified versions software inside , although manufacturer can . fundamentally incompatible aim protecting users’ freedom change software. systematic pattern abuse occurs area products individuals use, precisely unacceptable. Therefore, designed version GPL prohibit practice products. problems arise substantially domains, stand ready extend provision domains future versions GPL, needed protect freedom users. Finally, every program threatened constantly software patents. States allow patents restrict development use software general-purpose computers, , wish avoid special danger patents applied free program make effectively proprietary. prevent , GPL assures patents used render program non-free. precise terms conditions copying, distribution modification follow.","code":""},{"path":[]},{"path":"https://indrajeetpatil.github.io/ggstatsplot/LICENSE.html","id":"id_0-definitions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"0. Definitions","title":"GNU General Public License","text":"License refers version 3 GNU General Public License. Copyright also means copyright-like laws apply kinds works, semiconductor masks. Program refers copyrightable work licensed License. licensee addressed . Licensees recipients may individuals organizations. modify work means copy adapt part work fashion requiring copyright permission, making exact copy. resulting work called modified version earlier work work based earlier work. covered work means either unmodified Program work based Program. propagate work means anything , without permission, make directly secondarily liable infringement applicable copyright law, except executing computer modifying private copy. Propagation includes copying, distribution (without modification), making available public, countries activities well. convey work means kind propagation enables parties make receive copies. Mere interaction user computer network, transfer copy, conveying. interactive user interface displays Appropriate Legal Notices extent includes convenient prominently visible feature (1) displays appropriate copyright notice, (2) tells user warranty work (except extent warranties provided), licensees may convey work License, view copy License. interface presents list user commands options, menu, prominent item list meets criterion.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/LICENSE.html","id":"id_1-source-code","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"1. Source Code","title":"GNU General Public License","text":"source code work means preferred form work making modifications . Object code means non-source form work. Standard Interface means interface either official standard defined recognized standards body, , case interfaces specified particular programming language, one widely used among developers working language. System Libraries executable work include anything, work whole, () included normal form packaging Major Component, part Major Component, (b) serves enable use work Major Component, implement Standard Interface implementation available public source code form. Major Component, context, means major essential component (kernel, window system, ) specific operating system () executable work runs, compiler used produce work, object code interpreter used run . Corresponding Source work object code form means source code needed generate, install, (executable work) run object code modify work, including scripts control activities. However, include work’s System Libraries, general-purpose tools generally available free programs used unmodified performing activities part work. example, Corresponding Source includes interface definition files associated source files work, source code shared libraries dynamically linked subprograms work specifically designed require, intimate data communication control flow subprograms parts work. Corresponding Source need include anything users can regenerate automatically parts Corresponding Source. Corresponding Source work source code form work.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/LICENSE.html","id":"id_2-basic-permissions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"2. Basic Permissions","title":"GNU General Public License","text":"rights granted License granted term copyright Program, irrevocable provided stated conditions met. License explicitly affirms unlimited permission run unmodified Program. output running covered work covered License output, given content, constitutes covered work. License acknowledges rights fair use equivalent, provided copyright law. may make, run propagate covered works convey, without conditions long license otherwise remains force. may convey covered works others sole purpose make modifications exclusively , provide facilities running works, provided comply terms License conveying material control copyright. thus making running covered works must exclusively behalf, direction control, terms prohibit making copies copyrighted material outside relationship . Conveying circumstances permitted solely conditions stated . Sublicensing allowed; section 10 makes unnecessary.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/LICENSE.html","id":"id_3-protecting-users-legal-rights-from-anti-circumvention-law","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"3. Protecting Users’ Legal Rights From Anti-Circumvention Law","title":"GNU General Public License","text":"covered work shall deemed part effective technological measure applicable law fulfilling obligations article 11 WIPO copyright treaty adopted 20 December 1996, similar laws prohibiting restricting circumvention measures. convey covered work, waive legal power forbid circumvention technological measures extent circumvention effected exercising rights License respect covered work, disclaim intention limit operation modification work means enforcing, work’s users, third parties’ legal rights forbid circumvention technological measures.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/LICENSE.html","id":"id_4-conveying-verbatim-copies","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"4. Conveying Verbatim Copies","title":"GNU General Public License","text":"may convey verbatim copies Program’s source code receive , medium, provided conspicuously appropriately publish copy appropriate copyright notice; keep intact notices stating License non-permissive terms added accord section 7 apply code; keep intact notices absence warranty; give recipients copy License along Program. may charge price price copy convey, may offer support warranty protection fee.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/LICENSE.html","id":"id_5-conveying-modified-source-versions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"5. Conveying Modified Source Versions","title":"GNU General Public License","text":"may convey work based Program, modifications produce Program, form source code terms section 4, provided also meet conditions: ) work must carry prominent notices stating modified , giving relevant date. b) work must carry prominent notices stating released License conditions added section 7. requirement modifies requirement section 4 keep intact notices. c) must license entire work, whole, License anyone comes possession copy. License therefore apply, along applicable section 7 additional terms, whole work, parts, regardless packaged. License gives permission license work way, invalidate permission separately received . d) work interactive user interfaces, must display Appropriate Legal Notices; however, Program interactive interfaces display Appropriate Legal Notices, work need make . compilation covered work separate independent works, nature extensions covered work, combined form larger program, volume storage distribution medium, called aggregate compilation resulting copyright used limit access legal rights compilation’s users beyond individual works permit. Inclusion covered work aggregate cause License apply parts aggregate.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/LICENSE.html","id":"id_6-conveying-non-source-forms","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"6. Conveying Non-Source Forms","title":"GNU General Public License","text":"may convey covered work object code form terms sections 4 5, provided also convey machine-readable Corresponding Source terms License, one ways: ) Convey object code , embodied , physical product (including physical distribution medium), accompanied Corresponding Source fixed durable physical medium customarily used software interchange. b) Convey object code , embodied , physical product (including physical distribution medium), accompanied written offer, valid least three years valid long offer spare parts customer support product model, give anyone possesses object code either (1) copy Corresponding Source software product covered License, durable physical medium customarily used software interchange, price reasonable cost physically performing conveying source, (2) access copy Corresponding Source network server charge. c) Convey individual copies object code copy written offer provide Corresponding Source. alternative allowed occasionally noncommercially, received object code offer, accord subsection 6b. d) Convey object code offering access designated place (gratis charge), offer equivalent access Corresponding Source way place charge. need require recipients copy Corresponding Source along object code. place copy object code network server, Corresponding Source may different server (operated third party) supports equivalent copying facilities, provided maintain clear directions next object code saying find Corresponding Source. Regardless server hosts Corresponding Source, remain obligated ensure available long needed satisfy requirements. e) Convey object code using peer--peer transmission, provided inform peers object code Corresponding Source work offered general public charge subsection 6d. separable portion object code, whose source code excluded Corresponding Source System Library, need included conveying object code work. User Product either (1) consumer product, means tangible personal property normally used personal, family, household purposes, (2) anything designed sold incorporation dwelling. determining whether product consumer product, doubtful cases shall resolved favor coverage. particular product received particular user, normally used refers typical common use class product, regardless status particular user way particular user actually uses, expects expected use, product. product consumer product regardless whether product substantial commercial, industrial non-consumer uses, unless uses represent significant mode use product. Installation Information User Product means methods, procedures, authorization keys, information required install execute modified versions covered work User Product modified version Corresponding Source. information must suffice ensure continued functioning modified object code case prevented interfered solely modification made. convey object code work section , , specifically use , User Product, conveying occurs part transaction right possession use User Product transferred recipient perpetuity fixed term (regardless transaction characterized), Corresponding Source conveyed section must accompanied Installation Information. requirement apply neither third party retains ability install modified object code User Product (example, work installed ROM). requirement provide Installation Information include requirement continue provide support service, warranty, updates work modified installed recipient, User Product modified installed. Access network may denied modification materially adversely affects operation network violates rules protocols communication across network. Corresponding Source conveyed, Installation Information provided, accord section must format publicly documented (implementation available public source code form), must require special password key unpacking, reading copying.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/LICENSE.html","id":"id_7-additional-terms","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"7. Additional Terms","title":"GNU General Public License","text":"Additional permissions terms supplement terms License making exceptions one conditions. Additional permissions applicable entire Program shall treated though included License, extent valid applicable law. additional permissions apply part Program, part may used separately permissions, entire Program remains governed License without regard additional permissions. convey copy covered work, may option remove additional permissions copy, part . (Additional permissions may written require removal certain cases modify work.) may place additional permissions material, added covered work, can give appropriate copyright permission. Notwithstanding provision License, material add covered work, may (authorized copyright holders material) supplement terms License terms: ) Disclaiming warranty limiting liability differently terms sections 15 16 License; b) Requiring preservation specified reasonable legal notices author attributions material Appropriate Legal Notices displayed works containing ; c) Prohibiting misrepresentation origin material, requiring modified versions material marked reasonable ways different original version; d) Limiting use publicity purposes names licensors authors material; e) Declining grant rights trademark law use trade names, trademarks, service marks; f) Requiring indemnification licensors authors material anyone conveys material (modified versions ) contractual assumptions liability recipient, liability contractual assumptions directly impose licensors authors. non-permissive additional terms considered restrictions within meaning section 10. Program received , part , contains notice stating governed License along term restriction, may remove term. license document contains restriction permits relicensing conveying License, may add covered work material governed terms license document, provided restriction survive relicensing conveying. add terms covered work accord section, must place, relevant source files, statement additional terms apply files, notice indicating find applicable terms. Additional terms, permissive non-permissive, may stated form separately written license, stated exceptions; requirements apply either way.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/LICENSE.html","id":"id_8-termination","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"8. Termination","title":"GNU General Public License","text":"may propagate modify covered work except expressly provided License. attempt otherwise propagate modify void, automatically terminate rights License (including patent licenses granted third paragraph section 11). However, cease violation License, license particular copyright holder reinstated () provisionally, unless copyright holder explicitly finally terminates license, (b) permanently, copyright holder fails notify violation reasonable means prior 60 days cessation. Moreover, license particular copyright holder reinstated permanently copyright holder notifies violation reasonable means, first time received notice violation License (work) copyright holder, cure violation prior 30 days receipt notice. Termination rights section terminate licenses parties received copies rights License. rights terminated permanently reinstated, qualify receive new licenses material section 10.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/LICENSE.html","id":"id_9-acceptance-not-required-for-having-copies","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"9. Acceptance Not Required for Having Copies","title":"GNU General Public License","text":"required accept License order receive run copy Program. Ancillary propagation covered work occurring solely consequence using peer--peer transmission receive copy likewise require acceptance. However, nothing License grants permission propagate modify covered work. actions infringe copyright accept License. Therefore, modifying propagating covered work, indicate acceptance License .","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/LICENSE.html","id":"id_10-automatic-licensing-of-downstream-recipients","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"10. Automatic Licensing of Downstream Recipients","title":"GNU General Public License","text":"time convey covered work, recipient automatically receives license original licensors, run, modify propagate work, subject License. responsible enforcing compliance third parties License. entity transaction transaction transferring control organization, substantially assets one, subdividing organization, merging organizations. propagation covered work results entity transaction, party transaction receives copy work also receives whatever licenses work party’s predecessor interest give previous paragraph, plus right possession Corresponding Source work predecessor interest, predecessor can get reasonable efforts. may impose restrictions exercise rights granted affirmed License. example, may impose license fee, royalty, charge exercise rights granted License, may initiate litigation (including cross-claim counterclaim lawsuit) alleging patent claim infringed making, using, selling, offering sale, importing Program portion .","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/LICENSE.html","id":"id_11-patents","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"11. Patents","title":"GNU General Public License","text":"contributor copyright holder authorizes use License Program work Program based. work thus licensed called contributor’s contributor version. contributor’s essential patent claims patent claims owned controlled contributor, whether already acquired hereafter acquired, infringed manner, permitted License, making, using, selling contributor version, include claims infringed consequence modification contributor version. purposes definition, control includes right grant patent sublicenses manner consistent requirements License. contributor grants non-exclusive, worldwide, royalty-free patent license contributor’s essential patent claims, make, use, sell, offer sale, import otherwise run, modify propagate contents contributor version. following three paragraphs, patent license express agreement commitment, however denominated, enforce patent (express permission practice patent covenant sue patent infringement). grant patent license party means make agreement commitment enforce patent party. convey covered work, knowingly relying patent license, Corresponding Source work available anyone copy, free charge terms License, publicly available network server readily accessible means, must either (1) cause Corresponding Source available, (2) arrange deprive benefit patent license particular work, (3) arrange, manner consistent requirements License, extend patent license downstream recipients. Knowingly relying means actual knowledge , patent license, conveying covered work country, recipient’s use covered work country, infringe one identifiable patents country reason believe valid. , pursuant connection single transaction arrangement, convey, propagate procuring conveyance , covered work, grant patent license parties receiving covered work authorizing use, propagate, modify convey specific copy covered work, patent license grant automatically extended recipients covered work works based . patent license discriminatory include within scope coverage, prohibits exercise , conditioned non-exercise one rights specifically granted License. may convey covered work party arrangement third party business distributing software, make payment third party based extent activity conveying work, third party grants, parties receive covered work , discriminatory patent license () connection copies covered work conveyed (copies made copies), (b) primarily connection specific products compilations contain covered work, unless entered arrangement, patent license granted, prior 28 March 2007. Nothing License shall construed excluding limiting implied license defenses infringement may otherwise available applicable patent law.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/LICENSE.html","id":"id_12-no-surrender-of-others-freedom","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"12. No Surrender of Others’ Freedom","title":"GNU General Public License","text":"conditions imposed (whether court order, agreement otherwise) contradict conditions License, excuse conditions License. convey covered work satisfy simultaneously obligations License pertinent obligations, consequence may convey . example, agree terms obligate collect royalty conveying convey Program, way satisfy terms License refrain entirely conveying Program.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/LICENSE.html","id":"id_13-use-with-the-gnu-affero-general-public-license","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"13. Use with the GNU Affero General Public License","title":"GNU General Public License","text":"Notwithstanding provision License, permission link combine covered work work licensed version 3 GNU Affero General Public License single combined work, convey resulting work. terms License continue apply part covered work, special requirements GNU Affero General Public License, section 13, concerning interaction network apply combination .","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/LICENSE.html","id":"id_14-revised-versions-of-this-license","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"14. Revised Versions of this License","title":"GNU General Public License","text":"Free Software Foundation may publish revised /new versions GNU General Public License time time. new versions similar spirit present version, may differ detail address new problems concerns. version given distinguishing version number. Program specifies certain numbered version GNU General Public License later version applies , option following terms conditions either numbered version later version published Free Software Foundation. Program specify version number GNU General Public License, may choose version ever published Free Software Foundation. Program specifies proxy can decide future versions GNU General Public License can used, proxy’s public statement acceptance version permanently authorizes choose version Program. Later license versions may give additional different permissions. However, additional obligations imposed author copyright holder result choosing follow later version.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/LICENSE.html","id":"id_15-disclaimer-of-warranty","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"15. Disclaimer of Warranty","title":"GNU General Public License","text":"WARRANTY PROGRAM, EXTENT PERMITTED APPLICABLE LAW. EXCEPT OTHERWISE STATED WRITING COPYRIGHT HOLDERS /PARTIES PROVIDE PROGRAM WITHOUT WARRANTY KIND, EITHER EXPRESSED IMPLIED, INCLUDING, LIMITED , IMPLIED WARRANTIES MERCHANTABILITY FITNESS PARTICULAR PURPOSE. ENTIRE RISK QUALITY PERFORMANCE PROGRAM . PROGRAM PROVE DEFECTIVE, ASSUME COST NECESSARY SERVICING, REPAIR CORRECTION.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/LICENSE.html","id":"id_16-limitation-of-liability","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"16. Limitation of Liability","title":"GNU General Public License","text":"EVENT UNLESS REQUIRED APPLICABLE LAW AGREED WRITING COPYRIGHT HOLDER, PARTY MODIFIES /CONVEYS PROGRAM PERMITTED , LIABLE DAMAGES, INCLUDING GENERAL, SPECIAL, INCIDENTAL CONSEQUENTIAL DAMAGES ARISING USE INABILITY USE PROGRAM (INCLUDING LIMITED LOSS DATA DATA RENDERED INACCURATE LOSSES SUSTAINED THIRD PARTIES FAILURE PROGRAM OPERATE PROGRAMS), EVEN HOLDER PARTY ADVISED POSSIBILITY DAMAGES.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/LICENSE.html","id":"id_17-interpretation-of-sections-15-and-16","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"17. Interpretation of Sections 15 and 16","title":"GNU General Public License","text":"disclaimer warranty limitation liability provided given local legal effect according terms, reviewing courts shall apply local law closely approximates absolute waiver civil liability connection Program, unless warranty assumption liability accompanies copy Program return fee. END TERMS CONDITIONS","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/LICENSE.html","id":"how-to-apply-these-terms-to-your-new-programs","dir":"","previous_headings":"","what":"How to Apply These Terms to Your New Programs","title":"GNU General Public License","text":"develop new program, want greatest possible use public, best way achieve make free software everyone can redistribute change terms. , attach following notices program. safest attach start source file effectively state exclusion warranty; file least copyright line pointer full notice found. Also add information contact electronic paper mail. program terminal interaction, make output short notice like starts interactive mode: hypothetical commands show w show c show appropriate parts General Public License. course, program’s commands might different; GUI interface, use box. also get employer (work programmer) school, , sign copyright disclaimer program, necessary. information , apply follow GNU GPL, see
. GNU General Public License permit incorporating program proprietary programs. program subroutine library, may consider useful permit linking proprietary applications library. want , use GNU Lesser General Public License instead License. first, please read
.","code":" Copyright (C) 2018 Indrajeet Patil This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . ipmisc Copyright (C) 2018 Indrajeet Patil This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. This is free software, and you are welcome to redistribute it under certain conditions; type 'show c' for details."},{"path":"https://indrajeetpatil.github.io/ggstatsplot/SUPPORT.html","id":null,"dir":"","previous_headings":"","what":"Getting help with ggstatsplot","title":"Getting help with ggstatsplot","text":"Thanks using ggstatsplot. filing issue, places explore pieces put together make process smooth possible. Start making minimal reproducible example using reprex package. haven’t heard used reprex , ’re treat! Seriously, reprex make R-question-asking endeavors easier (pretty insane ROI five ten minutes ’ll take learn ’s ). additional reprex pointers, check Get help! section tidyverse site. Armed reprex, next step figure ask. ’s question: start community.rstudio.com, /StackOverflow. people answer questions. ’s bug: ’re right place, file issue. ’re sure: let community help figure ! problem bug feature request, can easily return report . opening new issue, sure search issues pull requests make sure bug hasn’t reported /already fixed development version. default, search pre-populated :issue :open. can edit qualifiers (e.g. :pr, :closed) needed. example, ’d simply remove :open search issues repo, open closed. right place, need file issue, please review “File issues” paragraph tidyverse contributing guidelines. Thanks help!","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/additional.html","id":"additional-vignettes","dir":"Articles","previous_headings":"","what":"Additional vignettes","title":"Additional vignettes","text":"Due size constraints, available vignettes available website package: https://indrajeetpatil.github.io/ggstatsplot/articles/","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/additional.html","id":"vignettes-for-individual-functions","dir":"Articles","previous_headings":"Additional vignettes","what":"Vignettes for individual functions","title":"Additional vignettes","text":"ggbetweenstats: https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggbetweenstats.html ggwithinstats: https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggwithinstats.html ggcorrmat: https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcorrmat.html gghistostats: https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/gghistostats.html ggdotplotstats: https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggdotplotstats.html ggpiestats: https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggpiestats.html ggscatterstats: https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggscatterstats.html ggcoefstats: https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcoefstats.html","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/additional.html","id":"general-vignettes","dir":"Articles","previous_headings":"Additional vignettes","what":"General vignettes","title":"Additional vignettes","text":"Frequently Asked Questions (FAQ): https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/faq.html Graphic design statistical reporting principles guiding ggstatsplot development: https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/principles.html Examples illustrating use purrr extend ggstatsplot functionality: https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/purrr_examples.html Pairwise comparisons ggstatsplot: https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/pairwise.html","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/additional.html","id":"publication","dir":"Articles","previous_headings":"","what":"Publication","title":"Additional vignettes","text":"journal articles describing philosophy principles behind package: https://joss.theoj.org/papers/10.21105/joss.03167","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/additional.html","id":"presentation","dir":"Articles","previous_headings":"","what":"Presentation","title":"Additional vignettes","text":"addition vignettes, another quick way get overview package go following slides: https://indrajeetpatil.github.io/ggstatsplot_slides/slides/ggstatsplot_presentation.html#1","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/additional.html","id":"statistical-backend-of-ggstatsplot","dir":"Articles","previous_headings":"","what":"Statistical backend of {ggstatsplot}","title":"Additional vignettes","text":"statsExpressions package forms statistical backend processes data creates data frames expressions containing results statistical tests. exhaustive documentation package, see: https://indrajeetpatil.github.io/statsExpressions/","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/additional.html","id":"suggestions","dir":"Articles","previous_headings":"","what":"Suggestions","title":"Additional vignettes","text":"find bugs suggestions/remarks, please file issue GitHub: https://github.com/IndrajeetPatil/ggstatsplot/issues","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/ggstatsplot.html","id":"summary","dir":"Articles","previous_headings":"","what":"Summary","title":"Visualizations with statistical details: The 'ggstatsplot' approach","text":"Graphical displays can reveal problems statistical model might apparent purely numerical summaries. visualizations can also helpful reader evaluate validity model reported scholarly publication report. , given onerous costs involved, researchers often avoid preparing information-rich graphics exploring several statistical approaches tests available. ggstatsplot package R programming language (R Core Team, 2021) provides one-line syntax enrich ggplot2-based visualizations results statistical analysis embedded visualization . , package helps researchers adopt rigorous, reliable, robust data exploratory reporting workflow.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/ggstatsplot.html","id":"statement-of-need","dir":"Articles","previous_headings":"","what":"Statement of Need","title":"Visualizations with statistical details: The 'ggstatsplot' approach","text":"typical data analysis workflow, data visualization statistical modeling two different phases: visualization informs modeling, turn, modeling can suggest different visualization method, forth (Wickham & Grolemund, 2016). central idea ggstatsplot simple: combine two phases one form informative graphic statistical details. discussing benefits approach, show example (Figure 1). Example plot ggstatsplot package illustrating philosophy juxtaposing informative visualizations details statistical analysis. see supported plots statistical analyses, see package website: can seen, single line code, function produces details descriptive statistics, inferential statistics, effect size estimate uncertainty, pairwise comparisons, Bayesian hypothesis testing, Bayesian posterior estimate uncertainty. Moreover, details juxtaposed informative well-labeled visualizations. defaults designed follow best practices data visualization (Cleveland, 1985; Grant, 2018; Healy, 2018; Tufte, 2001; Wilke, 2019) (frequentist/Bayesian) statistical reporting (American Psychological Association, 2019; van Doorn et al., 2020). Without ggstatsplot, getting statistical details customizing plot require significant amount time effort. words, package removes trade-often faced researchers ease thoroughness data exploration cements good data exploration habits. Internally, data cleaning carried using tidyverse (Wickham et al., 2019), statistical analysis carried via statsExpressions (Patil, 2021) easystats (Ben-Shachar et al., 2020; Lüdecke et al., 2019, 2020, 2021; Makowski et al., 2019, 2020) packages. visualizations constructed using grammar graphics framework (Wilkinson, 2012), implemented ggplot2 package (Wickham, 2016).","code":"ggbetweenstats(iris, Species, Sepal.Length)"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/ggstatsplot.html","id":"benefits","dir":"Articles","previous_headings":"","what":"Benefits","title":"Visualizations with statistical details: The 'ggstatsplot' approach","text":"summary, benefits ggstatsplot’s approach following. : produces charts displaying raw data, numerical plus graphical summary indices, avoids errors increases reproducibility statistical reporting, highlights importance effect providing effect size measures default, provides easy way evaluate absence effect using Bayes factors, encourages researchers readers evaluate statistical assumptions model context underlying data (Figure 2), easy simple enough someone little coding experience can use without making error may even encourage beginners programmatically analyze data, instead using GUI software. Comparing ‘Standard’ approach reporting statistical analysis publication/report ‘ggstatsplot’ approach reporting analysis next informative graphic. Note results described ‘Standard’ approach ‘Dinosaur’ dataset plotted right. Without accompanying visualization, hard evaluate validity results. ideal reporting practice hybrid two approaches plot contains visual numerical summaries statistical model, narrative provides interpretative context reported statistics.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/ggstatsplot.html","id":"future-scope","dir":"Articles","previous_headings":"","what":"Future Scope","title":"Visualizations with statistical details: The 'ggstatsplot' approach","text":"package ambitious, ongoing, long-term project. currently supports common statistical tests (parametric, non-parametric, robust, Bayesian t-test, one-way ANOVA, contingency table analysis, correlation analysis, meta-analysis, regression analyses, etc.) corresponding visualizations (box/violin plot, scatter plot, dot--whisker plot, pie chart, bar chart, etc.). continue expanding support increasing collection statistical analyses visualizations.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/ggstatsplot.html","id":"licensing-and-availability","dir":"Articles","previous_headings":"","what":"Licensing and Availability","title":"Visualizations with statistical details: The 'ggstatsplot' approach","text":"ggstatsplot licensed GNU General Public License (v3.0), source code stored GitHub. spirit honest open science, requests suggestions fixes, feature updates, well general questions concerns encouraged via direct interaction contributors developers filing issue respecting Contribution Guidelines.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/ggstatsplot.html","id":"acknowledgements","dir":"Articles","previous_headings":"","what":"Acknowledgements","title":"Visualizations with statistical details: The 'ggstatsplot' approach","text":"like acknowledge support Mina Cikara, Fiery Cushman, Iyad Rahwan development project. ggstatsplot relies heavily easystats ecosystem, collaborative project created facilitate usage R statistical analyses. Thus, like thank members easystats well users. additionally like thank contributors ggstatsplot reporting bugs, providing helpful feedback, helping enhancements.","code":""},{"path":[]},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/faq.html","id":"i-just-want-the-plot-not-the-statistical-details--how-can-i-turn-them-off","dir":"Articles > Web_only","previous_headings":"","what":"1. I just want the plot, not the statistical details. How can I turn them off?","title":"Frequently Asked Questions (FAQ)","text":"functions ggstatsplot display results statistical analysis subtitle argument results.subtitle. Setting FALSE return plot.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/faq.html","id":"how-can-i-customize-the-details-contained-in-the-subtitle","dir":"Articles > Web_only","previous_headings":"","what":"2. How can I customize the details contained in the subtitle?","title":"Frequently Asked Questions (FAQ)","text":"Sometimes may wish include many details subtitle. case, can extract expression copy-paste part wish include. example, statistic p-values included:","code":"library(ggplot2) library(statsExpressions) # extracting detailed expression data_results <- oneway_anova(iris, Species, Sepal.Length, var.equal = TRUE) data_results$expression[[1]] #> list(italic(\"F\")[\"Fisher\"](2, 147) == \"119.26\", italic(p) == #> \"1.67e-31\", widehat(omega[\"p\"]^2) == \"0.61\", CI[\"95%\"] ~ #> \"[\" * \"0.53\", \"1.00\" * \"]\", italic(\"n\")[\"obs\"] == \"150\") # adapting the details to your liking ggplot(iris, aes(x = Species, y = Sepal.Length)) + geom_boxplot() + labs(subtitle = ggplot2::expr(paste( italic(\"F\"), \"(\", \"2\", \",\", \"147\", \")=\", \"119.26\", \", \", italic(\"p\"), \"<\", \"0.001\" )))"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/faq.html","id":"i-am-getting-error-in-grid-call-error","dir":"Articles > Web_only","previous_headings":"","what":"3. I am getting Error in grid.Call error","title":"Frequently Asked Questions (FAQ)","text":"Sometimes, working RStudio, might see following error- can possibly solved increasing size RStudio viewer pane.","code":"Error in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : polygon edge not found"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/faq.html","id":"why-do-i-get-only-plot-in-return-but-not-the-subtitlecaption","dir":"Articles > Web_only","previous_headings":"","what":"4. Why do I get only plot in return but not the subtitle/caption?","title":"Frequently Asked Questions (FAQ)","text":"order prevent entire plotting function failing statistical analysis fails, functions ggstatsplot default first attempting run analysis fail, return empty (NULL) subtitle/caption. cases, wish diagnose analysis failing, using underlying function used carry statistical analysis. example, following returns plot statistical details subtitle. see statistical analysis failed, can look error underlying function:","code":"df <- data.frame(x = 1, y = 2) ggscatterstats(df, x, y, type = \"robust\") library(statsExpressions) df <- data.frame(x = 1, y = 2) corr_test(df, x, y, type = \"robust\") #> # A tibble: 1 × 14 #> parameter1 parameter2 effectsize estimate conf.level conf.low #> #> 1 x y Winsorized NA correlation NA 0.95 NA #> conf.high statistic df.error p.value method n.obs #> #> 1 NA NA NA NA Winsorized NA correlation 1 #> conf.method expression #> #> 1 normal "},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/faq.html","id":"what-statistical-test-was-carried-out","dir":"Articles > Web_only","previous_headings":"","what":"5. What statistical test was carried out?","title":"Frequently Asked Questions (FAQ)","text":"case sure statistical test produced results shown subtitle plot, best way get information either look documentation function used check associated vignette. Summary analysis handily available README: https://github.com/IndrajeetPatil/ggstatsplot/blob/master/README.md","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/faq.html","id":"how-can-i-use-ggstatsplot-functions-in-a-for-loop","dir":"Articles > Web_only","previous_headings":"","what":"6. How can I use {ggstatsplot} functions in a for loop?","title":"Frequently Asked Questions (FAQ)","text":"Given functions ggstatsplot use tidy evaluation, running functions loop requires minor adjustment inputs entered: said, repeating function execution across multiple columns data frame want , recommend purrr-based solution: solution work x y arguments, grouping.var argument, first needs converted symbol:","code":"col.name <- colnames(mtcars) # executing the function in a `for` loop for (i in 3:length(col.name)) { ggbetweenstats( data = mtcars, x = cyl, y = !!col.name[i] ) } df <- dplyr::filter(movies_long, genre == \"Comedy\" | genre == \"Drama\") grouped_ggscatterstats( data = df, x = !!colnames(df)[3], y = !!colnames(df)[5], grouping.var = !!rlang::sym(colnames(df)[8]), results.subtitle = FALSE )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/faq.html","id":"how-can-i-have-uniform-y-axes-ranges-in-grouped_-functions","dir":"Articles > Web_only","previous_headings":"","what":"7. How can I have uniform Y-axes ranges in grouped_ functions?","title":"Frequently Asked Questions (FAQ)","text":"Across different facets grouped_ plot, axes ranges might sometimes differ. can use ggplot.component parameter (present functions) scale across individual plots:","code":"# provide a list of further `{ggplot2}` modifications using `ggplot.component` grouped_ggscatterstats( mtcars, disp, hp, grouping.var = am, results.subtitle = FALSE, ggplot.component = list(ggplot2::scale_y_continuous( breaks = seq(50, 350, 50), limits = (c(50, 350)) )) )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/faq.html","id":"does-ggstatsplot-work-with-plotly","dir":"Articles > Web_only","previous_headings":"","what":"8. Does {ggstatsplot} work with plotly?","title":"Frequently Asked Questions (FAQ)","text":"plotly R graphing library makes easy produce interactive web graphics via plotly.js. ggstatsplot functions compatible plotly.","code":"library(plotly) # creating ggplot object with `{ggstatsplot}` p <- ggbetweenstats(mtcars, cyl, mpg) # converting to plotly object plotly::ggplotly(p, width = 480, height = 480)"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/faq.html","id":"how-can-i-use-grouped_-functions-with-more-than-one-group","dir":"Articles > Web_only","previous_headings":"","what":"9. How can I use grouped_ functions with more than one group?","title":"Frequently Asked Questions (FAQ)","text":"Currently, grouped_ variants functions support repeating analysis across single grouping variable. Often, run analysis across combination two grouping variables. can easily achieved using purrr package. example-","code":"# creating a list by splitting data frame by combination of two different # grouping variables df_list <- mpg %>% dplyr::filter(drv %in% c(\"4\", \"f\"), fl %in% c(\"p\", \"r\")) %>% split(f = list(.$drv, .$fl), drop = TRUE) # checking if the length of the list is 4 length(df_list) #> [1] 4 # running correlation analyses between; this will return a *list* of plots plot_list <- purrr::pmap( .l = list( data = df_list, x = \"displ\", y = \"hwy\", results.subtitle = FALSE ), .f = ggscatterstats ) # arrange the list in a single plot grid combine_plots( plotlist = plot_list, plotgrid.args = list(nrow = 2), annotation.args = list(tag_levels = \"i\") )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/faq.html","id":"how-can-i-include-statistical-expressions-in-facet-labels","dir":"Articles > Web_only","previous_headings":"","what":"10. How can I include statistical expressions in facet labels?","title":"Frequently Asked Questions (FAQ)","text":"","code":"library(ggplot2) # data mtcars1 <- mtcars p <- grouped_ggbetweenstats( data = mtcars1, x = cyl, y = mpg, grouping.var = am ) expr1 <- extract_subtitle(p[[1L]]) expr2 <- extract_subtitle(p[[2L]]) mtcars1$am <- factor(mtcars1$am, levels = c(0, 1), labels = c(expr1, expr2)) mtcars1 %>% ggplot(aes(x = cyl, y = mpg)) + geom_jitter() + facet_wrap( vars(am), ncol = 1, strip.position = \"top\", labeller = ggplot2::label_parsed )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/faq.html","id":"how-to-customize-which-pairs-are-shown-in-pairwise-comparisons","dir":"Articles > Web_only","previous_headings":"","what":"11. How to customize which pairs are shown in pairwise comparisons?","title":"Frequently Asked Questions (FAQ)","text":"Currently, ggbetweenstats ggwithinstats, can either display significant comparisons, non-significant comparisons, comparisons. interested just one particular comparison? workaround using ggsignif:","code":"library(ggsignif) ggbetweenstats(mtcars, cyl, wt, pairwise.display = \"none\") + geom_signif(comparisons = list(c(\"4\", \"6\")), test.args = list(exact = FALSE))"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/faq.html","id":"how-to-access-data-frame-with-results-from-pairwise-comparisons","dir":"Articles > Web_only","previous_headings":"","what":"12. How to access data frame with results from pairwise comparisons?","title":"Frequently Asked Questions (FAQ)","text":"Behind scenes, ggstatsplot uses statsExpressions::pairwise_comparisons() function. can use extract actual data frames used ggstatsplot functions.","code":"library(ggplot2) pairwise_comparisons(mtcars, cyl, wt) #> # A tibble: 3 × 9 #> group1 group2 statistic p.value alternative distribution p.adjust.method #> #> 1 4 6 5.39 0.00831 two.sided q Holm #> 2 4 8 9.11 0.0000124 two.sided q Holm #> 3 6 8 5.12 0.00831 two.sided q Holm #> test expression #> #> 1 Games-Howell #> 2 Games-Howell #> 3 Games-Howell "},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/faq.html","id":"how-can-i-change-annotation-in-pairwise-comparisons","dir":"Articles > Web_only","previous_headings":"","what":"13. How can I change annotation in pairwise comparisons?","title":"Frequently Asked Questions (FAQ)","text":"ggstatsplot defaults displaying exact p-values logged Bayes Factor values pairwise comparisons. wish adopt different annotation labels? customize :","code":"library(ggplot2) library(ggsignif) # converting to factor mtcars$cyl <- as.factor(mtcars$cyl) # creating the base plot p <- ggbetweenstats(mtcars, cyl, wt, pairwise.display = \"none\") # using `pairwise_comparisons()` function to create a data frame with results df <- pairwise_comparisons(mtcars, cyl, wt) %>% dplyr::mutate(groups = purrr::pmap(.l = list(group1, group2), .f = c)) %>% dplyr::arrange(group1) %>% dplyr::mutate(asterisk_label = c(\"**\", \"***\", \"**\")) df #> # A tibble: 3 × 11 #> group1 group2 statistic p.value alternative distribution p.adjust.method #> #> 1 4 6 5.39 0.00831 two.sided q Holm #> 2 4 8 9.11 0.0000124 two.sided q Holm #> 3 6 8 5.12 0.00831 two.sided q Holm #> test expression groups asterisk_label #> #> 1 Games-Howell ** #> 2 Games-Howell *** #> 3 Games-Howell ** # adding pairwise comparisons using `{ggsignif}` package p + ggsignif::geom_signif( comparisons = df$groups, map_signif_level = TRUE, annotations = df$asterisk_label, y_position = c(5.5, 5.75, 6.0), test = NULL, na.rm = TRUE )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/faq.html","id":"how-to-access-data-frame-containing-statistical-analyses","dir":"Articles > Web_only","previous_headings":"","what":"14. How to access data frame containing statistical analyses?","title":"Frequently Asked Questions (FAQ)","text":"can use extract_stats() helper function .","code":"library(ggplot2) p <- ggpiestats(mtcars, am, cyl) # data frame with results extract_stats(p) #> $subtitle_data #> # A tibble: 1 × 13 #> statistic df p.value method effectsize estimate #> #> 1 8.74 2 0.0126 Pearson's Chi-squared test Cramer's V (adj.) 0.464 #> conf.level conf.low conf.high conf.method conf.distribution n.obs expression #> #> 1 0.95 0 0.820 ncp chisq 32 #> #> $caption_data #> # A tibble: 1 × 15 #> term conf.level effectsize estimate conf.low conf.high #> #> 1 Ratio 0.95 Cramers_v 0.415 0 0.671 #> prior.distribution prior.location prior.scale bf10 #> #> 1 independent multinomial 0 1 16.8 #> method conf.method log_e_bf10 n.obs expression #> #> 1 Bayesian contingency table analysis ETI 2.82 32 #> #> $pairwise_comparisons_data #> NULL #> #> $descriptive_data #> # A tibble: 6 × 5 #> cyl am counts perc .label #> #> 1 4 1 8 72.7 73% #> 2 6 1 3 42.9 43% #> 3 8 1 2 14.3 14% #> 4 4 0 3 27.3 27% #> 5 6 0 4 57.1 57% #> 6 8 0 12 85.7 86% #> #> $one_sample_data #> # A tibble: 3 × 19 #> cyl counts perc N statistic df p.value #> #> 1 8 14 43.8 (n = 14) 7.14 1 0.00753 #> 2 6 7 21.9 (n = 7) 0.143 1 0.705 #> 3 4 11 34.4 (n = 11) 2.27 1 0.132 #> method effectsize estimate conf.level #> #> 1 Chi-squared test for given probabilities Pearson's C 0.581 0.95 #> 2 Chi-squared test for given probabilities Pearson's C 0.141 0.95 #> 3 Chi-squared test for given probabilities Pearson's C 0.414 0.95 #> conf.low conf.high conf.method conf.distribution n.obs expression #> #> 1 0.186 0.778 ncp chisq 14 #> 2 0 0.652 ncp chisq 7 #> 3 0 0.723 ncp chisq 11 #> .label #> #> 1 list(~chi['gof']^2~(1)==7.14, ~italic(p)=='7.53e-03', ~italic(n)=='14') #> 2 list(~chi['gof']^2~(1)==0.14, ~italic(p)=='0.71', ~italic(n)=='7') #> 3 list(~chi['gof']^2~(1)==2.27, ~italic(p)=='0.13', ~italic(n)=='11') #> .p.label #> #> 1 list(~italic(p)=='7.53e-03') #> 2 list(~italic(p)=='0.71') #> 3 list(~italic(p)=='0.13') #> #> $tidy_data #> NULL #> #> $glance_data #> NULL #> #> attr(,\"class\") #> [1] \"ggstatsplot_stats\" \"list\""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/faq.html","id":"how-can-i-remove-a-particular-geom-layer-from-the-plot","dir":"Articles > Web_only","previous_headings":"","what":"15. How can I remove a particular geom layer from the plot?","title":"Frequently Asked Questions (FAQ)","text":"Sometimes may want particular geom layer displayed. can remove setting transparency (alpha) layer 0. example, let’s say want remove points ggwithintstats() plot:","code":"# before ggwithinstats( data = bugs_long, x = condition, y = desire, results.subtitle = FALSE, pairwise.display = \"none\" ) # after ggwithinstats( data = bugs_long, x = condition, y = desire, point.args = list(alpha = 0), results.subtitle = FALSE, pairwise.display = \"none\" )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/faq.html","id":"how-can-i-modify-the-fill-colors-with-custom-values","dir":"Articles > Web_only","previous_headings":"","what":"16. How can I modify the fill colors with custom values?","title":"Frequently Asked Questions (FAQ)","text":"Sometimes may satisfied available color palette values. case, can also change colors manually specifying values. can also done grouped_ functions:","code":"library(ggplot2) ggbarstats(mtcars, am, cyl, results.subtitle = FALSE) + scale_fill_manual(values = c(\"#E7298A\", \"#66A61E\")) grouped_ggpiestats( data = mtcars, grouping.var = am, x = cyl, ggplot.component = ggplot2::scale_fill_grey() )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/faq.html","id":"how-can-i-modify-grouped_-outputs-using-ggplot2-functions","dir":"Articles > Web_only","previous_headings":"","what":"17. How can I modify grouped_ outputs using {ggplot2} functions?","title":"Frequently Asked Questions (FAQ)","text":"ggstatsplot ggplot objects, can modified, just like ggplot object. exception plots returned grouped_ functions, way tackle .","code":"library(paletteer) library(ggplot2) grouped_ggbetweenstats( mtcars, cyl, wt, grouping.var = am, results.subtitle = FALSE, pairwise.display = \"none\", # modify further with `{ggplot2}` functions ggplot.component = list( scale_color_manual(values = paletteer::paletteer_c(\"viridis::viridis\", 3)), theme(axis.text.x = element_text(angle = 90)) ) )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/faq.html","id":"how-can-i-extract-data-frame-containing-results-from-ggstatsplot","dir":"Articles > Web_only","previous_headings":"","what":"18. How can I extract data frame containing results from {ggstatsplot}?","title":"Frequently Asked Questions (FAQ)","text":"ggstatsplot can return expressions subtitle caption, want actually get back data frame containing results? two options: Use ggstatsplot::extract_stats() function go source package statsExpressions (see examples)","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/faq.html","id":"how-can-i-remove-sample-size-labels-for-ggbarstats","dir":"Articles > Web_only","previous_headings":"","what":"19. How can I remove sample size labels for ggbarstats?","title":"Frequently Asked Questions (FAQ)","text":"","code":"library(gginnards) ## create a plot p <- ggbarstats(mtcars, am, cyl) ## remove layer corresponding to sample size delete_layers(p, \"GeomText\")"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/faq.html","id":"statistical-analysis-i-want-to-carry-out-is-not-available--what-can-i-do","dir":"Articles > Web_only","previous_headings":"","what":"20. Statistical analysis I want to carry out is not available. What can I do?","title":"Frequently Asked Questions (FAQ)","text":"default, since ggstatsplot always allows just one type test per statistical approach, sometimes favorite test might available. example, ggstatsplot provides Spearman’s ρ\\rho, Kendall’s τ\\tau non-parametric correlation test. cases, can override defaults use statsExpressions create custom expressions display plot. forewarned expression building function statsExpressions stable yet.","code":"library(correlation) library(statsExpressions) library(ggplot2) # data with two variables of interest df <- dplyr::select(mtcars, wt, mpg) # correlation results results <- correlation(df, method = \"kendall\") %>% insight::standardize_names(style = \"broom\") # creating expression out of these results df_results <- statsExpressions::add_expression_col( data = results, no.parameters = 0L, statistic.text = list(quote(italic(\"T\"))), effsize.text = list(quote(widehat(italic(tau))[\"Kendall\"])), n = results$n.obs[[1]] ) # using custom expression in plot ggscatterstats(df, wt, mpg, results.subtitle = FALSE) + labs(subtitle = df_results$expression[[1]])"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/faq.html","id":"is-there-way-to-adjust-my-alpha-level","dir":"Articles > Web_only","previous_headings":"","what":"21. Is there way to adjust my alpha level?","title":"Frequently Asked Questions (FAQ)","text":", way adjust alpha use grouped_ functions (e.g., grouped_ggwithinstats). just report paper/article/report, adjusted alpha . , example, iif 2 tests carried , alpha going 0.05/2 = 0.025. , describe Methods section, can mention tests considered significant p < 0.025. can even mention caption.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/faq.html","id":"how-can-i-build-a-shiny-app-using-ggstatsplot-functions","dir":"Articles > Web_only","previous_headings":"","what":"22. How can I build a Shiny app using {ggstatsplot} functions?","title":"Frequently Asked Questions (FAQ)","text":"example using ggbetweenstats function.","code":"library(shiny) library(rlang) ui <- fluidPage( headerPanel(\"Example - ggbetweenstats\"), sidebarPanel( selectInput(\"x\", \"xcol\", \"X Variable\", choices = names(iris)[5]), selectInput(\"y\", \"ycol\", \"Y Variable\", choices = names(iris)[1:4]) ), mainPanel(plotOutput(\"plot\")) ) server <- function(input, output) { output$plot <- renderPlot({ ggbetweenstats(iris, !!input$x, !!input$y) }) } shinyApp(ui, server)"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/faq.html","id":"how-to-change-size-of-annotations-for-combined-plot-in-grouped_-functions","dir":"Articles > Web_only","previous_headings":"","what":"23. How to change size of annotations for combined plot in grouped_* functions?","title":"Frequently Asked Questions (FAQ)","text":"","code":"library(ggplot2) grouped_ggbetweenstats( data = dplyr::filter(ggplot2::mpg, drv != \"4\"), x = year, y = hwy, grouping.var = drv, results.subtitle = FALSE, ## arguments given to `{patchwork}` for combining plots annotation.args = list( title = \"this is my title\", subtitle = \"this is my subtitle\", theme = ggplot2::theme( plot.subtitle = element_text(size = 20), plot.title = element_text(size = 30) ) ) )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/faq.html","id":"how-to-change-size-of-text-in-the-subtitle","dir":"Articles > Web_only","previous_headings":"","what":"24. How to change size of text in the subtitle?","title":"Frequently Asked Questions (FAQ)","text":"","code":"ggbetweenstats( data = iris, x = Species, y = Sepal.Length, ggplot.component = list(theme(plot.subtitle = element_text(size = 20, face = \"bold\"))) )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/faq.html","id":"how-to-display-pairwise-comparison-letter-in-a-plot","dir":"Articles > Web_only","previous_headings":"","what":"25. How to display pairwise comparison letter in a plot?","title":"Frequently Asked Questions (FAQ)","text":"possible box, see comment.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/faq.html","id":"does-ggstatsplot-carry-out-assumption-checks","dir":"Articles > Web_only","previous_headings":"","what":"26. Does {ggstatsplot} carry out assumption checks?","title":"Frequently Asked Questions (FAQ)","text":", ggstatsplot carry analysis whether assumptions met . just carry whatever test ask carry . check assumptions, can use different package called performance: https://easystats.github.io/performance/reference/index.html#check-model-assumptions--data-properties","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/faq.html","id":"i-am-on-ubuntu-and-have-trouble-installing-pmcmrplus","dir":"Articles > Web_only","previous_headings":"","what":"27. I am on Ubuntu and have trouble installing {PMCMRplus}?","title":"Frequently Asked Questions (FAQ)","text":"Linux users may encounter installation problems. particular, ggstatsplot package depends {PMCMRplus} package. means operating system lacks gmp Rmpfr libraries. use Ubuntu, can install dependencies: following README file briefly describes installation procedure: https://CRAN.R-project.org/package=PMCMRplus/readme/README.html MacOS, look post.","code":"ERROR: dependencies ‘gmp’, ‘Rmpfr’ are not available for package ‘PMCMRplus’ sudo apt-get install libgmp3-dev sudo apt-get install libmpfr-dev"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/faq.html","id":"how-to-modify-the-secondary-y-axis-title","dir":"Articles > Web_only","previous_headings":"","what":"28. How to modify the secondary Y-axis title?","title":"Frequently Asked Questions (FAQ)","text":"","code":"ggbetweenstats( mtcars, cyl, wt, ggplot.component = list( ggplot2::scale_y_continuous(sec.axis = ggplot2::dup_axis(name = \"My custom test\")) ) )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/faq.html","id":"how-to-turn-off-scientific-notation-in-expressions","dir":"Articles > Web_only","previous_headings":"","what":"29. How to turn off scientific notation in expressions?","title":"Frequently Asked Questions (FAQ)","text":"","code":"set.seed(123) library(ggstatsplot) library(WRS2) ggwithinstats( WineTasting, Wine, Taste, paired = TRUE ) ggwithinstats( WineTasting, Wine, Taste, paired = TRUE, digits = 4L )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/faq.html","id":"suggestions","dir":"Articles > Web_only","previous_headings":"","what":"Suggestions","title":"Frequently Asked Questions (FAQ)","text":"find bugs suggestions/remarks, please file issue GitHub: https://github.com/IndrajeetPatil/ggstatsplot/issues","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggbarstats.html","id":"introduction-to-ggbarstats","dir":"Articles > Web_only","previous_headings":"","what":"Introduction to ggbarstats","title":"ggbarstats","text":"function ggbarstats can used quick data exploration /prepare publication-ready pie charts summarize statistical relationship(s) among one categorical variables. see examples use function vignette. begin , instances want use ggbarstats- check proportion observations matches hypothesized proportion, typically known “Goodness Fit” test see frequency distribution two categorical variables independent using contingency table analysis check proportion observations level categorical variable equal Note: following demo uses pipe operator (%>%), familiar operator, good explanation: http://r4ds..co.nz/pipes.html. ggbarstats works data organized data frames tibbles. work data structures like base-R tables matrices. can operate data frames organized one row per observation data frames one column containing counts. vignette provides examples (see examples ). help demonstrate ggbarstats can used categorical (also known nominal) data, modified version original Titanic dataset (datasets library) provided ggstatsplot package name Titanic_full. Titanic Passenger Survival Dataset provides information “fate passengers fatal maiden voyage ocean liner Titanic, including economic status (class), sex, age, survival.” Let’s look structure .","code":"library(dplyr) # looking at the original data in tabular format dplyr::glimpse(Titanic) #> 'table' num [1:4, 1:2, 1:2, 1:2] 0 0 35 0 0 0 17 0 118 154 ... #> - attr(*, \"dimnames\")=List of 4 #> ..$ Class : chr [1:4] \"1st\" \"2nd\" \"3rd\" \"Crew\" #> ..$ Sex : chr [1:2] \"Male\" \"Female\" #> ..$ Age : chr [1:2] \"Child\" \"Adult\" #> ..$ Survived: chr [1:2] \"No\" \"Yes\" # looking at the dataset as a tibble or data frame dplyr::glimpse(Titanic_full) #> Rows: 2,201 #> Columns: 5 #> $ id 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18… #> $ Class 3rd, 3rd, 3rd, 3rd, 3rd, 3rd, 3rd, 3rd, 3rd, 3rd, 3rd, 3rd, 3… #> $ Sex Male, Male, Male, Male, Male, Male, Male, Male, Male, Male, M… #> $ Age Child, Child, Child, Child, Child, Child, Child, Child, Child… #> $ Survived No, No, No, No, No, No, No, No, No, No, No, No, No, No, No, N…"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggbarstats.html","id":"independence-or-association-with-ggbarstats","dir":"Articles > Web_only","previous_headings":"","what":"Independence (or association) with ggbarstats","title":"ggbarstats","text":"Let’s next investigate whether passenger’s sex independent , associated , survival status, .e., want test whether proportion people survived different sexes. plot clearly shows survival rates different males females. Pearson’s χ2\\chi^2-test independence significant given large sample size. Additionally, females males, survival rates significantly different 50% indicated goodness fit test gender.","code":"ggbarstats( data = Titanic_full, x = Survived, y = Sex )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggbarstats.html","id":"grouped-analysis-with-grouped_ggbarstats","dir":"Articles > Web_only","previous_headings":"","what":"Grouped analysis with grouped_ggbarstats","title":"ggbarstats","text":"want analysis gender also factor passenger’s age (Age)? information classifies passengers Child Adult, perhaps makes difference survival rate? ggstatsplot provides special helper function instances: grouped_ggbarstats. convenient wrapper function around combine_plots. applies ggbarstats across levels specified grouping variable combines list individual plots single plot. Note grouping variable can anything: conditions given study, groups study sample, different studies, etc. resulting pie charts statistics make story clear. adults gender much matters. Women survived much higher rates men. children gender significantly associated survival male female children survival rate significantly different 50/50.","code":"grouped_ggbarstats( # arguments relevant for `ggbarstats()` data = Titanic_full, x = Survived, y = Sex, grouping.var = Age, digits.perc = 1, package = \"ggsci\", palette = \"category10_d3\", # arguments relevant for `combine_plots()` title.text = \"Passenger survival on the Titanic by gender and age\", caption.text = \"Asterisks denote results from proportion tests; \\n***: p < 0.001, ns: non-significant\", plotgrid.args = list(nrow = 2) )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggbarstats.html","id":"grouped-analysis-with-ggbarstats-purrr","dir":"Articles > Web_only","previous_headings":"","what":"Grouped analysis with ggbarstats + {purrr}","title":"ggbarstats","text":"Although grouped_ggbarstats provides quick way explore data, leaves much desired. example, may want add different captions, titles, themes, palettes level grouping variable, etc. cases like , better use purrr package. See associated vignette : https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/purrr_examples.html","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggbarstats.html","id":"working-with-data-organized-by-counts","dir":"Articles > Web_only","previous_headings":"","what":"Working with data organized by counts","title":"ggbarstats","text":"ggbarstats can also work data frame containing counts (aka tabled data), .e., row doesn’t correspond unique observation. example, consider following notional fishing data frame containing data two boats (B) number different types fish caught months February March. data frame, row corresponds unique combination Boat Month. data organized way, make slightly different call ggbarstats() function: use counts argument. want investigate relationship type fish month (test independence), command : results support hypothesis type fish caught related month ’re fishing. χ2\\chi^2 independence test results top plot. February catch significantly Haddock hypothesize equal distribution. Whereas March results indicate ’s strong evidence distribution isn’t equal.","code":"# (this is completely fictional; I don't know first thing about fishing!) fishing <- tibble::as_tibble(data.frame( Boat = c(rep(\"B\", 4), rep(\"A\", 4), rep(\"A\", 4), rep(\"B\", 4)), Month = c(rep(\"February\", 2), rep(\"March\", 2), rep(\"February\", 2), rep(\"March\", 2)), Fish = c( \"Bass\", \"Catfish\", \"Cod\", \"Haddock\", \"Cod\", \"Haddock\", \"Bass\", \"Catfish\", \"Bass\", \"Catfish\", \"Cod\", \"Haddock\", \"Cod\", \"Haddock\", \"Bass\", \"Catfish\" ), SumOfCaught = c(25, 20, 35, 40, 40, 25, 30, 42, 40, 30, 33, 26, 100, 30, 20, 20) )) fishing #> # A tibble: 16 × 4 #> Boat Month Fish SumOfCaught #> #> 1 B February Bass 25 #> 2 B February Catfish 20 #> 3 B March Cod 35 #> 4 B March Haddock 40 #> 5 A February Cod 40 #> 6 A February Haddock 25 #> 7 A March Bass 30 #> 8 A March Catfish 42 #> 9 A February Bass 40 #> 10 A February Catfish 30 #> 11 A March Cod 33 #> 12 A March Haddock 26 #> 13 B February Cod 100 #> 14 B February Haddock 30 #> 15 B March Bass 20 #> 16 B March Catfish 20 ggbarstats( data = fishing, x = Fish, y = Month, counts = SumOfCaught, label = \"both\", package = \"ggsci\", palette = \"default_jama\", title = \"Type fish caught by month\", caption = \"Source: completely made up\", legend.title = \"Type fish caught: \" )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggbarstats.html","id":"within-subjects-designs","dir":"Articles > Web_only","previous_headings":"","what":"Within-subjects designs","title":"ggbarstats","text":"Let’s imagine ’re conducting clinical trials new imaginary wonder drug. 134 subjects entering trial. enter healthy (n = 96), enter trial already sick (n = 38). receive treatment intervention. check back month see healthy sick. classic pre/post experimental design. ’re interested seeing change groupings. case within-subjects designs, can set paired = TRUE, display results McNemar test subtitle. (Note: forget set paired = TRUE, results inaccurate.) results bode well experimental wonder drug. 96 started healthy 4% sick month. Ideally, hoped zero reality seldom perfect. side 38 started sick number reduced just 13 34% marked improvement.","code":"# create imaginary data clinical_trial <- tibble::tribble( ~SickBefore, ~SickAfter, ~Counts, \"No\", \"Yes\", 4, \"Yes\", \"No\", 25, \"Yes\", \"Yes\", 13, \"No\", \"No\", 92 ) ggbarstats( data = clinical_trial, x = SickAfter, y = SickBefore, counts = Counts, paired = TRUE, label = \"both\", title = \"Results from imaginary clinical trial\", package = \"ggsci\", palette = \"default_ucscgb\" )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggbarstats.html","id":"summary-of-graphics-and-tests","dir":"Articles > Web_only","previous_headings":"","what":"Summary of graphics and tests","title":"ggbarstats","text":"Details underlying functions used create graphics statistical tests carried can found function documentation: https://indrajeetpatil.github.io/ggstatsplot/reference/ggbarstats.html","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggbarstats.html","id":"reporting","dir":"Articles > Web_only","previous_headings":"","what":"Reporting","title":"ggbarstats","text":"wish include statistical analysis results publication/report, ideal reporting practice hybrid two approaches: ggstatsplot approach, plot contains visual numerical summaries statistical model, standard narrative approach, provides interpretive context reported statistics. example, let’s see following example: narrative context (assuming type = \"parametric\") can complement plot either figure caption main text- Pearson’s χ2\\chi^2-test independence revealed , across 32 automobiles, showed significant association transmission engine number cylinders. Bayes Factor analysis revealed data 16.78 times probable alternative hypothesis compared null hypothesis. can considered strong evidence (Jeffreys, 1961) favor alternative hypothesis.","code":"ggbarstats(mtcars, am, cyl)"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggbarstats.html","id":"suggestions","dir":"Articles > Web_only","previous_headings":"","what":"Suggestions","title":"ggbarstats","text":"find bugs suggestions/remarks, please file issue GitHub: https://github.com/IndrajeetPatil/ggstatsplot/issues","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggbetweenstats.html","id":"comparisons-between-groups-with-ggbetweenstats","dir":"Articles > Web_only","previous_headings":"","what":"Comparisons between groups with ggbetweenstats","title":"ggbetweenstats","text":"illustrate function can used, use gapminder dataset throughout vignette. dataset provides values life expectancy, GDP per capita, population, 5 year intervals, 1952 2007, 142 countries (courtesy Gapminder Foundation). Let’s look data- Note: remainder vignette, ’re going exclude Oceania analysis simply observations (countries). Suppose first thing want inspect distribution life expectancy countries continent 2007. also want know mean differences life expectancy continents statistically significant. simplest form function call - Note: function automatically decides whether independent samples t-test preferred (2 groups) Oneway ANOVA (3 groups). based number levels grouping variable. output function ggplot object means can modified ggplot2 functions. can seen plot, function default returns Bayes Factor test. null hypothesis can’t rejected null hypothesis significance testing (NHST) approach, Bayesian approach can help index evidence favor null hypothesis (.e., BF01BF_{01}). default, natural logarithms shown Bayes Factor values can sometimes pretty large. values logarithmic scale also makes easy compare evidence favor alternative (BF10BF_{10}) versus null (BF01BF_{01}) hypotheses (since loge(BF01)=−loge(BF10)log_{e}(BF_{01}) = - log_{e}(BF_{10})). can make output much aesthetically pleasing well informative making use many optional parameters ggbetweenstats. ’ll add title caption, better x y axis labels. can change overall theme well color palette use. can appreciated effect size (partial eta squared) 0.635, large differences mean life expectancy across continents. Importantly, plot also helps us appreciate distributions within given continent. example, although Asian countries much better African countries, average, Afghanistan particularly grim average Asian continent, possibly reflecting war political turmoil. far used classic parametric test boxviolin plot, can also use available options: type (test) argument also accepts following abbreviations: \"p\" (parametric), \"np\" (nonparametric), \"r\" (robust), \"bf\" (Bayes Factor). type plot displayed can also modified (\"box\", \"violin\", \"boxviolin\"). color palettes can modified. Let’s use combine_plots function make one plot four separate plots demonstrates options. Let’s compare life expectancy countries first last year available data 1957 2007. generate plots one one use combine_plots merge one plot common labeling. possible, necessarily recommended, make plot different colors themes. example,","code":"library(gapminder) dplyr::glimpse(gapminder::gapminder) #> Rows: 1,704 #> Columns: 6 #> $ country \"Afghanistan\", \"Afghanistan\", \"Afghanistan\", \"Afghanistan\", … #> $ continent Asia, Asia, Asia, Asia, Asia, Asia, Asia, Asia, Asia, Asia, … #> $ year 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, … #> $ lifeExp 28.801, 30.332, 31.997, 34.020, 36.088, 38.438, 39.854, 40.8… #> $ pop 8425333, 9240934, 10267083, 11537966, 13079460, 14880372, 12… #> $ gdpPercap 779.4453, 820.8530, 853.1007, 836.1971, 739.9811, 786.1134, … ggbetweenstats( data = dplyr::filter(gapminder::gapminder, year == 2007, continent != \"Oceania\"), x = continent, y = lifeExp ) ggbetweenstats( data = dplyr::filter(gapminder, year == 2007, continent != \"Oceania\"), x = continent, ## grouping/independent variable y = lifeExp, ## dependent variables type = \"robust\", ## type of statistics xlab = \"Continent\", ## label for the x-axis ylab = \"Life expectancy\", ## label for the y-axis ## turn off messages ggtheme = ggplot2::theme_gray(), ## a different theme package = \"yarrr\", ## package from which color palette is to be taken palette = \"info2\", ## choosing a different color palette title = \"Comparison of life expectancy across continents (Year: 2007)\", caption = \"Source: Gapminder Foundation\" ) + ## modifying the plot further ggplot2::scale_y_continuous( limits = c(35, 85), breaks = seq(from = 35, to = 85, by = 5) ) ## selecting subset of the data df_year <- dplyr::filter(gapminder::gapminder, year == 2007 | year == 1957) p1 <- ggbetweenstats( data = df_year, x = year, y = lifeExp, xlab = \"Year\", ylab = \"Life expectancy\", # to remove violin plot violin.args = list(width = 0), type = \"p\", conf.level = 0.99, title = \"Parametric test\", package = \"ggsci\", palette = \"nrc_npg\" ) p2 <- ggbetweenstats( data = df_year, x = year, y = lifeExp, xlab = \"Year\", ylab = \"Life expectancy\", # to remove box plot boxplot.args = list(width = 0), type = \"np\", conf.level = 0.99, title = \"Non-parametric Test\", package = \"ggsci\", palette = \"uniform_startrek\" ) p3 <- ggbetweenstats( data = df_year, x = year, y = lifeExp, xlab = \"Year\", ylab = \"Life expectancy\", type = \"r\", conf.level = 0.99, title = \"Robust Test\", tr = 0.005, package = \"wesanderson\", palette = \"Royal2\", digits = 3 ) ## Bayes Factor for parametric t-test and boxviolin plot p4 <- ggbetweenstats( data = df_year, x = year, y = lifeExp, xlab = \"Year\", ylab = \"Life expectancy\", type = \"bayes\", violin.args = list(width = 0), boxplot.args = list(width = 0), point.args = list(alpha = 0), title = \"Bayesian Test\", package = \"ggsci\", palette = \"nrc_npg\" ) ## combining the individual plots into a single plot combine_plots( list(p1, p2, p3, p4), plotgrid.args = list(nrow = 2), annotation.args = list( title = \"Comparison of life expectancy between 1957 and 2007\", caption = \"Source: Gapminder Foundation\" ) )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggbetweenstats.html","id":"grouped-analysis-with-grouped_ggbetweenstats","dir":"Articles > Web_only","previous_headings":"","what":"Grouped analysis with grouped_ggbetweenstats","title":"ggbetweenstats","text":"want analyze continent 1957 2007? combination two previous efforts. ggstatsplot provides special helper function instances: grouped_ggbetweenstats. merely wrapper function around combine_plots. applies ggbetweenstats across levels specified grouping variable combines list individual plots single plot. Note grouping variable can anything: conditions given study, groups study sample, different studies, etc. Let’s focus 4 continents following years: 1967, 1987, 2007. Also, let’s carry pairwise comparisons see differences every pair continents. seen plot, although life expectancy improving steadily across continents go 1967 2007, improvement happening rate continents. Additionally, irrespective year look , still find significant differences life expectancy across continents surprisingly consistent across five decades (based observed effect sizes).","code":"## select part of the dataset and use it for plotting gapminder::gapminder %>% dplyr::filter(year %in% c(1967, 1987, 2007), continent != \"Oceania\") %>% grouped_ggbetweenstats( ## arguments relevant for ggbetweenstats x = continent, y = lifeExp, grouping.var = year, xlab = \"Continent\", ylab = \"Life expectancy\", pairwise.display = \"significant\", ## display only significant pairwise comparisons p.adjust.method = \"fdr\", ## adjust p-values for multiple tests using this method # ggtheme = ggthemes::theme_tufte(), package = \"ggsci\", palette = \"default_jco\", ## arguments relevant for combine_plots annotation.args = list(title = \"Changes in life expectancy across continents (1967-2007)\"), plotgrid.args = list(nrow = 3) )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggbetweenstats.html","id":"grouped-analysis-with-ggbetweenstats-purrr","dir":"Articles > Web_only","previous_headings":"","what":"Grouped analysis with ggbetweenstats + {purrr}","title":"ggbetweenstats","text":"Although grouping function provides quick way explore data, leaves much desired. example, type plot test applied years, maybe want change different years, maybe want gave different effect sizes different years. type customization different levels grouping variable possible grouped_ggbetweenstats, can easily achieved using purrr package. See associated vignette : https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/purrr_examples.html","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggbetweenstats.html","id":"within-subjects-designs","dir":"Articles > Web_only","previous_headings":"","what":"Within-subjects designs","title":"ggbetweenstats","text":"repeated measures designs, ggwithinstats() function can used: https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggwithinstats.html","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggbetweenstats.html","id":"summary-of-graphics-and-tests","dir":"Articles > Web_only","previous_headings":"","what":"Summary of graphics and tests","title":"ggbetweenstats","text":"Details underlying functions used create graphics statistical tests carried can found function documentation: https://indrajeetpatil.github.io/ggstatsplot/reference/ggbetweenstats.html","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggbetweenstats.html","id":"reporting","dir":"Articles > Web_only","previous_headings":"","what":"Reporting","title":"ggbetweenstats","text":"wish include statistical analysis results publication/report, ideal reporting practice hybrid two approaches: ggstatsplot approach, plot contains visual numerical summaries statistical model, standard narrative approach, provides interpretive context reported statistics. example, let’s see following example: narrative context (assuming type = \"parametric\") can complement plot either figure caption main text- Welch’s t-test revealed , across 60 guinea pigs, although tooth length higher animal received vitamin C via orange juice compared via ascorbic acid, effect statistically significant. effect size (g=0.49)(g = 0.49) medium, per Cohen’s (1988) conventions. Bayes Factor analysis revealed data 1.2 times probable alternative hypothesis compared null hypothesis. can considered weak evidence (Jeffreys, 1961) favor alternative hypothesis. Similar reporting style can followed function performs one-way ANOVA instead t-test.","code":"ggbetweenstats(ToothGrowth, supp, len)"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggbetweenstats.html","id":"suggestions","dir":"Articles > Web_only","previous_headings":"","what":"Suggestions","title":"ggbetweenstats","text":"find bugs suggestions/remarks, please file issue GitHub: https://github.com/IndrajeetPatil/ggstatsplot/issues","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcoefstats.html","id":"general-structure-of-the-plots","dir":"Articles > Web_only","previous_headings":"","what":"General structure of the plots","title":"ggcoefstats","text":"Although statistical models displayed plot may differ based class models investigated, aspects plot invariant across models: dot-whisker plot contains dot representing estimate confidence intervals (95% default). estimate can either effect sizes (tests depend F-statistic) regression coefficients (tests t-, χ2\\chi^{2}-, z-statistic), etc. confidence intervals can sometimes asymmetric bootstrapping used. label attached dot provide details statistical test carried typically contain estimate, statistic, p-value. caption contain diagnostic information, available, models can useful model selection: smaller Akaike’s Information Criterion (AIC) Bayesian Information Criterion (BIC) values, “better” model . output function ggplot2 object , thus, can modified (e.g., change themes, etc.) ggplot2 functions.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcoefstats.html","id":"supported-models","dir":"Articles > Web_only","previous_headings":"","what":"Supported models","title":"ggcoefstats","text":"regression models supported underlying packages also supported ggcoefstats().","code":"insight::supported_models() #> [1] \"aareg\" \"afex_aov\" #> [3] \"AKP\" \"Anova.mlm\" #> [5] \"anova.rms\" \"aov\" #> [7] \"aovlist\" \"Arima\" #> [9] \"averaging\" \"bamlss\" #> [11] \"bamlss.frame\" \"bayesQR\" #> [13] \"bayesx\" \"BBmm\" #> [15] \"BBreg\" \"bcplm\" #> [17] \"betamfx\" \"betaor\" #> [19] \"betareg\" \"BFBayesFactor\" #> [21] \"bfsl\" \"BGGM\" #> [23] \"bife\" \"bifeAPEs\" #> [25] \"bigglm\" \"biglm\" #> [27] \"blavaan\" \"blrm\" #> [29] \"bracl\" \"brglm\" #> [31] \"brmsfit\" \"brmultinom\" #> [33] \"btergm\" \"censReg\" #> [35] \"cgam\" \"cgamm\" #> [37] \"cglm\" \"clm\" #> [39] \"clm2\" \"clmm\" #> [41] \"clmm2\" \"clogit\" #> [43] \"coeftest\" \"complmrob\" #> [45] \"confusionMatrix\" \"coxme\" #> [47] \"coxph\" \"coxph_weightit\" #> [49] \"coxph.penal\" \"coxr\" #> [51] \"cpglm\" \"cpglmm\" #> [53] \"crch\" \"crq\" #> [55] \"crqs\" \"crr\" #> [57] \"dep.effect\" \"DirichletRegModel\" #> [59] \"draws\" \"drc\" #> [61] \"eglm\" \"elm\" #> [63] \"emmGrid\" \"epi.2by2\" #> [65] \"ergm\" \"feglm\" #> [67] \"feis\" \"felm\" #> [69] \"fitdistr\" \"fixest\" #> [71] \"flac\" \"flexsurvreg\" #> [73] \"flic\" \"gam\" #> [75] \"Gam\" \"gamlss\" #> [77] \"gamm\" \"gamm4\" #> [79] \"garch\" \"gbm\" #> [81] \"gee\" \"geeglm\" #> [83] \"ggcomparisons\" \"glht\" #> [85] \"glimML\" \"glm\" #> [87] \"Glm\" \"glm_weightit\" #> [89] \"glmerMod\" \"glmgee\" #> [91] \"glmm\" \"glmmadmb\" #> [93] \"glmmPQL\" \"glmmTMB\" #> [95] \"glmrob\" \"glmRob\" #> [97] \"glmx\" \"gls\" #> [99] \"gmnl\" \"hglm\" #> [101] \"HLfit\" \"htest\" #> [103] \"hurdle\" \"iv_robust\" #> [105] \"ivFixed\" \"ivprobit\" #> [107] \"ivreg\" \"lavaan\" #> [109] \"lm\" \"lm_robust\" #> [111] \"lme\" \"lmerMod\" #> [113] \"lmerModLmerTest\" \"lmodel2\" #> [115] \"lmrob\" \"lmRob\" #> [117] \"logistf\" \"logitmfx\" #> [119] \"logitor\" \"logitr\" #> [121] \"LORgee\" \"lqm\" #> [123] \"lqmm\" \"lrm\" #> [125] \"manova\" \"MANOVA\" #> [127] \"marginaleffects\" \"marginaleffects.summary\" #> [129] \"margins\" \"maxLik\" #> [131] \"mblogit\" \"mclogit\" #> [133] \"mcmc\" \"mcmc.list\" #> [135] \"MCMCglmm\" \"mcp1\" #> [137] \"mcp12\" \"mcp2\" #> [139] \"med1way\" \"mediate\" #> [141] \"merMod\" \"merModList\" #> [143] \"meta_bma\" \"meta_fixed\" #> [145] \"meta_random\" \"metaplus\" #> [147] \"mhurdle\" \"mipo\" #> [149] \"mira\" \"mixed\" #> [151] \"MixMod\" \"mixor\" #> [153] \"mjoint\" \"mle\" #> [155] \"mle2\" \"mlm\" #> [157] \"mlogit\" \"mmclogit\" #> [159] \"mmlogit\" \"mmrm\" #> [161] \"mmrm_fit\" \"mmrm_tmb\" #> [163] \"model_fit\" \"multinom\" #> [165] \"multinom_weightit\" \"mvord\" #> [167] \"negbinirr\" \"negbinmfx\" #> [169] \"nestedLogit\" \"ols\" #> [171] \"onesampb\" \"ordinal_weightit\" #> [173] \"orm\" \"pgmm\" #> [175] \"phyloglm\" \"phylolm\" #> [177] \"plm\" \"PMCMR\" #> [179] \"poissonirr\" \"poissonmfx\" #> [181] \"polr\" \"probitmfx\" #> [183] \"psm\" \"Rchoice\" #> [185] \"ridgelm\" \"riskRegression\" #> [187] \"rjags\" \"rlm\" #> [189] \"rlmerMod\" \"RM\" #> [191] \"rma\" \"rma.uni\" #> [193] \"robmixglm\" \"robtab\" #> [195] \"rq\" \"rqs\" #> [197] \"rqss\" \"rvar\" #> [199] \"Sarlm\" \"scam\" #> [201] \"selection\" \"sem\" #> [203] \"SemiParBIV\" \"semLm\" #> [205] \"semLme\" \"serp\" #> [207] \"slm\" \"speedglm\" #> [209] \"speedlm\" \"stanfit\" #> [211] \"stanmvreg\" \"stanreg\" #> [213] \"summary.lm\" \"survfit\" #> [215] \"survreg\" \"svy_vglm\" #> [217] \"svy2lme\" \"svychisq\" #> [219] \"svyglm\" \"svyolr\" #> [221] \"t1way\" \"tobit\" #> [223] \"trimcibt\" \"truncreg\" #> [225] \"vgam\" \"vglm\" #> [227] \"wbgee\" \"wblm\" #> [229] \"wbm\" \"wmcpAKP\" #> [231] \"yuen\" \"yuend\" #> [233] \"zcpglm\" \"zeroinfl\" #> [235] \"zerotrunc\""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcoefstats.html","id":"examples-of-supported-models","dir":"Articles > Web_only","previous_headings":"","what":"Examples of supported models","title":"ggcoefstats","text":"following examples organized statistics type. used much longer vignette examples wide collection regression models, sake maintainability, removed . old version can found .","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcoefstats.html","id":"t-statistic","dir":"Articles > Web_only","previous_headings":"Examples of supported models","what":"t-statistic","title":"ggcoefstats","text":"linear model (lm) linear mixed-effects model (lmer/lmerMod) Note mixed-effects models, fixed effects shown confidence intervals random effects terms. case, like see terms, can use parameters::model_parameters().","code":"library(lme4) # lm model mod1 <- stats::lm(formula = Reaction ~ Days, data = sleepstudy) # merMod model mod2 <- lme4::lmer(Reaction ~ Days + (Days | Subject), sleepstudy) # combining the two different plots combine_plots( plotlist = list( ggcoefstats(mod1) + ggplot2::labs(x = parse(text = \"'regression coefficient' ~italic(beta)\")), ggcoefstats(mod2) + ggplot2::labs( x = parse(text = \"'regression coefficient' ~italic(beta)\"), y = \"fixed effects\" ) ), plotgrid.args = list(nrow = 2), annotation.args = list(title = \"Relationship between movie budget and its IMDB rating\") )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcoefstats.html","id":"z-statistic","dir":"Articles > Web_only","previous_headings":"Examples of supported models","what":"z-statistic","title":"ggcoefstats","text":"Aalen’s additive regression model censored data (aareg)","code":"library(survival) # model afit <- survival::aareg( formula = Surv(time, status) ~ age + sex + ph.ecog, data = lung, dfbeta = TRUE ) ggcoefstats( x = afit, title = \"Aalen's additive regression model\", subtitle = \"(for censored data)\", digits = 3 )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcoefstats.html","id":"chi2-statistic","dir":"Articles > Web_only","previous_headings":"Examples of supported models","what":"χ2\\chi^2-statistic","title":"ggcoefstats","text":"Cox proportional hazards regression model (coxph) Another example frailty term.","code":"library(survival) # create the simplest-test data set test1 <- list( time = c(4, 3, 1, 1, 2, 2, 3), status = c(1, 1, 1, 0, 1, 1, 0), x = c(0, 2, 1, 1, 1, 0, 0), sex = c(0, 0, 0, 0, 1, 1, 1) ) # fit a stratified model mod_coxph <- survival::coxph( formula = Surv(time, status) ~ x + strata(sex), data = test1 ) ggcoefstats( x = mod_coxph, title = \"Cox proportional hazards regression model\" ) library(survival) # model mod_coxph <- survival::coxph( formula = Surv(time, status) ~ age + sex + frailty(inst), data = lung ) ggcoefstats( x = mod_coxph, title = \"Proportional Hazards Regression Model\\nwith Frailty penalty function\" )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcoefstats.html","id":"f-statistic","dir":"Articles > Web_only","previous_headings":"Examples of supported models","what":"F-statistic","title":"ggcoefstats","text":"omnibus ANOVA (aov) Note can also use function model selection. can try different models code see AIC BIC values change.","code":"library(ggplot2) # model mod_aov <- stats::aov(formula = rating ~ mpaa * genre, data = movies_long) ggcoefstats( x = mod_aov, effectsize.type = \"omega\", # changing the effect size estimate being displayed point.args = list(color = \"red\", size = 4, shape = 15), # changing the point geom package = \"dutchmasters\", # package from which color palette is to be taken palette = \"milkmaid\", # color palette for labels title = \"omnibus ANOVA\", # title for the plot exclude.intercept = TRUE ) + # further modification with the ggplot2 commands # note the order in which the labels are entered ggplot2::scale_y_discrete(labels = c(\"MPAA\", \"Genre\", \"Interaction term\")) + ggplot2::labs(x = \"effect size estimate (eta-squared)\", y = NULL) combine_plots( plotlist = list( # model 1 ggcoefstats( x = stats::aov(formula = rating ~ mpaa, data = movies_long), title = \"1. Only MPAA ratings\" ), # model 2 ggcoefstats( x = stats::aov(formula = rating ~ genre, data = movies_long), title = \"2. Only genre\" ), # model 3 ggcoefstats( x = stats::aov(formula = rating ~ mpaa + genre, data = movies_long), title = \"3. Additive effect of MPAA and genre\" ), # model 4 ggcoefstats( x = stats::aov(formula = rating ~ mpaa * genre, data = movies_long), title = \"4. Multiplicative effect of MPAA and genre\" ) ), annotation.args = list(title = \"Model selection using ggcoefstats\") )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcoefstats.html","id":"bayesian-models---no-statistic","dir":"Articles > Web_only","previous_headings":"Examples of supported models","what":"Bayesian models - no statistic","title":"ggcoefstats","text":"","code":"library(BayesFactor) # one sample t-test mod1 <- ttestBF(mtcars$wt, mu = 3) # independent t-test mod2 <- ttestBF(formula = wt ~ am, data = mtcars) # paired t-test mod3 <- ttestBF(x = sleep$extra[1:10], y = sleep$extra[11:20], paired = TRUE) # correlation mod4 <- correlationBF(y = iris$Sepal.Length, x = iris$Sepal.Width) # contingency tabs (not supported) data(\"raceDolls\") mod5 <- contingencyTableBF( raceDolls, sampleType = \"indepMulti\", fixedMargin = \"cols\" ) # anova data(\"puzzles\") mod6 <- anovaBF( formula = RT ~ shape * color + ID, data = puzzles, whichRandom = \"ID\", whichModels = \"top\", progress = FALSE ) # regression-1 mod7 <- regressionBF(rating ~ ., data = attitude, progress = FALSE) # meta-analysis t <- c(-0.15, 2.39, 2.42, 2.43, -0.15, 2.39, 2.42, 2.43) N <- c(100, 150, 97, 99, 99, 97, 100, 150) mod8 <- meta.ttestBF(t, N, rscale = 1, nullInterval = c(0, Inf)) # proportion test mod9 <- proportionBF(y = 15, N = 25, p = 0.5) # list of plots combine_plots( plotlist = list( ggcoefstats(mod1, title = \"one sample t-test\"), ggcoefstats(mod2, title = \"independent t-test\"), ggcoefstats(mod3, title = \"paired t-test\"), ggcoefstats(mod4, title = \"correlation\"), ggcoefstats(mod5, title = \"contingency table\", effectsize.type = \"cramers_v\"), ggcoefstats(mod6, title = \"anova\"), ggcoefstats(mod7, title = \"regression-1\"), ggcoefstats(mod8, title = \"meta-analysis\"), ggcoefstats(mod9, title = \"proportion test\") ), annotation.args = list(title = \"Example from `{BayesFactor}` package\") )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcoefstats.html","id":"regression-models-with-list-outputs","dir":"Articles > Web_only","previous_headings":"Examples of supported models","what":"Regression models with list outputs","title":"ggcoefstats","text":"Note number regression models return object class list, case function fail. often can extract object interest list use plot regression coefficients.","code":"library(gamm4) # data dat <- gamSim(1, n = 400, scale = 2) # now add 20 level random effect `fac'... dat$fac <- fac <- as.factor(sample(1:20, 400, replace = TRUE)) dat$y <- dat$y + model.matrix(~ fac - 1) %*% rnorm(20) * .5 # model object br <- gamm4::gamm4( formula = y ~ s(x0) + x1 + s(x2), data = dat, random = ~ (1 | fac) ) # looking at the classes of the objects contained in the list purrr::map(br, class) combine_plots( plotlist = list( # first object plot (only parametric terms are shown) ggcoefstats( x = br$gam, title = \"generalized additive model (parametric terms)\", digits = 3 ), # second object plot ggcoefstats( x = br$mer, title = \"linear mixed-effects model\", digits = 3 ) ), plotgrid.args = list(nrow = 1) )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcoefstats.html","id":"meta-analysis","dir":"Articles > Web_only","previous_headings":"","what":"Meta-analysis","title":"ggcoefstats","text":"case estimates displaying come multiple studies, can also use function carry random-effects meta-analysis. data frame enter must contain minimum following three columns- term: column names/identifiers annotate study/effect estimate: column observed effect sizes outcomes std.error: column corresponding standard errors","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcoefstats.html","id":"parametric","dir":"Articles > Web_only","previous_headings":"Meta-analysis","what":"parametric","title":"ggcoefstats","text":"","code":"library(metaplus) # renaming to what the function expects df <- dplyr::rename(mag, estimate = yi, std.error = sei, term = study) ggcoefstats( x = df, meta.analytic.effect = TRUE, bf.message = TRUE, meta.type = \"parametric\", title = \"parametric random-effects meta-analysis\" )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcoefstats.html","id":"robust","dir":"Articles > Web_only","previous_headings":"Meta-analysis","what":"robust","title":"ggcoefstats","text":"","code":"library(metaplus) # renaming to what the function expects df <- dplyr::rename(mag, estimate = yi, std.error = sei, term = study) ggcoefstats( x = df, meta.analytic.effect = TRUE, meta.type = \"robust\", title = \"robust random-effects meta-analysis\" )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcoefstats.html","id":"bayesian","dir":"Articles > Web_only","previous_headings":"Meta-analysis","what":"Bayesian","title":"ggcoefstats","text":"","code":"library(metaplus) # renaming to what the function expects df <- dplyr::rename(mag, estimate = yi, std.error = sei, term = study) ggcoefstats( x = df, meta.analytic.effect = TRUE, meta.type = \"bayes\", title = \"Bayesian random-effects meta-analysis\" )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcoefstats.html","id":"data-frames","dir":"Articles > Web_only","previous_headings":"","what":"Data frames","title":"ggcoefstats","text":"Sometimes don’t model object custom data frame want display using function. data frame plotted, must contain columns named term (names predictors), estimate (corresponding estimates coefficients quantities interest). optional columns conf.low conf.high (confidence intervals), p.value. also specify type statistic relevant regression models (\"t\", \"z\", \"f\", \"chi\") case want display statistical labels. can also provide data frame containing relevant information additionally displaying labels statistical information.","code":"# let's create a data frame df_full <- tibble::tribble( ~term, ~statistic, ~estimate, ~std.error, ~p.value, ~df.error, \"study1\", 0.158, 0.0665, 0.778, 0.875, 5L, \"study2\", 1.33, 0.542, 0.280, 0.191, 10L, \"study3\", 1.24, 0.045, 0.030, 0.001, 12L, \"study4\", 0.156, 0.500, 0.708, 0.885, 8L, \"study5\", 0.33, 0.032, 0.280, 0.101, 2L, \"study6\", 1.04, 0.085, 0.030, 0.001, 3L ) ggcoefstats( x = df_full, meta.analytic.effect = TRUE, statistic = \"t\", package = \"LaCroixColoR\", palette = \"paired\" )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcoefstats.html","id":"non-plot-outputs","dir":"Articles > Web_only","previous_headings":"","what":"Non-plot outputs","title":"ggcoefstats","text":"function can also used extract outputs plot, although much preferable use underlying functions instead (parameters::model_parameters).","code":"# data DNase1 <- subset(DNase, Run == 1) # using a selfStart model nlmod <- stats::nls(density ~ SSlogis(log(conc), Asym, xmid, scal), DNase1) # data frames ggcoefstats(nlmod) %>% extract_stats() #> $subtitle_data #> NULL #> #> $caption_data #> NULL #> #> $pairwise_comparisons_data #> NULL #> #> $descriptive_data #> NULL #> #> $one_sample_data #> NULL #> #> $tidy_data #> # A tibble: 3 × 11 #> term estimate std.error conf.level conf.low conf.high statistic df.error #> #> 1 Asym 2.35 0.0782 0.95 2.18 2.51 30.0 13 #> 2 xmid 1.48 0.0814 0.95 1.31 1.66 18.2 13 #> 3 scal 1.04 0.0323 0.95 0.972 1.11 32.3 13 #> p.value conf.method expression #> #> 1 2.17e-13 Wald #> 2 1.22e-10 Wald #> 3 8.51e-14 Wald #> #> $glance_data #> # A tibble: 0 × 0 #> #> attr(,\"class\") #> [1] \"ggstatsplot_stats\" \"list\""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcoefstats.html","id":"summary-of-graphics-and-tests","dir":"Articles > Web_only","previous_headings":"","what":"Summary of graphics and tests","title":"ggcoefstats","text":"Details underlying functions used create graphics statistical tests carried can found function documentation: https://indrajeetpatil.github.io/ggstatsplot/reference/gghistostats.html","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcoefstats.html","id":"not-supported","dir":"Articles > Web_only","previous_headings":"","what":"Not supported","title":"ggcoefstats","text":"vignette supposed give comprehensive account regression models supported ggcoefstats. list supported models keep expanding additional tidiers added parameters performance packages. Note models supported packages supported ggcoefstats(). particular, classes objects column estimate (e.g., kmeans, optim, muhaz, survdiff, zoo, etc.) supported.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcoefstats.html","id":"suggestions","dir":"Articles > Web_only","previous_headings":"","what":"Suggestions","title":"ggcoefstats","text":"find bugs suggestions/remarks, please file issue GitHub: https://github.com/IndrajeetPatil/ggstatsplot/issues","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcorrmat.html","id":"correlation-matrix-plot-with-ggcorrmat","dir":"Articles > Web_only","previous_headings":"","what":"Correlation matrix plot with ggcorrmat()","title":"ggcorrmat","text":"first example, use gapminder dataset (available eponymous package CRAN) provides values life expectancy, Gross Domestic Product (GDP) per capita, population, every five years, 1952 2007, 142 countries collected Gapminder Foundation. Let’s look data- Let’s say interested studying correlation population country, average life expectancy, GDP per capita across countries year 2007. simplest way get correlation matrix stick defaults- plot can modified additional arguments- seen correlation matrix, although relationship population life expectancy worldwide, least 2007, strong positive relationship GDP, well-established indicator country’s economic performance. Given three variables, doesn’t look impressive. let’s work another example ggplot2 package: diamonds dataset. dataset contains prices attributes almost 54,000 diamonds. Let’s look data- Let’s see correlation matrix different attributes diamond price. can make number changes basic correlation matrix. example, since interested relationship price attributes, let’s make price column first column. seen , unsurprisingly, strongest predictor diamond price carat value, unit mass equal 200 mg. words, heavier diamond, expensive going .","code":"library(gapminder) library(dplyr) dplyr::glimpse(gapminder) #> Rows: 1,704 #> Columns: 6 #> $ country \"Afghanistan\", \"Afghanistan\", \"Afghanistan\", \"Afghanistan\", … #> $ continent Asia, Asia, Asia, Asia, Asia, Asia, Asia, Asia, Asia, Asia, … #> $ year 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, … #> $ lifeExp 28.801, 30.332, 31.997, 34.020, 36.088, 38.438, 39.854, 40.8… #> $ pop 8425333, 9240934, 10267083, 11537966, 13079460, 14880372, 12… #> $ gdpPercap 779.4453, 820.8530, 853.1007, 836.1971, 739.9811, 786.1134, … ## select data only from the year 2007 gapminder_2007 <- dplyr::filter(gapminder::gapminder, year == 2007) ## producing the correlation matrix ggcorrmat( data = gapminder_2007, ## data from which variable is to be taken cor.vars = lifeExp:gdpPercap ## specifying correlation matrix variables ) ggcorrmat( data = gapminder_2007, ## data from which variable is to be taken cor.vars = lifeExp:gdpPercap, ## specifying correlation matrix variables cor.vars.names = c( \"Life Expectancy\", \"population\", \"GDP (per capita)\" ), type = \"np\", ## which correlation coefficient is to be computed lab.col = \"red\", ## label color ggtheme = ggplot2::theme_light(), ## selected ggplot2 theme ## turn off default ggestatsplot theme overlay matrix.type = \"lower\", ## correlation matrix structure colors = NULL, ## turning off manual specification of colors palette = \"category10_d3\", ## choosing a color palette package = \"ggsci\", ## package to which color palette belongs title = \"Gapminder correlation matrix\", ## custom title subtitle = \"Source: Gapminder Foundation\" ## custom subtitle ) library(ggplot2) dplyr::glimpse(ggplot2::diamonds) #> Rows: 53,940 #> Columns: 10 #> $ carat 0.23, 0.21, 0.23, 0.29, 0.31, 0.24, 0.24, 0.26, 0.22, 0.23, 0.… #> $ cut Ideal, Premium, Good, Premium, Good, Very Good, Very Good, Ver… #> $ color E, E, E, I, J, J, I, H, E, H, J, J, F, J, E, E, I, J, J, J, I,… #> $ clarity SI2, SI1, VS1, VS2, SI2, VVS2, VVS1, SI1, VS2, VS1, SI1, VS1, … #> $ depth 61.5, 59.8, 56.9, 62.4, 63.3, 62.8, 62.3, 61.9, 65.1, 59.4, 64… #> $ table 55, 61, 65, 58, 58, 57, 57, 55, 61, 61, 55, 56, 61, 54, 62, 58… #> $ price 326, 326, 327, 334, 335, 336, 336, 337, 337, 338, 339, 340, 34… #> $ x 3.95, 3.89, 4.05, 4.20, 4.34, 3.94, 3.95, 4.07, 3.87, 4.00, 4.… #> $ y 3.98, 3.84, 4.07, 4.23, 4.35, 3.96, 3.98, 4.11, 3.78, 4.05, 4.… #> $ z 2.43, 2.31, 2.31, 2.63, 2.75, 2.48, 2.47, 2.53, 2.49, 2.39, 2.… ## let's use just 5% of the data to speed it up ggcorrmat( data = dplyr::sample_frac(ggplot2::diamonds, size = 0.05), cor.vars = c(carat, depth:z), ## note how the variables are getting selected cor.vars.names = c( \"carat\", \"total depth\", \"table\", \"price\", \"length (in mm)\", \"width (in mm)\", \"depth (in mm)\" ), ggcorrplot.args = list(outline.color = \"black\", hc.order = TRUE) ) ## let's use just 5% of the data to speed it up ggcorrmat( data = dplyr::sample_frac(ggplot2::diamonds, size = 0.05), cor.vars = c(price, carat, depth:table, x:z), ## note how the variables are getting selected cor.vars.names = c( \"price\", \"carat\", \"total depth\", \"table\", \"length (in mm)\", \"width (in mm)\", \"depth (in mm)\" ), type = \"np\", title = \"Relationship between diamond attributes and price\", subtitle = \"Dataset: Diamonds from ggplot2 package\", colors = c(\"#0072B2\", \"#D55E00\", \"#CC79A7\"), pch = \"square cross\", ## additional aesthetic arguments passed to `ggcorrmat()` ggcorrplot.args = list( lab_col = \"yellow\", lab_size = 6, tl.srt = 90, pch.col = \"white\", pch.cex = 14 ) ) + ## modification outside `{ggstatsplot}` using `{ggplot2}` functions ggplot2::theme( axis.text.x = ggplot2::element_text( margin = ggplot2::margin(t = 0.15, r = 0.15, b = 0.15, l = 0.15, unit = \"cm\") ) )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcorrmat.html","id":"grouped-analysis-with-grouped_ggcorrmat","dir":"Articles > Web_only","previous_headings":"","what":"Grouped analysis with grouped_ggcorrmat","title":"ggcorrmat","text":"want analysis separately quality diamond cut (Fair, Good, Good, Premium, Ideal)? ggstatsplot provides special helper function instances: grouped_ggcorrmat(). merely wrapper function around combine_plots(). applies ggcorrmat() across levels specified grouping variable combines list individual plots single plot. Note function also makes easy run correlation matrix across different levels factor/grouping variable.","code":"grouped_ggcorrmat( ## arguments relevant for `ggcorrmat()` data = ggplot2::diamonds, cor.vars = c(price, carat, depth), grouping.var = cut, ## arguments relevant for `combine_plots()` plotgrid.args = list(nrow = 3), annotation.args = list( tag_levels = \"a\", title = \"Relationship between diamond attributes and price across cut\", caption = \"Dataset: Diamonds from ggplot2 package\" ) )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcorrmat.html","id":"data-frame","dir":"Articles > Web_only","previous_headings":"","what":"Data frame","title":"ggcorrmat","text":"want data frame (grouped) correlation matrix, use correlation::correlation() instead. can also grouped analysis used output dplyr::group_by().","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcorrmat.html","id":"grouped-analysis-with-ggcorrmat-purrr","dir":"Articles > Web_only","previous_headings":"","what":"Grouped analysis with ggcorrmat() + {purrr}","title":"ggcorrmat","text":"Although grouped_ function good quickly exploring data, reduces flexibility function can used. common parameters used applied plots corresponding levels grouping variable way customize arguments different levels grouping variable. see can done using purrr package. See associated vignette : https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/purrr_examples.html","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcorrmat.html","id":"summary-of-graphics-and-tests","dir":"Articles > Web_only","previous_headings":"","what":"Summary of graphics and tests","title":"ggcorrmat","text":"Details underlying functions used create graphics statistical tests carried can found function documentation: https://indrajeetpatil.github.io/ggstatsplot/reference/gghistostats.html","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcorrmat.html","id":"suggestions","dir":"Articles > Web_only","previous_headings":"","what":"Suggestions","title":"ggcorrmat","text":"find bugs suggestions/remarks, please file issue GitHub: https://github.com/IndrajeetPatil/ggstatsplot/issues","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggdotplotstats.html","id":"distribution-of-a-sample-with-ggdotplotstats","dir":"Articles > Web_only","previous_headings":"","what":"Distribution of a sample with ggdotplotstats","title":"ggdotplotstats","text":"Let’s begin simple example ggplot2 package (ggplot2::mpg), subset fuel economy data EPA makes available http://fueleconomy.gov. Let’s say want visualize distribution mileage car manufacturer.","code":"## looking at the structure of the data using glimpse dplyr::glimpse(ggplot2::mpg) #> Rows: 234 #> Columns: 11 #> $ manufacturer \"audi\", \"audi\", \"audi\", \"audi\", \"audi\", \"audi\", \"audi\", \"… #> $ model \"a4\", \"a4\", \"a4\", \"a4\", \"a4\", \"a4\", \"a4\", \"a4 quattro\", \"… #> $ displ 1.8, 1.8, 2.0, 2.0, 2.8, 2.8, 3.1, 1.8, 1.8, 2.0, 2.0, 2.… #> $ year 1999, 1999, 2008, 2008, 1999, 1999, 2008, 1999, 1999, 200… #> $ cyl 4, 4, 4, 4, 6, 6, 6, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 8, 8, … #> $ trans \"auto(l5)\", \"manual(m5)\", \"manual(m6)\", \"auto(av)\", \"auto… #> $ drv \"f\", \"f\", \"f\", \"f\", \"f\", \"f\", \"f\", \"4\", \"4\", \"4\", \"4\", \"4… #> $ cty 18, 21, 20, 21, 16, 18, 18, 18, 16, 20, 19, 15, 17, 17, 1… #> $ hwy 29, 29, 31, 30, 26, 26, 27, 26, 25, 28, 27, 25, 25, 25, 2… #> $ fl \"p\", \"p\", \"p\", \"p\", \"p\", \"p\", \"p\", \"p\", \"p\", \"p\", \"p\", \"p… #> $ class \"compact\", \"compact\", \"compact\", \"compact\", \"compact\", \"c… ## removing factor level with very few no. of observations df <- dplyr::filter(ggplot2::mpg, cyl %in% c(\"4\", \"6\")) ## creating a vector of colors using `paletteer` package paletter_vector <- paletteer::paletteer_d( palette = \"palettetown::venusaur\", n = nlevels(as.factor(df$manufacturer)), type = \"discrete\" ) ggdotplotstats( data = df, x = cty, y = manufacturer, xlab = \"city miles per gallon\", ylab = \"car manufacturer\", test.value = 15.5, point.args = list( shape = 16, color = paletter_vector, size = 5 ), title = \"Distribution of mileage of cars\", ggtheme = ggplot2::theme_dark() )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggdotplotstats.html","id":"grouped-analysis-with-grouped_ggdotplotstats","dir":"Articles > Web_only","previous_headings":"","what":"Grouped analysis with grouped_ggdotplotstats","title":"ggdotplotstats","text":"want analysis separately different engines different numbers cylinders? ggstatsplot provides special helper function instances: grouped_ggdotplotstats. merely wrapper function around combine_plots. applies ggdotplotstats across levels specified grouping variable combines individual plots single plot. Let’s see can use function apply ggdotplotstats accomplish task.","code":"## removing factor level with very few no. of observations df <- dplyr::filter(ggplot2::mpg, cyl %in% c(\"4\", \"6\")) grouped_ggdotplotstats( ## arguments relevant for ggdotplotstats data = df, grouping.var = cyl, ## grouping variable x = cty, y = manufacturer, xlab = \"city miles per gallon\", ylab = \"car manufacturer\", type = \"bayes\", ## Bayesian test test.value = 15.5, ## arguments relevant for `combine_plots` annotation.args = list(title = \"Fuel economy data\"), plotgrid.args = list(nrow = 2) )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggdotplotstats.html","id":"grouped-analysis-with-purrr","dir":"Articles > Web_only","previous_headings":"","what":"Grouped analysis with {purrr}","title":"ggdotplotstats","text":"Although quick dirty way explore large amount data minimal effort, come important limitation: reduced flexibility. example, wanted add, let’s say, separate test.value argument gender, possible grouped_ggdotplotstats. cases like , run separate kinds tests (robust , parametric , Bayesian levels group) better use purrr. See associated vignette : https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/purrr_examples.html","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggdotplotstats.html","id":"summary-of-graphics-and-tests","dir":"Articles > Web_only","previous_headings":"","what":"Summary of graphics and tests","title":"ggdotplotstats","text":"Details underlying functions used create graphics statistical tests carried can found function documentation: https://indrajeetpatil.github.io/ggstatsplot/reference/ggdotplotstats.html","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggdotplotstats.html","id":"reporting","dir":"Articles > Web_only","previous_headings":"","what":"Reporting","title":"ggdotplotstats","text":"wish include statistical analysis results publication/report, ideal reporting practice hybrid two approaches: ggstatsplot approach, plot contains visual numerical summaries statistical model, standard narrative approach, provides interpretive context reported statistics. example, let’s see following example: narrative context (assuming type = \"parametric\") can complement plot either figure caption main text- Student’s t-test revealed , across 5 experiments, speed light significantly different posited speed. effect size (g=1.22)(g = 1.22) large, per Cohen’s (1988) conventions. Bayes Factor analysis revealed data 3.46 times probable alternative hypothesis compared null hypothesis. can considered moderate evidence (Jeffreys, 1961) favor alternative hypothesis.","code":"ggdotplotstats(morley, Speed, Expt, test.value = 800)"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggdotplotstats.html","id":"suggestions","dir":"Articles > Web_only","previous_headings":"","what":"Suggestions","title":"ggdotplotstats","text":"find bugs suggestions/remarks, please file issue GitHub: https://github.com/IndrajeetPatil/ggstatsplot/issues","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/gghistostats.html","id":"statistical-analysis-with-gghistostats","dir":"Articles > Web_only","previous_headings":"","what":"Statistical analysis with gghistostats","title":"gghistostats","text":"Let’s begin simple example psych package (psych::sat.act), sample 700 self-reported scores SAT Verbal, SAT Quantitative ACT tests. ACT composite scores may range 1 - 36. National norms mean 20. get simple histogram statistics special information. gghistostats default choose binwidth max(x) - min(x) / sqrt(N). always check value explore multiple widths find best illustrate stories data since histograms sensitive binwidth. Let’s display national norms (labeled “Test”) test hypothesis sample mean national population mean 20 using parametric one sample t-test (type = \"p\"). gghistostats computed Bayes Factors quantify likelihood research (BF10) null hypothesis (BF01). current example, Bayes Factor value provides strong evidence (Kass Rafferty, 1995) favor research hypothesis: ACT scores much higher national average. log(Bayes factor) 492.5 means odds 7.54e+213:1 sample different.","code":"## loading needed libraries library(psych) library(dplyr) ## looking at the structure of the data using glimpse dplyr::glimpse(psych::sat.act) #> Rows: 700 #> Columns: 6 #> $ gender 2, 2, 2, 1, 1, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 2, 2, 2, 1, 2, … #> $ education 3, 3, 3, 4, 2, 5, 5, 3, 4, 5, 3, 4, 4, 4, 3, 4, 3, 4, 4, 4, … #> $ age 19, 23, 20, 27, 33, 26, 30, 19, 23, 40, 23, 34, 32, 41, 20, … #> $ ACT 24, 35, 21, 26, 31, 28, 36, 22, 22, 35, 32, 29, 21, 35, 27, … #> $ SATV 500, 600, 480, 550, 600, 640, 610, 520, 400, 730, 760, 710, … #> $ SATQ 500, 500, 470, 520, 550, 640, 500, 560, 600, 800, 710, 600, … gghistostats( data = psych::sat.act, ## data from which variable is to be taken x = ACT, ## numeric variable xlab = \"ACT Score\", ## x-axis label title = \"Distribution of ACT Scores\", ## title for the plot test.value = 20, ## test value caption = \"Data courtesy of: SAPA project (https://sapa-project.org)\" )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/gghistostats.html","id":"grouped-analysis-with-grouped_gghistostats","dir":"Articles > Web_only","previous_headings":"","what":"Grouped analysis with grouped_gghistostats","title":"gghistostats","text":"want analysis separately gender? ggstatsplot provides special helper function instances: grouped_gghistostats. merely wrapper function around combine_plots. applies gghistostats across levels specified grouping variable combines individual plots single plot. Note grouping variable can anything: conditions given study, groups study sample, different studies, etc. Let’s see can use function apply gghistostats accomplish task. can seen plots, mean value much higher national norm. Additionally, see benefits plotting data separately gender. can see differences distributions.","code":"grouped_gghistostats( ## arguments relevant for gghistostats data = psych::sat.act, x = ACT, ## same outcome variable xlab = \"ACT Score\", grouping.var = gender, ## grouping variable males = 1, females = 2 type = \"robust\", ## robust test: one-sample percentile bootstrap test.value = 20, ## test value against which sample mean is to be compared centrality.line.args = list(color = \"#D55E00\", linetype = \"dashed\"), # ggtheme = ggthemes::theme_stata(), ## changing default theme ## turn off ggstatsplot theme layer ## arguments relevant for combine_plots annotation.args = list( title = \"Distribution of ACT scores across genders\", caption = \"Data courtesy of: SAPA project (https://sapa-project.org)\" ), plotgrid.args = list(nrow = 2) )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/gghistostats.html","id":"grouped-analysis-with-purrr","dir":"Articles > Web_only","previous_headings":"","what":"Grouped analysis with {purrr}","title":"gghistostats","text":"Although quick dirty way explore large amount data minimal effort, come important limitation: reduced flexibility. example, wanted add, let’s say, separate test.value argument gender, possible grouped_gghistostats. cases like , run separate kinds tests (robust , parametric , Bayesian levels group) better use purrr. See associated vignette : https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/purrr_examples.html","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/gghistostats.html","id":"summary-of-graphics-and-tests","dir":"Articles > Web_only","previous_headings":"","what":"Summary of graphics and tests","title":"gghistostats","text":"Details underlying functions used create graphics statistical tests carried can found function documentation: https://indrajeetpatil.github.io/ggstatsplot/reference/gghistostats.html","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/gghistostats.html","id":"reporting","dir":"Articles > Web_only","previous_headings":"","what":"Reporting","title":"gghistostats","text":"wish include statistical analysis results publication/report, ideal reporting practice hybrid two approaches: ggstatsplot approach, plot contains visual numerical summaries statistical model, standard narrative approach, provides interpretive context reported statistics. example, let’s see following example: narrative context (assuming type = \"parametric\") can complement plot either figure caption main text- Student’s t-test revealed , across 31 felled black cherry trees, although height higher expected height 75 ft., effect statistically significant. effect size (g=0.15)(g = 0.15) small, per Cohen’s (1988) conventions. Bayes Factor analysis revealed data 3.67 times probable null hypothesis compared alternative hypothesis. can considered moderate evidence (Jeffreys, 1961) favor null hypothesis.","code":"gghistostats(trees, Height, test.value = 75)"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/gghistostats.html","id":"suggestions","dir":"Articles > Web_only","previous_headings":"","what":"Suggestions","title":"gghistostats","text":"find bugs suggestions/remarks, please file issue GitHub: https://github.com/IndrajeetPatil/ggstatsplot/issues","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggpiestats.html","id":"introduction-to-ggpiestats","dir":"Articles > Web_only","previous_headings":"","what":"Introduction to ggpiestats","title":"ggpiestats","text":"function ggpiestats can used quick data exploration /prepare publication-ready pie charts summarize statistical relationship(s) among one categorical variables. see examples use function vignette. begin , instances want use ggpiestats- check proportion observations matches hypothesized proportion, typically known “Goodness Fit” test see frequency distribution two categorical variables independent using contingency table analysis check proportion observations level categorical variable equal Note: following demo uses pipe operator (%>%), familiar operator, good explanation: http://r4ds..co.nz/pipes.html. ggpiestats works data organized data frames tibbles. work data structures like base-R tables matrices. can operate data frames organized one row per observation data frames one column containing counts. vignette provides examples (see examples ). help demonstrate ggpiestats can used categorical (also known nominal) data, modified version original Titanic dataset (datasets library) provided ggstatsplot package name Titanic_full. Titanic Passenger Survival Dataset provides information “fate passengers fatal maiden voyage ocean liner Titanic, including economic status (class), sex, age, survival.” Let’s look structure .","code":"# looking at the original data in tabular format dplyr::glimpse(Titanic) #> 'table' num [1:4, 1:2, 1:2, 1:2] 0 0 35 0 0 0 17 0 118 154 ... #> - attr(*, \"dimnames\")=List of 4 #> ..$ Class : chr [1:4] \"1st\" \"2nd\" \"3rd\" \"Crew\" #> ..$ Sex : chr [1:2] \"Male\" \"Female\" #> ..$ Age : chr [1:2] \"Child\" \"Adult\" #> ..$ Survived: chr [1:2] \"No\" \"Yes\" # looking at the dataset as a tibble or data frame dplyr::glimpse(Titanic_full) #> Rows: 2,201 #> Columns: 5 #> $ id 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18… #> $ Class 3rd, 3rd, 3rd, 3rd, 3rd, 3rd, 3rd, 3rd, 3rd, 3rd, 3rd, 3rd, 3… #> $ Sex Male, Male, Male, Male, Male, Male, Male, Male, Male, Male, M… #> $ Age Child, Child, Child, Child, Child, Child, Child, Child, Child… #> $ Survived No, No, No, No, No, No, No, No, No, No, No, No, No, No, No, N…"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggpiestats.html","id":"goodness-of-fit-with-ggpiestats","dir":"Articles > Web_only","previous_headings":"","what":"Goodness of Fit with ggpiestats","title":"ggpiestats","text":"simplest use case ggpiestats want display information one categorical nominal variable. part display plot, may also choose execute chi-squared goodness fit test see whether proportions (percentages) categories single variable appear line hypothesis model. start simple expand, let’s say ’d like display piechart percentages passengers survive. initial hypothesis different flipping coin. People 50/50 chance surviving. Note: equal proportions per category default, e.g. 50/50, can specify hypothesized ratio like ratio hypothesis 80% died 20% survived add ratio = c(.80,.20) entered code.","code":"ggpiestats( data = Titanic_full, x = Survived, title = \"Passenger survival on the Titanic\", caption = \"Source: Titanic survival dataset\", legend.title = \"Survived?\" )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggpiestats.html","id":"independence-or-association-with-ggpiestats","dir":"Articles > Web_only","previous_headings":"","what":"Independence (or association) with ggpiestats","title":"ggpiestats","text":"Let’s next investigate whether passenger’s gender independent , associated , gender. test whether proportion people survived different sexes using ggpiestats. plot clearly shows survival rates different males females. Pearson’s χ2\\chi^2-test independence significant given large sample size. Additionally, females males, survival rates significantly different 50% indicated goodness fit test gender.","code":"ggpiestats( data = Titanic_full, x = Survived, y = Sex ) + # further modification with `{ggplot2}` commands ggplot2::theme( plot.title = ggplot2::element_text( color = \"black\", size = 14, hjust = 0 ) )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggpiestats.html","id":"grouped-analysis-with-grouped_ggpiestats","dir":"Articles > Web_only","previous_headings":"","what":"Grouped analysis with grouped_ggpiestats","title":"ggpiestats","text":"want analysis gender also factor passenger’s age (Age)? information classifies passengers Child Adult, perhaps makes difference survival rate? ggstatsplot provides special helper function instances: grouped_ggpiestats. convenient wrapper function around combine_plots. applies ggpiestats across levels specified grouping variable combines list individual plots single plot. Note grouping variable can anything: conditions given study, groups study sample, different studies, etc. resulting pie charts statistics make story clear. adults gender much matters. Women survived much higher rates men. children gender significantly associated survival male female children survival rate significantly different 50/50.","code":"grouped_ggpiestats( # arguments relevant for `ggpiestats()` data = Titanic_full, x = Survived, y = Sex, grouping.var = Age, digits.perc = 1, package = \"ggsci\", palette = \"category10_d3\", # arguments relevant for `combine_plots()` title.text = \"Passenger survival on the Titanic by gender and age\", caption.text = \"Asterisks denote results from proportion tests; \\n***: p < 0.001, ns: non-significant\", plotgrid.args = list(nrow = 2) )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggpiestats.html","id":"grouped-analysis-with-ggpiestats-purrr","dir":"Articles > Web_only","previous_headings":"","what":"Grouped analysis with ggpiestats + {purrr}","title":"ggpiestats","text":"Although grouped_ggpiestats provides quick way explore data, leaves much desired. example, may want add different captions, titles, themes, palettes level grouping variable, etc. cases like , better use purrr package. See associated vignette : https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/purrr_examples.html","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggpiestats.html","id":"working-with-data-organized-by-counts","dir":"Articles > Web_only","previous_headings":"","what":"Working with data organized by counts","title":"ggpiestats","text":"ggpiestats can also work data frame containing counts (aka tabled data), .e., row doesn’t correspond unique observation. example, consider following notional fishing data frame containing data two boats (B) number different types fish caught months February March. data frame, row corresponds unique combination Boat Month. data organized way, make slightly different call ggpiestats() function: use counts argument. want investigate relationship type fish month (test independence), command : results support hypothesis type fish caught related month ’re fishing. χ2\\chi^2 independence test results top plot. February, catch significantly Cod hypothesize equal distribution. Whereas, March, results indicate ’s strong evidence distribution isn’t equal.","code":"# (this is completely fictional; I don't know first thing about fishing!) fishing <- tibble::as_tibble(data.frame( Boat = c(rep(\"B\", 4), rep(\"A\", 4), rep(\"A\", 4), rep(\"B\", 4)), Month = c(rep(\"February\", 2), rep(\"March\", 2), rep(\"February\", 2), rep(\"March\", 2)), Fish = c( \"Bass\", \"Catfish\", \"Cod\", \"Haddock\", \"Cod\", \"Haddock\", \"Bass\", \"Catfish\", \"Bass\", \"Catfish\", \"Cod\", \"Haddock\", \"Cod\", \"Haddock\", \"Bass\", \"Catfish\" ), SumOfCaught = c(25, 20, 35, 40, 40, 25, 30, 42, 40, 30, 33, 26, 100, 30, 20, 20) )) fishing #> # A tibble: 16 × 4 #> Boat Month Fish SumOfCaught #> #> 1 B February Bass 25 #> 2 B February Catfish 20 #> 3 B March Cod 35 #> 4 B March Haddock 40 #> 5 A February Cod 40 #> 6 A February Haddock 25 #> 7 A March Bass 30 #> 8 A March Catfish 42 #> 9 A February Bass 40 #> 10 A February Catfish 30 #> 11 A March Cod 33 #> 12 A March Haddock 26 #> 13 B February Cod 100 #> 14 B February Haddock 30 #> 15 B March Bass 20 #> 16 B March Catfish 20 ggpiestats( data = fishing, x = Fish, y = Month, counts = SumOfCaught, label = \"both\", package = \"ggsci\", palette = \"default_jama\", title = \"Type fish caught by month\", caption = \"Source: completely made up\", legend.title = \"Type fish caught: \" )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggpiestats.html","id":"within-subjects-designs","dir":"Articles > Web_only","previous_headings":"","what":"Within-subjects designs","title":"ggpiestats","text":"Let’s imagine ’re conducting clinical trials new imaginary wonder drug. 134 subjects entering trial. enter healthy (n = 96), enter trial already sick (n = 38). receive treatment intervention. check back month see healthy sick. classic pre/post experimental design. ’re interested seeing change groupings. case within-subjects designs, can set paired = TRUE, display results McNemar test subtitle. (Note: forget set paired = TRUE, results inaccurate.) results bode well experimental wonder drug. 96 started healthy 4% sick month. Ideally, hoped zero reality seldom perfect. side 38 started sick number reduced just 13 34% marked improvement.","code":"# create imaginary data clinical_trial <- tibble::tribble( ~SickBefore, ~SickAfter, ~Counts, \"No\", \"Yes\", 4, \"Yes\", \"No\", 25, \"Yes\", \"Yes\", 13, \"No\", \"No\", 92 ) ggpiestats( data = clinical_trial, x = SickAfter, y = SickBefore, counts = Counts, paired = TRUE, label = \"both\", title = \"Results from imaginary clinical trial\", package = \"ggsci\", palette = \"default_ucscgb\" )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggpiestats.html","id":"summary-of-graphics-and-tests","dir":"Articles > Web_only","previous_headings":"","what":"Summary of graphics and tests","title":"ggpiestats","text":"Details underlying functions used create graphics statistical tests carried can found function documentation: https://indrajeetpatil.github.io/ggstatsplot/reference/ggpiestats.html","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggpiestats.html","id":"reporting","dir":"Articles > Web_only","previous_headings":"","what":"Reporting","title":"ggpiestats","text":"wish include statistical analysis results publication/report, ideal reporting practice hybrid two approaches: ggstatsplot approach, plot contains visual numerical summaries statistical model, standard narrative approach, provides interpretive context reported statistics. example, let’s see following example: narrative context (assuming type = \"parametric\") can complement plot either figure caption main text- Pearson’s χ2\\chi^2-test independence revealed , across 32 automobiles, showed significant association transmission engine number cylinders. Bayes Factor analysis revealed data 16.78 times probable alternative hypothesis compared null hypothesis. can considered strong evidence (Jeffreys, 1961) favor alternative hypothesis. Similar reporting style can followed function performs one-sample goodness--fit test instead χ2\\chi^2-test. holds true ggbarstats.","code":"ggpiestats(mtcars, am, cyl)"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggpiestats.html","id":"suggestions","dir":"Articles > Web_only","previous_headings":"","what":"Suggestions","title":"ggpiestats","text":"find bugs suggestions/remarks, please file issue GitHub: https://github.com/IndrajeetPatil/ggstatsplot/issues","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggscatterstats.html","id":"correlation-plot-with-ggscatterstats","dir":"Articles > Web_only","previous_headings":"","what":"Correlation plot with ggscatterstats","title":"ggscatterstats","text":"illustrate function can used, rely ggplot2movies dataset. dataset provides information movies scraped IMDB. Specifically, using cleaned version dataset included ggstatsplot package . Now clean dataset, can start asking interesting questions. example, let’s see average IMDB rating movie relationship budget. Additionally, let’s also see movies high budget low IMDB rating labeling data points. reduce processing time, let’s work 30% dataset. indeed small, significant, positive correlation amount money studio invests movie ratings given audiences.","code":"## see the selected data (we have data from 1813 movies) dplyr::glimpse(movies_long) #> Rows: 1,579 #> Columns: 8 #> $ title \"Shawshank Redemption, The\", \"Lord of the Rings: The Return of … #> $ year 1994, 2003, 2001, 2002, 1994, 1993, 1977, 1980, 1968, 2002, 196… #> $ length 142, 251, 208, 223, 168, 195, 125, 129, 158, 135, 93, 113, 108,… #> $ budget 25.0, 94.0, 93.0, 94.0, 8.0, 25.0, 11.0, 18.0, 5.0, 3.3, 1.8, 5… #> $ rating 9.1, 9.0, 8.8, 8.8, 8.8, 8.8, 8.8, 8.8, 8.7, 8.7, 8.7, 8.7, 8.6… #> $ votes 149494, 103631, 157608, 114797, 132745, 97667, 134640, 103706, … #> $ mpaa R, PG-13, PG-13, PG-13, R, R, PG, PG, PG-13, R, PG, R, R, R, R,… #> $ genre Drama, Action, Action, Action, Drama, Drama, Action, Action, Dr… ggscatterstats( data = movies_long, ## data frame from which variables are taken x = budget, ## predictor/independent variable y = rating, ## dependent variable xlab = \"Budget (in millions of US dollars)\", ## label for the x-axis ylab = \"Rating on IMDB\", ## label for the y-axis label.var = title, ## variable to use for labeling data points label.expression = rating < 5 & budget > 100, ## expression for deciding which points to label point.label.args = list(alpha = 0.7, size = 4, color = \"grey50\"), xfill = \"#CC79A7\", ## fill for marginals on the x-axis yfill = \"#009E73\", ## fill for marginals on the y-axis title = \"Relationship between movie budget and IMDB rating\", caption = \"Source: www.imdb.com\" )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggscatterstats.html","id":"grouped-analysis-with-grouped_ggscatterstats","dir":"Articles > Web_only","previous_headings":"","what":"Grouped analysis with grouped_ggscatterstats","title":"ggscatterstats","text":"want analysis analysis movies different MPAA (Motion Picture Association America) film ratings (NC-17, PG, PG-13, R)? ggstatsplot provides special helper function instances: grouped_ggstatsplot. merely wrapper function around combine_plots. applies ggstatsplot across levels specified grouping variable combines list individual plots single plot. Note grouping variable can anything: conditions given study, groups study sample, different studies, etc. Let’s see can use function apply ggscatterstats MPAA ratings. Also, let’s run robust test time. seen plot, analysis revealed something interesting: relationship found budget IMDB rating holds PG-13 R-rated movies.","code":"grouped_ggscatterstats( ## arguments relevant for ggscatterstats data = movies_long, x = budget, y = rating, grouping.var = mpaa, label.var = title, label.expression = rating < 5 & budget > 80, type = \"r\", # ggtheme = ggthemes::theme_tufte(), ## arguments relevant for combine_plots annotation.args = list( title = \"Relationship between movie budget and IMDB rating\", caption = \"Source: www.imdb.com\" ), plotgrid.args = list(nrow = 3, ncol = 1) )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggscatterstats.html","id":"grouped-analysis-with-ggscatterstats-purrr","dir":"Articles > Web_only","previous_headings":"","what":"Grouped analysis with ggscatterstats + {purrr}","title":"ggscatterstats","text":"Although quick dirty way explore large amount data minimal effort, come important limitation: reduced flexibility. example, wanted add, let’s say, separate type marginal distribution plot MPAA rating wanted use different types correlations across different levels MPAA ratings (NC-17 6 movies, robust correlation good idea), possible. can easily done using purrr. See associated vignette : https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/purrr_examples.html","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggscatterstats.html","id":"summary-of-graphics-and-tests","dir":"Articles > Web_only","previous_headings":"","what":"Summary of graphics and tests","title":"ggscatterstats","text":"Details underlying functions used create graphics statistical tests carried can found function documentation: https://indrajeetpatil.github.io/ggstatsplot/reference/ggscatterstats.html","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggscatterstats.html","id":"reporting","dir":"Articles > Web_only","previous_headings":"","what":"Reporting","title":"ggscatterstats","text":"wish include statistical analysis results publication/report, ideal reporting practice hybrid two approaches: ggstatsplot approach, plot contains visual numerical summaries statistical model, standard narrative approach, provides interpretive context reported statistics. example, let’s see following example: narrative context (assuming type = \"parametric\") can complement plot either figure caption main text- Pearson’s correlation test revealed , across 32 cars, measure acceleration (1/4 mile time; qsec) positively correlated rear axle ratio (drat), effect statistically significant. effect size (r=0.09)(r = 0.09) small, per Cohen’s (1988) conventions. Bayes Factor analysis revealed data 3.32 times probable null hypothesis compared alternative hypothesis. can considered moderate evidence (Jeffreys, 1961) favor null hypothesis (absence correlation two variables).","code":"ggscatterstats(mtcars, qsec, drat)"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggscatterstats.html","id":"suggestions","dir":"Articles > Web_only","previous_headings":"","what":"Suggestions","title":"ggscatterstats","text":"find bugs suggestions/remarks, please file issue GitHub: https://github.com/IndrajeetPatil/ggstatsplot/issues","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggwithinstats.html","id":"comparisons-between-groups-with-ggwithinstats","dir":"Articles > Web_only","previous_headings":"","what":"Comparisons between groups with ggwithinstats","title":"ggwithinstats","text":"illustrate function can used, use bugs dataset throughout vignette. data set, “Bugs”, provides extent men women want kill arthropods vary freighteningness (low, high) disgustingness (low, high). participant rates attitudes towards anthropods. Subset data reported Ryan et al. (2013). Note repeated measures design participant gave four different ratings across four different conditions (LDLF, LDHF, HDLF, HDHF). Suppose first thing want inspect distribution desire kill across conditions (disregarding factorial structure experiment). also want know mean differences desire across conditions statistically significant. simplest form function call - Note: function automatically decides whether dependent samples test preferred (2 groups) ANOVA (3 groups). based number levels grouping variable. output function ggplot object means can modified ggplot2 functions. can seen plot, function default returns Bayes Factor test. null hypothesis can’t rejected null hypothesis significance testing (NHST) approach, Bayesian approach can help index evidence favor null hypothesis (.e., BF01BF_{01}). default, natural logarithms shown Bayes Factor values can sometimes pretty large. values logarithmic scale also makes easy compare evidence favor alternative (BF10BF_{10}) versus null (BF01BF_{01}) hypotheses (since loge(BF01)=−loge(BF10)log_{e}(BF_{01}) = - log_{e}(BF_{10})). can make output much aesthetically pleasing well informative making use many optional parameters ggwithinstats. ’ll add title caption, better x y axis labels. can change overall theme well color palette use. can appreciated effect size (partial eta squared) 0.18, small differences mean desire kill across conditions. Importantly, plot also helps us appreciate distributions within given condition. far used classic parametric test, can also use available options: type (test) argument also accepts following abbreviations: \"p\" (parametric), \"np\" (nonparametric), \"r\" (robust), \"bf\" (Bayes Factor). Let’s use combine_plots function make one plot four separate plots demonstrates options. Let’s compare desire kill bugs low versus high disgust conditions see much difference whether bug disgusting-looking makes desire kill bug. generate plots one one use combine_plots merge one plot common labeling. possible, necessarily recommended, make plot different colors themes. example,","code":"ggwithinstats( data = bugs_long, x = condition, y = desire ) ggwithinstats( data = bugs_long, x = condition, y = desire, type = \"nonparametric\", ## type of statistical test xlab = \"Condition\", ## label for the x-axis ylab = \"Desire to kill an artrhopod\", ## label for the y-axis package = \"yarrr\", ## package from which color palette is to be taken palette = \"info2\", ## choosing a different color palette title = \"Comparison of desire to kill bugs\", caption = \"Source: Ryan et al., 2013\" ) + ## modifying the plot further ggplot2::scale_y_continuous( limits = c(0, 10), breaks = seq(from = 0, to = 10, by = 1) ) ## selecting subset of the data df_disgust <- dplyr::filter(bugs_long, condition %in% c(\"LDHF\", \"HDHF\")) ## parametric t-test p1 <- ggwithinstats( data = df_disgust, x = condition, y = desire, type = \"p\", effsize.type = \"d\", conf.level = 0.99, title = \"Parametric test\", package = \"ggsci\", palette = \"nrc_npg\" ) ## Mann-Whitney U test (nonparametric test) p2 <- ggwithinstats( data = df_disgust, x = condition, y = desire, xlab = \"Condition\", ylab = \"Desire to kill bugs\", type = \"np\", conf.level = 0.99, title = \"Non-parametric Test\", package = \"ggsci\", palette = \"uniform_startrek\" ) ## robust t-test p3 <- ggwithinstats( data = df_disgust, x = condition, y = desire, xlab = \"Condition\", ylab = \"Desire to kill bugs\", type = \"r\", conf.level = 0.99, title = \"Robust Test\", package = \"wesanderson\", palette = \"Royal2\" ) ## Bayes Factor for parametric t-test p4 <- ggwithinstats( data = df_disgust, x = condition, y = desire, xlab = \"Condition\", ylab = \"Desire to kill bugs\", type = \"bayes\", title = \"Bayesian Test\", package = \"ggsci\", palette = \"nrc_npg\" ) ## combining the individual plots into a single plot combine_plots( plotlist = list(p1, p2, p3, p4), plotgrid.args = list(nrow = 2), annotation.args = list( title = \"Effect of disgust on desire to kill bugs \", caption = \"Source: Bugs dataset from `jmv` R package\" ) )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggwithinstats.html","id":"grouped-analysis-with-grouped_ggwithinstats","dir":"Articles > Web_only","previous_headings":"","what":"Grouped analysis with grouped_ggwithinstats","title":"ggwithinstats","text":"want carry analysis region (gender)? ggstatsplot provides special helper function instances: grouped_ggwithinstats. merely wrapper function around combine_plots. applies ggwithinstats across levels specified grouping variable combines list individual plots single plot. Note grouping variable can anything: conditions given study, groups study sample, different studies, etc. Let’s focus two regions years: 1967, 1987, 2007. Also, let’s carry pairwise comparisons see differences every pair continents.","code":"grouped_ggwithinstats( ## arguments relevant for ggwithinstats data = bugs_long, x = condition, y = desire, grouping.var = gender, xlab = \"Continent\", ylab = \"Desire to kill bugs\", type = \"nonparametric\", ## type of test pairwise.display = \"significant\", ## display only significant pairwise comparisons p.adjust.method = \"BH\", ## adjust p-values for multiple tests using this method # ggtheme = ggthemes::theme_tufte(), package = \"ggsci\", palette = \"default_jco\", digits = 3, ## arguments relevant for combine_plots annotation.args = list(title = \"Desire to kill bugs across genders\"), plotgrid.args = list(ncol = 1) )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggwithinstats.html","id":"grouped-analysis-with-ggwithinstats-purrr","dir":"Articles > Web_only","previous_headings":"","what":"Grouped analysis with ggwithinstats + {purrr}","title":"ggwithinstats","text":"Although grouping function provides quick way explore data, leaves much desired. example, type test theme applied genders, maybe want change different genders, maybe want gave different effect sizes different years. type customization different levels grouping variable possible grouped_ggwithinstats, can easily achieved using purrr package. See associated vignette : https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/purrr_examples.html","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggwithinstats.html","id":"between-subjects-designs","dir":"Articles > Web_only","previous_headings":"","what":"Between-subjects designs","title":"ggwithinstats","text":"independent measures designs, ggbetweenstats function can used: https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggbetweenstats.html","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggwithinstats.html","id":"summary-of-graphics-and-tests","dir":"Articles > Web_only","previous_headings":"","what":"Summary of graphics and tests","title":"ggwithinstats","text":"Details underlying functions used create graphics statistical tests carried can found function documentation: https://indrajeetpatil.github.io/ggstatsplot/reference/ggwithinstats.html","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggwithinstats.html","id":"reporting","dir":"Articles > Web_only","previous_headings":"","what":"Reporting","title":"ggwithinstats","text":"wish include statistical analysis results publication/report, ideal reporting practice hybrid two approaches: ggstatsplot approach, plot contains visual numerical summaries statistical model, standard narrative approach, provides interpretive context reported statistics. example, let’s see following example: narrative context (assuming type = \"parametric\") can complement plot either figure caption main text- Fisher’s repeated measures one-way ANOVA revealed , across 22 friends taste three wines, statistically significant difference across persons preference wine. effect size (ωp=0.02)(\\omega_{p} = 0.02) medium, per Field’s (2013) conventions. Bayes Factor analysis revealed data 8.25 times probable alternative hypothesis compared null hypothesis. can considered moderate evidence (Jeffreys, 1961) favor alternative hypothesis. global effect carried post hoc pairwise t-tests, revealed Wine C preferred across participants least desirable compared Wines B. Similar reporting style can followed function performs t-test instead one-way ANOVA.","code":"library(WRS2) # for data ggwithinstats(WineTasting, Wine, Taste)"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggwithinstats.html","id":"suggestions","dir":"Articles > Web_only","previous_headings":"","what":"Suggestions","title":"ggwithinstats","text":"find bugs suggestions/remarks, please file issue GitHub: https://github.com/IndrajeetPatil/ggstatsplot/issues","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/pairwise.html","id":"introduction","dir":"Articles > Web_only","previous_headings":"","what":"Introduction","title":"Pairwise comparisons with `{ggstatsplot}`","text":"Pairwise comparisons ggstatsplot.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/pairwise.html","id":"summary-of-types-of-statistical-analyses","dir":"Articles > Web_only","previous_headings":"","what":"Summary of types of statistical analyses","title":"Pairwise comparisons with `{ggstatsplot}`","text":"Following table contains brief summary currently supported pairwise comparison tests-","code":""},{"path":[]},{"path":[]},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/pairwise.html","id":"data-frame-outputs","dir":"Articles > Web_only","previous_headings":"","what":"Data frame outputs","title":"Pairwise comparisons with `{ggstatsplot}`","text":"See data frame outputs .","code":""},{"path":[]},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/pairwise.html","id":"example-1-between-subjects","dir":"Articles > Web_only","previous_headings":"Using pairwise_comparisons() with ggsignif","what":"Example-1: between-subjects","title":"Pairwise comparisons with `{ggstatsplot}`","text":"","code":"library(ggplot2) library(ggsignif) ## converting to factor mtcars$cyl <- as.factor(mtcars$cyl) ## creating a basic plot p <- ggplot(mtcars, aes(cyl, wt)) + geom_boxplot() ## using `pairwise_comparisons()` package to create a data frame with results df <- pairwise_comparisons(mtcars, cyl, wt) %>% dplyr::mutate(groups = purrr::pmap(.l = list(group1, group2), .f = c)) %>% dplyr::arrange(group1) df #> # A tibble: 3 × 10 #> group1 group2 statistic p.value alternative distribution p.adjust.method #> #> 1 4 6 5.39 0.00831 two.sided q Holm #> 2 4 8 9.11 0.0000124 two.sided q Holm #> 3 6 8 5.12 0.00831 two.sided q Holm #> test expression groups #> #> 1 Games-Howell #> 2 Games-Howell #> 3 Games-Howell ## using `geom_signif` to display results ## (note that you can choose not to display all comparisons) p + ggsignif::geom_signif( comparisons = list(df$groups[[1]]), annotations = as.character(df$expression)[[1]], test = NULL, na.rm = TRUE, parse = TRUE )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/pairwise.html","id":"example-2-within-subjects","dir":"Articles > Web_only","previous_headings":"Using pairwise_comparisons() with ggsignif","what":"Example-2: within-subjects","title":"Pairwise comparisons with `{ggstatsplot}`","text":"","code":"library(ggplot2) library(ggsignif) ## creating a basic plot p <- ggplot(WRS2::WineTasting, aes(Wine, Taste)) + geom_boxplot() ## using `pairwise_comparisons()` package to create a data frame with results df <- pairwise_comparisons( WRS2::WineTasting, Wine, Taste, subject.id = Taster, type = \"bayes\", paired = TRUE ) %>% dplyr::mutate(groups = purrr::pmap(.l = list(group1, group2), .f = c)) %>% dplyr::arrange(group1) df #> # A tibble: 3 × 19 #> group1 group2 term effectsize estimate conf.level conf.low #> #> 1 Wine A Wine B Difference Bayesian t-test 0.00721 0.95 -0.0418 #> 2 Wine A Wine C Difference Bayesian t-test 0.0755 0.95 0.0127 #> 3 Wine B Wine C Difference Bayesian t-test 0.0693 0.95 0.0303 #> conf.high pd prior.distribution prior.location prior.scale bf10 #> #> 1 0.0562 0.624 cauchy 0 0.707 0.235 #> 2 0.140 0.990 cauchy 0 0.707 3.71 #> 3 0.110 1.00 cauchy 0 0.707 50.5 #> conf.method log_e_bf10 n.obs expression test groups #> #> 1 ETI -1.45 22 Student's t #> 2 ETI 1.31 22 Student's t #> 3 ETI 3.92 22 Student's t ## using `geom_signif` to display results p + ggsignif::geom_signif( comparisons = df$groups, map_signif_level = TRUE, tip_length = 0.01, y_position = c(6.5, 6.65, 6.8), annotations = as.character(df$expression), test = NULL, na.rm = TRUE, parse = TRUE )"},{"path":[]},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/principles.html","id":"graphical-perception","dir":"Articles > Web_only","previous_headings":"Graphic design principles","what":"Graphical perception","title":"Graphic design and statistical reporting principles","text":"Graphical perception involves visual decoding encoded information graphs. ggstatsplot incorporates paradigm proposed ((Cleveland, 1985), Chapter 4) facilitate making visual judgments quantitative information effortless almost instantaneous. Based experiments, Cleveland proposes ten elementary graphical-perception tasks perform visually decode quantitative information graphs (organized least accurate; (Cleveland, 1985), p.254)- Position along common scale Position along identical, non-aligned scales Length Angle (Slope) Area Volume Color hue key principle Cleveland’s paradigm data display - “encode data graph visual decoding involves [graphical-perception] tasks high ordering possible.” example, decoding data point values ggbetweenstats requires position judgments along common scale: Note assessing differences mean values groups made easier help data points along common scale (Y-axis) labels. instances ggstatsplot diverges recommendations made Cleveland’s paradigm: categorical/nominal data, ggstatsplot uses pie charts rely angle judgments, less accurate (compared bar graphs, e.g., require position judgments). shortcoming assuaged degree using plenty labels describe percentages slices. makes angle judgment unnecessary pre-vacates concerns inaccurate judgments percentages. Additionally, also provides alternative function ggpiestats working categorical variables: ggbarstats. Pie charts don’t follow Cleveland’s paradigm data display rely less accurate angle judgments. ggstatsplot sidesteps issue always labelling percentages pie slices, makes angle judgments unnecessary. Cleveland’s paradigm also emphasizes superposition data better juxtaposition ((Cleveland, 1985), p.201) allows incisive comparison values different parts dataset. recommendation violated grouped_ variants function. Note range Y-axes longer across juxtaposed subplots visually comparing data becomes difficult. hand, superposed plot, data range coloring different parts makes visual discrimination different components data, comparison, easier. goal grouped_ variants functions show different aspects data also run statistical tests showing detailed results aspects data superposed plot difficult. Therefore, compromise ggstatsplot comfortable , least produce plots quick exploration different aspects data. Comparing different aspects data much accurate () plot, recommended Cleveland’s paradigm, () plot, implemented ggstatsplot package. displaying detailed results statistical tests difficult superposed plot. grouped_ plots follow Shrink Principle ((Tufte, 2001), p.166-7) high-information graphics, dictates data density size data matrix can maximized exploit maximum resolution available data-display technology. Given large maximum resolution afforded computer monitors today, saving grouped_ plots appropriate resolution ensures loss legibility reduced graphics area.","code":"ggbetweenstats( data = dplyr::filter( movies_long, genre %in% c(\"Action\", \"Action Comedy\", \"Action Drama\", \"Comedy\") ), x = genre, y = rating, title = \"IMDB rating by film genre\", xlab = \"Genre\", ylab = \"IMDB rating (average)\" ) ggpiestats( data = movies_long, x = genre, y = mpaa, title = \"Distribution of MPAA ratings by film genre\", legend.title = \"layout\" ) library(ggplot2) ## creating a smaller data frame df <- dplyr::filter(movies_long, genre %in% c(\"Comedy\", \"Drama\")) combine_plots( plotlist = list( # superposition ggplot(data = df, mapping = aes(x = length, y = rating, color = genre)) + geom_jitter(size = 3, alpha = 0.5) + geom_smooth(method = \"lm\") + labs(title = \"superposition (recommended in Cleveland's paradigm)\") + theme_ggstatsplot(), # juxtaposition grouped_ggscatterstats( data = df, x = length, y = rating, grouping.var = genre, marginal = FALSE, annotation.args = list(title = \"juxtaposition (`{ggstatsplot}` implementation in `grouped_` functions)\") ) ), ## combine for comparison annotation.args = list(title = \"Two ways to compare different aspects of data\"), plotgrid.args = list(nrow = 2) )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/principles.html","id":"graphical-excellence","dir":"Articles > Web_only","previous_headings":"Graphic design principles","what":"Graphical excellence","title":"Graphic design and statistical reporting principles","text":"Graphical excellence consists communicating complex ideas clarity way viewer understands greatest number ideas short amount time quoting data context. package follows principles graphical integrity (Tufte, 2001): physical representation numbers proportional numerical quantities represent. plot show means (ggbetweenstats) percentages (ggpiestats) proportional vertical distance area, respectively). important events data clear, detailed, thorough labeling plot shows ggbetweenstats labels means, sample size information, outliers, pairwise comparisons; can appreciated ggpiestats gghistostats plots. Note data labels data region designed way don’t interfere ability assess overall pattern data ((Cleveland, 1985); p.44-45). achieved using ggrepel package place labels way reduces visual prominence. None plots design variation (e.g., abrupt change scales) surface graphic can lead false impression variation data. number information-carrying dimensions never exceed number dimensions data (e.g., using area show one-dimensional data). plots designed chartjunk (like moiré vibrations, fake perspective, dark grid lines, etc.) ((Tufte, 2001), Chapter 5). instances ggstatsplot graphs don’t follow principles clean graphics, formulated Tufte theory data graphics ((Tufte, 2001), Chapter 4). theory four key principles: else show data. Maximize data-ink ratio. Erase non-data-ink. Erase redundant data-ink, within reason. particular, default plots ggstatsplot can sometimes violate one principles 2-4. According principles, every bit ink reason inclusion graphic convey new information viewer. , ink removed. One instance bilateral symmetry data measures. example, figure , can see box violin plots mirrored, consumes twice space graphic without adding new information. redundancy tolerated sake beauty symmetrical shapes can bring graphic. Even Tufte admits efficiency one consideration design statistical graphics ((Tufte, 2001), p. 137). Additionally, principles formulated era computer graphics yet revolutionize ease graphics produced thus concerns minimizing data-ink easier production graphics relevant .","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/principles.html","id":"statistical-variation","dir":"Articles > Web_only","previous_headings":"Graphic design principles","what":"Statistical variation","title":"Graphic design and statistical reporting principles","text":"One important functions plot show variation data, comes two forms: Measurement noise: ggstatsplot, actual variation measurements shown plotting combination (jittered) raw data points boxplot laid top histogram. None plots, empirical distribution data concerned, show sample standard deviation poor conveying information limits sample presence outliers ((Cleveland, 1985), p.220). Distribution variable shown using gghistostats. Sample--sample statistic variation: Although, traditionally, variation shown using standard error mean (SEM) statistic, ggstatsplot plots instead use 95% confidence intervals. interval formed error bars correspond 68% confidence interval, particularly interesting interval ((Cleveland, 1985), p.222-225). Sample--sample variation regression estimates displayed using confidence intervals ggcoefstats().","code":"gghistostats( data = morley, x = Speed, test.value = 792, xlab = \"Speed of light (km/sec, with 299000 subtracted)\", title = \"Distribution of measured Speed of light\", caption = \"Note: Data collected across 5 experiments (20 measurements each)\" ) model <- lme4::lmer( formula = total.fruits ~ nutrient + rack + (nutrient | gen), data = lme4::Arabidopsis ) ggcoefstats(model)"},{"path":[]},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/principles.html","id":"data-requirements","dir":"Articles > Web_only","previous_headings":"Statistical analysis","what":"Data requirements","title":"Graphic design and statistical reporting principles","text":"extension ggplot2, ggstatsplot expectations structure data. specifically, data organized following principles tidy data, specify statistical structure data frame (variables observations) mapped physical structure (columns rows). specifically, tidy data means variables columns row corresponds unique observation ((Wickham, 2014)). ggstatsplot functions remove NAs variables interest (similar ggplot2; (Wickham, 2016), p.207) data display total sample size (n, either observations -subjects pairs within-subjects designs) subtitle inform user/reader number observations included statistical analysis visualization. , sample sizes differ across tests function, ggstatsplot makes effort inform user aspect. example, ggcorrmat features several correlation test pairs , depending variables given pair, sample sizes may vary. ggstatsplot functions remove NAs variables interest display total sample size , can give nuanced information sample sizes differs across tests. example, ggcorrmat display () one total sample size NAs present, () instead show minimum, median, maximum sample sizes across correlation tests NAs present across correlation variables.","code":"## creating a new dataset without any NAs in variables of interest msleep_no_na <- dplyr::filter( ggplot2::msleep, !is.na(sleep_rem), !is.na(awake), !is.na(brainwt), !is.na(bodywt) ) ## variable names vector var_names <- c(\"REM sleep\", \"time awake\", \"brain weight\", \"body weight\") ## combining two plots using helper function in `{ggstatsplot}` combine_plots( plotlist = purrr::pmap( .l = list(data = list(msleep_no_na, ggplot2::msleep)), .f = ggcorrmat, cor.vars = c(sleep_rem, awake:bodywt), cor.vars.names = var_names, colors = c(\"#B2182B\", \"white\", \"#4D4D4D\"), title = \"Correlalogram for mammals sleep dataset\", subtitle = \"sleep units: hours; weight units: kilograms\" ), plotgrid.args = list(nrow = 1) )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/principles.html","id":"statistical-reporting","dir":"Articles > Web_only","previous_headings":"Statistical analysis","what":"Statistical reporting","title":"Graphic design and statistical reporting principles","text":"combining statistical analysis data visualization helpful? list reasons - recent survey (Nuijten, Hartgerink, van Assen, Epskamp, & Wicherts, 2016) revealed one eight papers major psychology journals contained grossly inconsistent p-value may affected statistical conclusion. ggstatsplot helps avoid reporting errors: Since plot statistical analysis yoked together, chances making error reporting results minimized. One need write results manually copy-paste different statistics software program (like SPSS, SAS, ). default setting ggstatsplot produce plots statistical details included. often , results displayed subtitle plot. Great care taken details included statistical reporting . APA guidelines (Association, 2009) followed default reporting statistical details: Percentages displayed decimal places. Correlations, t-tests, χ2\\chi^2-tests reported degrees freedom parentheses significance level. ANOVAs reported two degrees freedom significance level. Regression results presented unstandardized standardized estimate (beta), whichever specified user, along statistic (depending model, can t, F, z statistic) corresponding significance level. exception p-values, statistics rounded two decimal places default.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/principles.html","id":"dealing-with-null-results","dir":"Articles > Web_only","previous_headings":"Statistical analysis","what":"Dealing with null results:","title":"Graphic design and statistical reporting principles","text":"functions therefore default return Bayesian favor null hypothesis default. null hypothesis can’t rejected null hypothesis significance testing (NHST) approach, Bayesian approach can help index evidence favor null hypothesis (.e., BF01BF_{01}). default, natural logarithms shown Bayesian values can sometimes pretty large. values logarithmic scale also makes easy compare evidence favor alternative (BF10BF_{10}) versus null (BF01BF_{01}) hypotheses (since loge(BF01)=−loge(BF01)log_{e}(BF_{01}) = - log_{e}(BF_{01})).","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/principles.html","id":"suggestions","dir":"Articles > Web_only","previous_headings":"","what":"Suggestions","title":"Graphic design and statistical reporting principles","text":"find bugs suggestions/remarks, please file issue GitHub: https://github.com/IndrajeetPatil/ggstatsplot/issues","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/purrr_examples.html","id":"why-use-purrr","dir":"Articles > Web_only","previous_headings":"","what":"Why use {purrr}?","title":"Using 'ggstatsplot' with the 'purrr' package","text":"ggstatsplot functions grouped_ variants, designed quickly run ggstatsplot function across multiple levels single grouping variable. Although function useful data exploration, two strong weaknesses- arguments applied grouped_ function call applied uniformly levels grouping variable might want customize different levels grouping variable. one grouping variable can used repeat analysis reality can combination grouping variables operation needs repeated resulting combinations. see overcome limitation combining ggstatsplot purrr package. Note: using purrr::pmap(), must input arguments strings. can use ggplot2 themes extension packages (e.g. ggthemes). ’d like background introduction purrr package, please see chapter.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/purrr_examples.html","id":"introduction-and-methodology","dir":"Articles > Web_only","previous_headings":"","what":"Introduction and methodology","title":"Using 'ggstatsplot' with the 'purrr' package","text":"examples vignette going build lists things pass along purrr turn return list plots passed combine_plots. name implies combine_plots merges individual plots one bigger plot common labeling aesthetics. lists building? lists correspond parameters ggstatsplot function like ggbetweenstats. look help file ?ggbetweenstats example first parameter wants data file ’ll using. can also pass different titles even ggtheme themes. can pass: single character string xlab = \"Continent\" numeric nboot = 25 case reused/recycled many times needed. vector values nboot = c(50, 100, 200) case coerced list checked right class (case integer) right quantity entries vector .e., nboot = c(50, 100) fail ’re trying make three plots. list; either named data = year_list created go palette = list(\"Dark2\", \"Set1\"). list checked right class (case character) right quantity entries list.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/purrr_examples.html","id":"ggbetweenstats","dir":"Articles > Web_only","previous_headings":"","what":"ggbetweenstats","title":"Using 'ggstatsplot' with the 'purrr' package","text":"Let’s start ggebtweenstats. ’ll use gapminder dataset. ’ll make 3 item list called year_list using dplyr::filter split. Now data divided three relevant years list ’ll turn purrr::pmap create list ggplot objects ’ll make use stored plot_list. look documentation ?pmap accept .l list lists. length .l determines number arguments .f called . List names used present. .f function want apply (, .f = ggbetweenstats). Let’s keep building list arguments, .l. First data = year_list, x y axes constant three plots pass variable name string x = \"continent\". final step pass plot_list object just created combine_plots function. 3 plots already labeling information combine_plots gives us opportunity add additional details merged plots specify layout rows columns.","code":"## let's split the data frame and create a list by years of interest year_list <- gapminder::gapminder %>% dplyr::filter(year %in% c(1967, 1987, 2007), continent != \"Oceania\") %>% split(f = .$year, drop = TRUE) ## checking the length of the list and the names of each element length(year_list) names(year_list) ## creating a list of plots plot_list <- purrr::pmap( .l = list( data = year_list, x = \"continent\", y = \"lifeExp\", xlab = \"Continent\", ylab = \"Life expectancy\", title = list( \"Year: 1967\", \"Year: 1987\", \"Year: 2007\" ), type = list(\"r\", \"bf\", \"np\"), pairwise.display = list(\"s\", \"ns\", \"all\"), p.adjust.method = list(\"hommel\", \"bonferroni\", \"BH\"), conf.level = list(0.99, 0.95, 0.90), digits = list(1, 2, 3), effsize.type = list( NULL, \"partial_omega\", \"partial_eta\" ), package = list(\"nord\", \"ochRe\", \"awtools\"), palette = list(\"aurora\", \"parliament\", \"bpalette\"), ggtheme = list( ggthemes::theme_stata(), ggplot2::theme_classic(), ggthemes::theme_fivethirtyeight() ) ), .f = ggbetweenstats ) ## combining all individual plots from the list into a single plot using combine_plots function combine_plots( plotlist = plot_list, annotation.args = list(title = \"Changes in life expectancy across continents (1967-2007)\"), plotgrid.args = list(ncol = 1) )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/purrr_examples.html","id":"ggwithinstats","dir":"Articles > Web_only","previous_headings":"","what":"ggwithinstats","title":"Using 'ggstatsplot' with the 'purrr' package","text":"using simulated data Attention Network Test provided ANT dataset ez package.","code":"library(ez) data(\"ANT\") ## loading data from `ez` package ## let's split the data frame and create a list by years of interest cue_list <- ANT %>% split(f = .$cue, drop = TRUE) ## checking the length of the list and the names of each element length(cue_list) ## creating a list of plots by applying the same function for elements of the list plot_list <- purrr::pmap( .l = list( data = cue_list, x = \"flank\", y = \"rt\", xlab = \"Flank\", ylab = \"Response time\", title = list( \"Cue: None\", \"Cue: Center\", \"Cue: Double\", \"Cue: Spatial\" ), type = list(\"p\", \"r\", \"bf\", \"np\"), pairwise.display = list(\"ns\", \"s\", \"ns\", \"all\"), p.adjust.method = list(\"fdr\", \"hommel\", \"bonferroni\", \"BH\"), conf.level = list(0.99, 0.99, 0.95, 0.90), digits = list(3, 2, 2, 3), effsize.type = list( \"omega\", \"eta\", \"partial_omega\", \"partial_eta\" ), package = list(\"ggsci\", \"palettetown\", \"palettetown\", \"wesanderson\"), palette = list(\"lanonc_lancet\", \"venomoth\", \"blastoise\", \"GrandBudapest1\"), ggtheme = list( ggplot2::theme_linedraw(), hrbrthemes::theme_ft_rc(), ggthemes::theme_solarized(), ggthemes::theme_gdocs() ) ), .f = ggwithinstats ) ## combining all individual plots from the list into a single plot using combine_plots function combine_plots( plotlist = plot_list, annotation.args = list(title = \"Response times across flank conditions for each type of cue\"), plotgrid.args = list(ncol = 1) )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/purrr_examples.html","id":"ggscatterstats","dir":"Articles > Web_only","previous_headings":"","what":"ggscatterstats","title":"Using 'ggstatsplot' with the 'purrr' package","text":"next example lets use methodology different data using ggscatterstats produce scatterplots combined marginal histograms/boxplots/density plots statistical details added subtitle. data ’ll use movies_long IMDB part ggstatsplot package. Since ’s large dataset relatively small categories like NC-17 ’ll sample one quarter data completely drop NC-17 using dplyr. time ’ll put code one block- remainder examples vary content follow exact methodology earlier examples.","code":"mpaa_list <- movies_long %>% dplyr::filter(mpaa != \"NC-17\") %>% dplyr::sample_frac(size = 0.25) %>% split(f = .$mpaa, drop = TRUE) ## creating a list of plots plot_list <- purrr::pmap( .l = list( data = mpaa_list, x = \"budget\", y = \"rating\", xlab = \"Budget (in millions of US dollars)\", ylab = \"Rating on IMDB\", title = list( \"MPAA Rating: PG\", \"MPAA Rating: PG-13\", \"MPAA Rating: R\" ), label.var = list(\"title\"), ## note that you need to quote the expressions label.expression = list( quote(rating > 7.5 & budget < 100), quote(rating > 8 & budget < 50), quote(rating > 8 & budget < 10) ), type = list(\"r\", \"np\", \"bf\"), xfill = list(\"#009E73\", \"#999999\", \"#0072B2\"), yfill = list(\"#CC79A7\", \"#F0E442\", \"#D55E00\"), ggtheme = list( ggthemes::theme_tufte(), ggplot2::theme_classic(), ggplot2::theme_light() ) ), .f = ggscatterstats ) ## combining all individual plots from the list into a single plot using combine_plots function combine_plots( plotlist = plot_list, annotation.args = list( title = \"Relationship between movie budget and IMDB rating\", caption = \"Source: www.imdb.com\" ), plotgrid.args = list(ncol = 1) )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/purrr_examples.html","id":"ggcorrmat","dir":"Articles > Web_only","previous_headings":"","what":"ggcorrmat","title":"Using 'ggstatsplot' with the 'purrr' package","text":"","code":"## splitting the data frame by cut and creating a list ## let's leave out \"fair\" cut ## also, to make this fast, let's only use 5% of the sample cut_list <- ggplot2::diamonds %>% dplyr::sample_frac(size = 0.05) %>% dplyr::filter(cut != \"Fair\") %>% split(f = .$cut, drop = TRUE) ## checking the length and names of each element length(cut_list) names(cut_list) ## running function on every element of this list note that if you want the same ## value for a given argument across all elements of the list, you need to ## specify it just once plot_list <- purrr::pmap( .l = list( data = cut_list, cor.vars = list(c(\"carat\", \"depth\", \"table\", \"price\")), type = list(\"pearson\", \"np\", \"robust\", \"bf\"), partial = list(TRUE, FALSE, TRUE, FALSE), title = list(\"Cut: Good\", \"Cut: Very Good\", \"Cut: Premium\", \"Cut: Ideal\"), p.adjust.method = list(\"hommel\", \"fdr\", \"BY\", \"hochberg\"), lab.size = 3.5, colors = list( c(\"#56B4E9\", \"white\", \"#999999\"), c(\"#CC79A7\", \"white\", \"#F0E442\"), c(\"#56B4E9\", \"white\", \"#D55E00\"), c(\"#999999\", \"white\", \"#0072B2\") ), ggtheme = list( ggplot2::theme_linedraw(), ggplot2::theme_classic(), ggthemes::theme_fivethirtyeight(), ggthemes::theme_tufte() ) ), .f = ggcorrmat ) ## combining all individual plots from the list into a single plot using ## `combine_plots` function combine_plots( plotlist = plot_list, guides = \"keep\", annotation.args = list( title = \"Relationship between diamond attributes and price across cut\", caption = \"Dataset: Diamonds from ggplot2 package\" ), plotgrid.args = list(nrow = 2) )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/purrr_examples.html","id":"gghistostats","dir":"Articles > Web_only","previous_headings":"","what":"gghistostats","title":"Using 'ggstatsplot' with the 'purrr' package","text":"","code":"## let's split the data frame and create a list by continent ## let's leave out Oceania because it has just two data points continent_list <- gapminder::gapminder %>% dplyr::filter(year == 2007, continent != \"Oceania\") %>% split(f = .$continent, drop = TRUE) ## checking the length and names of each element length(continent_list) names(continent_list) ## running function on every element of this list note that if you want the same ## value for a given argument across all elements of the list, you need to ## specify it just once plot_list <- purrr::pmap( .l = list( data = continent_list, x = \"lifeExp\", xlab = \"Life expectancy\", test.value = list(35.6, 58.4, 41.6, 64.7), type = list(\"p\", \"np\", \"r\", \"bf\"), bf.message = list(TRUE, FALSE, FALSE, FALSE), title = list( \"Continent: Africa\", \"Continent: Americas\", \"Continent: Asia\", \"Continent: Europe\" ), effsize.type = list(\"d\", \"d\", \"g\", \"g\"), ggtheme = list( ggplot2::theme_classic(), hrbrthemes::theme_ipsum_tw(), ggplot2::theme_minimal(), hrbrthemes::theme_modern_rc() ) ), .f = gghistostats ) ## combining all individual plots from the list into a single plot using combine_plots function combine_plots( plotlist = plot_list, annotation.args = list( title = \"Improvement in life expectancy worldwide since 1950\", caption = \"Note: black line - 1950; blue line - 2007\" ), plotgrid.args = list(nrow = 4) )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/purrr_examples.html","id":"ggdotplotstats","dir":"Articles > Web_only","previous_headings":"","what":"ggdotplotstats","title":"Using 'ggstatsplot' with the 'purrr' package","text":"","code":"library(ggthemes) library(hrbrthemes) ## let's split the data frame and create a list by continent ## let's leave out Oceania because it has just two data points continent_list <- gapminder::gapminder %>% dplyr::filter(continent != \"Oceania\") %>% split(f = .$continent, drop = TRUE) ## checking the length and names of each element length(continent_list) names(continent_list) ## running function on every element of this list note that if you want the same ## value for a given argument across all elements of the list, you need to ## specify it just once plot_list <- purrr::pmap( .l = list( data = continent_list, x = \"gdpPercap\", y = \"year\", xlab = \"GDP per capita (US$, inflation-adjusted)\", test.value = list(2500, 9000, 9500, 10000), type = list(\"p\", \"np\", \"r\", \"bf\"), title = list( \"Continent: Africa\", \"Continent: Americas\", \"Continent: Asia\", \"Continent: Europe\" ), effsize.type = list(\"d\", \"d\", \"g\", \"g\"), centrality.line.args = list( list(color = \"red\"), list(color = \"#0072B2\"), list(color = \"#D55E00\"), list(color = \"#CC79A7\") ), ggtheme = list( ggplot2::theme_minimal(base_family = \"serif\"), ggthemes::theme_tufte(), hrbrthemes::theme_ipsum_rc(axis_title_size = 10), ggthemes::theme_hc(bgcolor = \"darkunica\") ) ), .f = ggdotplotstats ) ## combining all individual plots from the list into a single plot using combine_plots function combine_plots( plotlist = plot_list, annotation.args = list(title = \"Improvement in GDP per capita from 1952-2007\"), plotgrid.args = list(nrow = 4), guides = \"keep\" )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/purrr_examples.html","id":"ggpiestats","dir":"Articles > Web_only","previous_headings":"","what":"ggpiestats","title":"Using 'ggstatsplot' with the 'purrr' package","text":"","code":"## let's split the data frame and create a list by passenger class class_list <- Titanic_full %>% split(f = .$Class, drop = TRUE) ## checking the length and names of each element length(class_list) names(class_list) ## running function on every element of this list note that if you want the same ## value for a given argument across all elements of the list, you need to ## specify it just once plot_list <- purrr::pmap( .l = list( data = class_list, x = \"Survived\", y = \"Sex\", label = list(\"both\", \"count\", \"percentage\", \"both\"), title = list( \"Passenger class: 1st\", \"Passenger class: 2nd\", \"Passenger class: 3rd\", \"Passenger class: Crew\" ), caption = list( \"Total: 319, Died: 120, Survived: 199, % Survived: 62%\", \"Total: 272, Died: 155, Survived: 117, % Survived: 43%\", \"Total: 709, Died: 537, Survived: 172, % Survived: 25%\", \"Data not available for crew passengers\" ), package = list(\"RColorBrewer\", \"ghibli\", \"palettetown\", \"yarrr\"), palette = list(\"Accent\", \"MarnieMedium1\", \"pikachu\", \"nemo\"), ggtheme = list( ggplot2::theme_grey(), ggplot2::theme_bw(), ggthemes::theme_tufte(), ggthemes::theme_economist() ), proportion.test = list(TRUE, FALSE, TRUE, FALSE), type = list(\"p\", \"p\", \"bf\", \"p\") ), .f = ggpiestats ) ## combining all individual plots from the list into a single plot using combine_plots function combine_plots( plotlist = plot_list, annotation.args = list(title = \"Survival in Titanic disaster by gender for all passenger classes\"), plotgrid.args = list(ncol = 1), guides = \"keep\" )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/purrr_examples.html","id":"ggbarstats","dir":"Articles > Web_only","previous_headings":"","what":"ggbarstats","title":"Using 'ggstatsplot' with the 'purrr' package","text":"","code":"## let's split the data frame and create a list by passenger class class_list <- Titanic_full %>% split(f = .$Class, drop = TRUE) ## checking the length and names of each element length(class_list) names(class_list) ## running function on every element of this list note that if you want the same ## value for a given argument across all elements of the list, you need to ## specify it just once plot_list <- purrr::pmap( .l = list( data = class_list, x = \"Survived\", y = \"Sex\", type = \"bayes\", label = list(\"both\", \"count\", \"percentage\", \"both\"), title = list( \"Passenger class: 1st\", \"Passenger class: 2nd\", \"Passenger class: 3rd\", \"Passenger class: Crew\" ), caption = list( \"Total: 319, Died: 120, Survived: 199, % Survived: 62%\", \"Total: 272, Died: 155, Survived: 117, % Survived: 43%\", \"Total: 709, Died: 537, Survived: 172, % Survived: 25%\", \"Data not available for crew passengers\" ), package = list(\"RColorBrewer\", \"ghibli\", \"palettetown\", \"yarrr\"), palette = list(\"Accent\", \"MarnieMedium1\", \"pikachu\", \"nemo\"), ggtheme = list( ggplot2::theme_grey(), ggplot2::theme_bw(), ggthemes::theme_tufte(), ggthemes::theme_economist() ) ), .f = ggbarstats ) ## combining all individual plots from the list into a single plot using combine_plots function combine_plots( plotlist = plot_list, annotation.args = list( title = \"Survival in Titanic disaster by gender for all passenger classes\", caption = \"Asterisks denote results from proportion tests: \\n***: p < 0.001, ns: non-significant\" ), plotgrid.args = list(ncol = 1), guides = \"keep\" )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/purrr_examples.html","id":"grouped_-variants","dir":"Articles > Web_only","previous_headings":"","what":"grouped_ variants","title":"Using 'ggstatsplot' with the 'purrr' package","text":"Note although examples written non-grouped variants functions, rule holds true grouped_ variants functions. example, want use grouped_gghistostats across three different datasets, can use purrr::pmap() function. sake brevity, plots displayed , can run following code check individual grouped_ plots (e.g., plotlist[[1]]).","code":"## create a list of plots plotlist <- purrr::pmap( .l = list( data = list(mtcars, iris, ToothGrowth), x = alist(wt, Sepal.Length, len), results.subtitle = list(FALSE), grouping.var = alist(am, Species, supp) ), .f = grouped_gghistostats ) ## given that we had three different datasets, we expect a list of length 3 ## (each of which contains a `grouped_` plot) length(plotlist)"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/purrr_examples.html","id":"repeating-function-execution-across-multiple-columns-in-a-data-frame","dir":"Articles > Web_only","previous_headings":"","what":"Repeating function execution across multiple columns in a data frame","title":"Using 'ggstatsplot' with the 'purrr' package","text":"","code":"library(patchwork) ## running the same analysis on two different columns (creates a list of plots) plotlist <- purrr::pmap( .l = list( data = list(movies_long), x = \"mpaa\", y = list(\"rating\", \"length\"), title = list(\"IMDB score by MPAA rating\", \"Movie length by MPAA rating\") ), .f = ggbetweenstats ) ## combine plots using `patchwork` plotlist[[1]] + plotlist[[2]]"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/purrr_examples.html","id":"suggestions","dir":"Articles > Web_only","previous_headings":"","what":"Suggestions","title":"Using 'ggstatsplot' with the 'purrr' package","text":"find bugs suggestions/remarks, please file issue GitHub: https://github.com/IndrajeetPatil/ggstatsplot/issues","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Indrajeet Patil. Maintainer, author, copyright holder. Chuck Powell. Contributor.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Patil, . (2021). Visualizations statistical details: 'ggstatsplot' approach. Journal Open Source Software, 6(61), 3167, doi:10.21105/joss.03167","code":"@Article{, doi = {10.21105/joss.03167}, url = {https://doi.org/10.21105/joss.03167}, year = {2021}, publisher = {{The Open Journal}}, volume = {6}, number = {61}, pages = {3167}, author = {Indrajeet Patil}, title = {{Visualizations with statistical details: The {'ggstatsplot'} approach}}, journal = {{Journal of Open Source Software}}, }"},{"path":[]},{"path":"https://indrajeetpatil.github.io/ggstatsplot/index.html","id":"raison-dêtre-","dir":"","previous_headings":"","what":"Raison d’être","title":"ggplot2 Based Plots with Statistical Details","text":"“sought designs display information clear portrayal complexity. complication simple; rather … revelation complex.” - Edward R. Tufte {ggstatsplot} extension {ggplot2} package creating graphics details statistical tests included information-rich plots . typical exploratory data analysis workflow, data visualization statistical modeling two different phases: visualization informs modeling, modeling turn can suggest different visualization method, forth. central idea ggstatsplot simple: combine two phases one form graphics statistical details, makes data exploration simpler faster.","code":""},{"path":[]},{"path":"https://indrajeetpatil.github.io/ggstatsplot/index.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"ggplot2 Based Plots with Statistical Details","text":"want cite package scientific journal context, run following code R console:","code":"citation(\"ggstatsplot\") To cite package 'ggstatsplot' in publications use: Patil, I. (2021). Visualizations with statistical details: The 'ggstatsplot' approach. Journal of Open Source Software, 6(61), 3167, doi:10.21105/joss.03167 A BibTeX entry for LaTeX users is @Article{, doi = {10.21105/joss.03167}, url = {https://doi.org/10.21105/joss.03167}, year = {2021}, publisher = {{The Open Journal}}, volume = {6}, number = {61}, pages = {3167}, author = {Indrajeet Patil}, title = {{Visualizations with statistical details: The {'ggstatsplot'} approach}}, journal = {{Journal of Open Source Software}}, }"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/index.html","id":"acknowledgments","dir":"","previous_headings":"","what":"Acknowledgments","title":"ggplot2 Based Plots with Statistical Details","text":"like thank contributors ggstatsplot pointed bugs requested features hadn’t considered. especially like thank package developers (especially Daniel Lüdecke, Dominique Makowski, Mattan S. Ben-Shachar, Brenton Wiernik, Patrick Mair, Salvatore Mangiafico, etc.) patiently diligently answered relentless questions supported feature requests projects. also want thank Chuck Powell initial contributions package. hexsticker generously designed Sarah Otterstetter (Max Planck Institute Human Development, Berlin). package also benefited larger #rstats community Twitter, LinkedIn, StackOverflow. Thanks also due postdoc advisers (Mina Cikara Fiery Cushman Harvard University; Iyad Rahwan Max Planck Institute Human Development) patiently supported spending hundreds (?) hours working package rather paid . 😁","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/index.html","id":"documentation-and-examples","dir":"","previous_headings":"","what":"Documentation and Examples","title":"ggplot2 Based Plots with Statistical Details","text":"see detailed documentation function stable CRAN version package, see: Publication Vignettes Presentation","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/index.html","id":"summary-of-available-plots","dir":"","previous_headings":"","what":"Summary of available plots","title":"ggplot2 Based Plots with Statistical Details","text":"addition basic plots, ggstatsplot also provides grouped_ versions (see ) makes easy repeat analysis grouping variable.","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/index.html","id":"summary-of-types-of-statistical-analyses","dir":"","previous_headings":"","what":"Summary of types of statistical analyses","title":"ggplot2 Based Plots with Statistical Details","text":"table summarizes different types analyses currently supported package- Summary Bayesian analysis","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/index.html","id":"statistical-reporting","dir":"","previous_headings":"","what":"Statistical reporting","title":"ggplot2 Based Plots with Statistical Details","text":"statistical tests reported plots, default template abides gold standard statistical reporting. example, results Yuen’s test trimmed means (robust t-test):","code":""},{"path":"https://indrajeetpatil.github.io/ggstatsplot/index.html","id":"summary-of-statistical-tests-and-effect-sizes","dir":"","previous_headings":"","what":"Summary of statistical tests and effect sizes","title":"ggplot2 Based Plots with Statistical Details","text":"Statistical analysis carried statsExpressions package, thus summary table statistical tests currently supported across various functions can found article package: https://indrajeetpatil.github.io/statsExpressions/articles/stats_details.html","code":""},{"path":[]},{"path":"https://indrajeetpatil.github.io/ggstatsplot/index.html","id":"ggbetweenstats","dir":"","previous_headings":"Primary functions","what":"ggbetweenstats()","title":"ggplot2 Based Plots with Statistical Details","text":"function creates either violin plot, box plot, mix two -group -condition comparisons results statistical tests subtitle. simplest function call looks like - Defaults return ✅ raw data + distributions ✅ descriptive statistics ✅ inferential statistics ✅ effect size + CIs ✅ pairwise comparisons ✅ Bayesian hypothesis-testing ✅ Bayesian estimation number arguments can specified make plot even informative change default options. Additionally, also grouped_ variant function makes easy repeat operation across single grouping variable: Details underlying functions used create graphics statistical tests carried can found function documentation: https://indrajeetpatil.github.io/ggstatsplot/reference/ggbetweenstats.html , also read following vignette: https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggbetweenstats.html","code":"set.seed(123) ggbetweenstats( data = iris, x = Species, y = Sepal.Length, title = \"Distribution of sepal length across Iris species\" ) set.seed(123) grouped_ggbetweenstats( data = dplyr::filter(movies_long, genre %in% c(\"Action\", \"Comedy\")), x = mpaa, y = length, grouping.var = genre, ggsignif.args = list(textsize = 4, tip_length = 0.01), p.adjust.method = \"bonferroni\", palette = \"default_jama\", package = \"ggsci\", plotgrid.args = list(nrow = 1), annotation.args = list(title = \"Differences in movie length by mpaa ratings for different genres\") )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/index.html","id":"ggwithinstats","dir":"","previous_headings":"Primary functions","what":"ggwithinstats()","title":"ggplot2 Based Plots with Statistical Details","text":"ggbetweenstats() function identical twin function ggwithinstats() repeated measures designs behaves fashion minor tweaks introduced properly visualize repeated measures design. can seen example , difference plot structure now group means connected paths highlight fact data paired . Defaults return ✅ raw data + distributions ✅ descriptive statistics ✅ inferential statistics ✅ effect size + CIs ✅ pairwise comparisons ✅ Bayesian hypothesis-testing ✅ Bayesian estimation ggbetweenstats(), function also grouped_ variant makes repeating analysis across single grouping variable quicker. see example repeated measurements- Details underlying functions used create graphics statistical tests carried can found function documentation: https://indrajeetpatil.github.io/ggstatsplot/reference/ggwithinstats.html , also read following vignette: https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggwithinstats.html","code":"set.seed(123) library(WRS2) ## for data library(afex) ## to run ANOVA ggwithinstats( data = WineTasting, x = Wine, y = Taste, title = \"Wine tasting\" ) set.seed(123) grouped_ggwithinstats( data = dplyr::filter(bugs_long, region %in% c(\"Europe\", \"North America\"), condition %in% c(\"LDLF\", \"LDHF\")), x = condition, y = desire, type = \"np\", xlab = \"Condition\", ylab = \"Desire to kill an artrhopod\", grouping.var = region )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/index.html","id":"gghistostats","dir":"","previous_headings":"Primary functions","what":"gghistostats()","title":"ggplot2 Based Plots with Statistical Details","text":"visualize distribution single variable check mean significantly different specified value one-sample test, gghistostats() can used. Defaults return ✅ counts + proportion bins ✅ descriptive statistics ✅ inferential statistics ✅ effect size + CIs ✅ Bayesian hypothesis-testing ✅ Bayesian estimation also grouped_ variant function makes easy repeat operation across single grouping variable: Details underlying functions used create graphics statistical tests carried can found function documentation: https://indrajeetpatil.github.io/ggstatsplot/reference/gghistostats.html , also read following vignette: https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/gghistostats.html","code":"set.seed(123) gghistostats( data = ggplot2::msleep, x = awake, title = \"Amount of time spent awake\", test.value = 12, binwidth = 1 ) set.seed(123) grouped_gghistostats( data = dplyr::filter(movies_long, genre %in% c(\"Action\", \"Comedy\")), x = budget, test.value = 50, type = \"nonparametric\", xlab = \"Movies budget (in million US$)\", grouping.var = genre, ggtheme = ggthemes::theme_tufte(), ## modify the defaults from `{ggstatsplot}` for each plot plotgrid.args = list(nrow = 1), annotation.args = list(title = \"Movies budgets for different genres\") )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/index.html","id":"ggdotplotstats","dir":"","previous_headings":"Primary functions","what":"ggdotplotstats()","title":"ggplot2 Based Plots with Statistical Details","text":"function similar gghistostats(), intended used numeric variable also label. Defaults return ✅ descriptives (mean + sample size) ✅ inferential statistics ✅ effect size + CIs ✅ Bayesian hypothesis-testing ✅ Bayesian estimation rest functions package, also grouped_ variant function facilitate looping operation levels single grouping variable. Details underlying functions used create graphics statistical tests carried can found function documentation: https://indrajeetpatil.github.io/ggstatsplot/reference/ggdotplotstats.html , also read following vignette: https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggdotplotstats.html","code":"set.seed(123) ggdotplotstats( data = dplyr::filter(gapminder::gapminder, continent == \"Asia\"), y = country, x = lifeExp, test.value = 55, type = \"robust\", title = \"Distribution of life expectancy in Asian continent\", xlab = \"Life expectancy\" ) set.seed(123) grouped_ggdotplotstats( data = dplyr::filter(ggplot2::mpg, cyl %in% c(\"4\", \"6\")), x = cty, y = manufacturer, type = \"bayes\", xlab = \"city miles per gallon\", ylab = \"car manufacturer\", grouping.var = cyl, test.value = 15.5, point.args = list(color = \"red\", size = 5, shape = 13), annotation.args = list(title = \"Fuel economy data\") )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/index.html","id":"ggscatterstats","dir":"","previous_headings":"Primary functions","what":"ggscatterstats()","title":"ggplot2 Based Plots with Statistical Details","text":"function creates scatterplot marginal distributions overlaid axes results statistical tests subtitle: Defaults return ✅ raw data + distributions ✅ marginal distributions ✅ inferential statistics ✅ effect size + CIs ✅ Bayesian hypothesis-testing ✅ Bayesian estimation also grouped_ variant function makes easy repeat operation across single grouping variable. Details underlying functions used create graphics statistical tests carried can found function documentation: https://indrajeetpatil.github.io/ggstatsplot/reference/ggscatterstats.html , also read following vignette: https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggscatterstats.html","code":"ggscatterstats( data = ggplot2::msleep, x = sleep_rem, y = awake, xlab = \"REM sleep (in hours)\", ylab = \"Amount of time spent awake (in hours)\", title = \"Understanding mammalian sleep\" ) set.seed(123) grouped_ggscatterstats( data = dplyr::filter(movies_long, genre %in% c(\"Action\", \"Comedy\")), x = rating, y = length, grouping.var = genre, label.var = title, label.expression = length > 200, xlab = \"IMDB rating\", ggtheme = ggplot2::theme_grey(), ggplot.component = list(ggplot2::scale_x_continuous(breaks = seq(2, 9, 1), limits = (c(2, 9)))), plotgrid.args = list(nrow = 1), annotation.args = list(title = \"Relationship between movie length and IMDB ratings\") )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/index.html","id":"ggcorrmat","dir":"","previous_headings":"Primary functions","what":"ggcorrmat","title":"ggplot2 Based Plots with Statistical Details","text":"ggcorrmat makes correlalogram (matrix correlation coefficients) minimal amount code. Just sticking defaults produces publication-ready correlation matrices. , sake exploring available options, let’s change defaults. example, multiple aesthetics-related arguments can modified change appearance correlation matrix. Defaults return ✅ effect size + significance ✅ careful handling NAs NAs present selected variables, legend display minimum, median, maximum number pairs used correlation tests. also grouped_ variant function makes easy repeat operation across single grouping variable: Details underlying functions used create graphics statistical tests carried can found function documentation: https://indrajeetpatil.github.io/ggstatsplot/reference/ggcorrmat.html , also read following vignette: https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcorrmat.html","code":"set.seed(123) ## as a default this function outputs a correlation matrix plot ggcorrmat( data = ggplot2::msleep, colors = c(\"#B2182B\", \"white\", \"#4D4D4D\"), title = \"Correlalogram for mammals sleep dataset\", subtitle = \"sleep units: hours; weight units: kilograms\" ) set.seed(123) grouped_ggcorrmat( data = dplyr::filter(movies_long, genre %in% c(\"Action\", \"Comedy\")), type = \"robust\", colors = c(\"#cbac43\", \"white\", \"#550000\"), grouping.var = genre, matrix.type = \"lower\" )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/index.html","id":"ggpiestats","dir":"","previous_headings":"Primary functions","what":"ggpiestats()","title":"ggplot2 Based Plots with Statistical Details","text":"function creates pie chart categorical nominal variables results contingency table analysis (Pearson’s chi-squared test -subjects design McNemar’s chi-squared test within-subjects design) included subtitle plot. one categorical variable entered, results one-sample proportion test (.e., chi-squared goodness fit test) displayed subtitle. study interaction two categorical variables: Defaults return ✅ descriptives (frequency + %s) ✅ inferential statistics ✅ effect size + CIs ✅ Goodness--fit tests ✅ Bayesian hypothesis-testing ✅ Bayesian estimation also grouped_ variant function makes easy repeat operation across single grouping variable. Following example case theoretical question proportions different levels single nominal variable: Details underlying functions used create graphics statistical tests carried can found function documentation: https://indrajeetpatil.github.io/ggstatsplot/reference/ggpiestats.html , also read following vignette: https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggpiestats.html","code":"set.seed(123) ggpiestats( data = mtcars, x = am, y = cyl, package = \"wesanderson\", palette = \"Royal1\", title = \"Dataset: Motor Trend Car Road Tests\", legend.title = \"Transmission\" ) set.seed(123) grouped_ggpiestats( data = mtcars, x = cyl, grouping.var = am, label.repel = TRUE, package = \"ggsci\", palette = \"default_ucscgb\" )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/index.html","id":"ggbarstats","dir":"","previous_headings":"Primary functions","what":"ggbarstats()","title":"ggplot2 Based Plots with Statistical Details","text":"case fan pie charts (good reasons), can alternatively use ggbarstats() function similar syntax. N.B. p-values one-sample proportion test displayed top bar. Defaults return ✅ descriptives (frequency + %s) ✅ inferential statistics ✅ effect size + CIs ✅ Goodness--fit tests ✅ Bayesian hypothesis-testing ✅ Bayesian estimation , needless say, also grouped_ variant function- Details underlying functions used create graphics statistical tests carried can found function documentation: https://indrajeetpatil.github.io/ggstatsplot/reference/ggbarstats.html , also read following vignette: https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggbarstats.html","code":"set.seed(123) library(ggplot2) ggbarstats( data = movies_long, x = mpaa, y = genre, title = \"MPAA Ratings by Genre\", xlab = \"movie genre\", legend.title = \"MPAA rating\", ggplot.component = list(ggplot2::scale_x_discrete(guide = ggplot2::guide_axis(n.dodge = 2))), palette = \"Set2\" ) ## setup set.seed(123) grouped_ggbarstats( data = mtcars, x = am, y = cyl, grouping.var = vs, package = \"wesanderson\", palette = \"Darjeeling2\" # , # ggtheme = ggthemes::theme_tufte(base_size = 12) )"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/index.html","id":"ggcoefstats","dir":"","previous_headings":"Primary functions","what":"ggcoefstats()","title":"ggplot2 Based Plots with Statistical Details","text":"function ggcoefstats() generates dot--whisker plots regression models. tidy data frames prepared using parameters::model_parameters(). Additionally, available, model summary indices also extracted performance::model_performance(). Defaults return ✅ inferential statistics ✅ estimate + CIs ✅ model summary (AIC BIC) Details underlying functions used create graphics statistical tests carried can found function documentation: https://indrajeetpatil.github.io/ggstatsplot/reference/ggcoefstats.html , also read following vignette: https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcoefstats.html","code":"set.seed(123) ## model mod <- stats::lm(formula = mpg ~ am * cyl, data = mtcars) ggcoefstats(mod)"},{"path":"https://indrajeetpatil.github.io/ggstatsplot/index.html","id":"extracting-expressions-and-data-frames-with-statistical-details","dir":"","previous_headings":"Primary functions","what":"Extracting expressions and data frames with statistical details","title":"ggplot2 Based Plots with Statistical Details","text":"ggstatsplot also offers convenience function extract data frames statistical details used create expressions displayed ggstatsplot plots. Note analysis carried statsExpressions package: https://indrajeetpatil.github.io/statsExpressions/","code":"set.seed(123) p <- ggbetweenstats(mtcars, cyl, mpg) # extracting expression present in the subtitle extract_subtitle(p) #> list(italic(\"F\")[\"Welch\"](2, 18.03) == \"31.62\", italic(p) == #> \"1.27e-06\", widehat(omega[\"p\"]^2) == \"0.74\", CI[\"95%\"] ~ #> \"[\" * \"0.53\", \"1.00\" * \"]\", italic(\"n\")[\"obs\"] == \"32\") # extracting expression present in the caption extract_caption(p) #> list(log[e] * (BF[\"01\"]) == \"-14.92\", widehat(italic(R^\"2\"))[\"Bayesian\"]^\"posterior\" == #> \"0.71\", CI[\"95%\"]^HDI ~ \"[\" * \"0.57\", \"0.79\" * \"]\", italic(\"r\")[\"Cauchy\"]^\"JZS\" == #> \"0.71\") # a list of tibbles containing statistical analysis summaries extract_stats(p) #> $subtitle_data #> # A tibble: 1 × 14 #> statistic df df.error p.value #> #> 1 31.6 2 18.0 0.00000127 #> method effectsize estimate #> #> 1 One-way analysis of means (not assuming equal variances) Omega2 0.744 #> conf.level conf.low conf.high conf.method conf.distribution n.obs expression #> #> 1 0.95 0.531 1 ncp F 32 #> #> $caption_data #> # A tibble: 6 × 17 #> term pd prior.distribution prior.location prior.scale bf10 #> #> 1 mu 1 cauchy 0 0.707 3008850. #> 2 cyl-4 1 cauchy 0 0.707 3008850. #> 3 cyl-6 0.780 cauchy 0 0.707 3008850. #> 4 cyl-8 1 cauchy 0 0.707 3008850. #> 5 sig2 1 cauchy 0 0.707 3008850. #> 6 g_cyl 1 cauchy 0 0.707 3008850. #> method log_e_bf10 effectsize estimate std.dev #> #> 1 Bayes factors for linear models 14.9 Bayesian R-squared 0.714 0.0503 #> 2 Bayes factors for linear models 14.9 Bayesian R-squared 0.714 0.0503 #> 3 Bayes factors for linear models 14.9 Bayesian R-squared 0.714 0.0503 #> 4 Bayes factors for linear models 14.9 Bayesian R-squared 0.714 0.0503 #> 5 Bayes factors for linear models 14.9 Bayesian R-squared 0.714 0.0503 #> 6 Bayes factors for linear models 14.9 Bayesian R-squared 0.714 0.0503 #> conf.level conf.low conf.high conf.method n.obs expression #>