<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="rempsyc">
<title>Planned Contrasts Analyses (Group Comparisons) ‚Ä¢ rempsyc</title>
<!-- favicons --><link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png">
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png">
<link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png">
<script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="../deps/bootstrap-5.2.2/bootstrap.min.css" rel="stylesheet">
<script src="../deps/bootstrap-5.2.2/bootstrap.bundle.min.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous">
<!-- bootstrap-toc --><script src="https://cdn.jsdelivr.net/gh/afeld/bootstrap-toc@v1.0.1/dist/bootstrap-toc.min.js" integrity="sha256-4veVQbu7//Lk5TSmc7YV48MxtMy98e26cf5MrgZYnwo=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- search --><script src="https://cdnjs.cloudflare.com/ajax/libs/fuse.js/6.4.6/fuse.js" integrity="sha512-zv6Ywkjyktsohkbp9bb45V6tEMoWhzFzXis+LrMehmJZZSys19Yxf1dopHx7WzIKxr5tK2dVcYmaCk2uqdjF4A==" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/autocomplete.js/0.38.0/autocomplete.jquery.min.js" integrity="sha512-GU9ayf+66Xx2TmpxqJpliWbT5PiGYxpaG8rfnBEk1LL8l1KGkRShhngwdXK1UgqhAzWpZHSiYPc09/NwDQIGyg==" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/mark.min.js" integrity="sha512-5CYOlHXGh6QpOFA/TeTylKLWfB3ftPsde7AnmhuitiTX4K5SqCLBeKro6sPS8ilsz1Q4NRx3v8Ko2IBiszzdww==" crossorigin="anonymous"></script><!-- pkgdown --><script src="../pkgdown.js"></script><meta property="og:title" content="Planned Contrasts Analyses (Group Comparisons)">
<meta property="og:description" content="rempsyc">
<meta property="og:image" content="https://rempsyc.remi-theriault.com/logo.png">
<!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]--><!-- Global site tag (gtag.js) - Google Analytics --><script async src="https://www.googletagmanager.com/gtag/js?id=G-274QZTFL23"></script><script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-274QZTFL23');
</script>
</head>
<body>
    <a href="#main" class="visually-hidden-focusable">Skip to contents</a>
    

    <nav class="navbar fixed-top navbar-default navbar-expand-lg bg-light"><div class="container">
    
    <a class="navbar-brand me-2" href="../index.html">rempsyc</a>

    <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.1.3</small>

    
    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>

    <div id="navbar" class="collapse navbar-collapse ms-3">
      <ul class="navbar-nav me-auto">
<li class="nav-item">
  <a class="nav-link" href="../index.html">
    <span class="fa fa-home"></span>
     
  </a>
</li>
<li class="active nav-item dropdown">
  <a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown" role="button" aria-expanded="false" aria-haspopup="true" id="dropdown-tutorials">Tutorials</a>
  <div class="dropdown-menu" aria-labelledby="dropdown-tutorials">
    <h6 class="dropdown-header" data-toc-skip>‚àö STATISTICS</h6>
    <a class="dropdown-item" href="../articles/table.html">APA tables</a>
    <a class="dropdown-item" href="../articles/t-test.html">t tests</a>
    <a class="dropdown-item" href="../articles/contrasts.html">Planned contrasts</a>
    <a class="dropdown-item" href="../articles/moderation.html">Moderations</a>
    <a class="dropdown-item" href="../articles/randomize.html">Randomization</a>
    <h6 class="dropdown-header" data-toc-skip>üìä VISUALIZATION</h6>
    <a class="dropdown-item" href="../articles/violin.html">Violin plots</a>
    <a class="dropdown-item" href="../articles/scatter.html">Scatter plots</a>
    <a class="dropdown-item" href="../articles/circles.html">Overlapping circles</a>
    <a class="dropdown-item" href="../articles/assumptions.html">Assumptions</a>
  </div>
</li>
<li class="nav-item">
  <a class="nav-link" href="../reference/index.html">Functions</a>
</li>
<li class="nav-item">
  <a class="nav-link" href="../news/index.html">News</a>
</li>
<li class="nav-item">
  <a class="nav-link" href="../TODOS.html">To-dos</a>
</li>
<li class="nav-item">
  <a class="nav-link" href="../articles/featured.html">Featured In</a>
</li>
      </ul>
<form class="form-inline my-2 my-lg-0" role="search">
        <input type="search" class="form-control me-sm-2" aria-label="Toggle navigation" name="search-input" data-search-index="../search.json" id="search-input" placeholder="Search for" autocomplete="off">
</form>

      <ul class="navbar-nav">
<li class="nav-item">
  <a class="external-link nav-link" href="https://lavaanExtra.remi-theriault.com/" aria-label="lavaanExtra">lavaanExtra</a>
</li>
<li class="nav-item">
  <a class="external-link nav-link" href="https://twitter.com/rempsyc" aria-label="Twitter">
    <span class="fa fa-twitter"></span>
     
  </a>
</li>
<li class="nav-item">
  <a class="external-link nav-link" href="https://github.com/rempsyc/rempsyc/" aria-label="GitHub">
    <span class="fa fa-github"></span>
     
  </a>
</li>
<li class="nav-item">
  <a class="external-link nav-link" href="https://github.com/sponsors/rempsyc" aria-label="Donate">
    <span class="fa fa-coffee"></span>
     
  </a>
</li>
      </ul>
</div>

    
  </div>
</nav><div class="container template-article">



<link href="contrasts_files/tabwid-1.1.3/tabwid.css" rel="stylesheet">
<script src="contrasts_files/tabwid-1.1.3/tabwid.js"></script><div class="row">
  <main id="main" class="col-md-9"><div class="page-header">
      <img src="../logo.png" class="logo" alt=""><h1>Planned Contrasts Analyses (Group Comparisons)</h1>
                        <h4 data-toc-skip class="author">R√©mi
Th√©riault</h4>
            
            <h4 data-toc-skip class="date">July 25, 2021</h4>
      
      <small class="dont-index">Source: <a href="https://github.com/rempsyc/rempsyc/blob/HEAD/vignettes/contrasts.Rmd" class="external-link"><code>vignettes/contrasts.Rmd</code></a></small>
      <div class="d-none name"><code>contrasts.Rmd</code></div>
    </div>

    
    
<div class="section level2">
<h2 id="basic-idea">Basic Idea<a class="anchor" aria-label="anchor" href="#basic-idea"></a>
</h2>
<p>In this post, I will document how I conduct planned contrasts
analyses to test whether experimental groups differ from each other.
Planned contrasts are similar to <em>t</em> tests, but provide more
power when you have several groups:</p>
<blockquote>
<p>Statistical power is lower with the standard <em>t</em> test compared
than it is with the planned contrast version for two reasons: a) the
sample size is smaller with the <em>t</em> test, because only the cases
in the two groups are selected; and b) in the planned contrast the error
term is smaller than it is with the standard <em>t</em> test because it
is based on all the cases (<a href="https://web.pdx.edu/~newsomj/uvclass/ho_planned%20contrasts.pdf" class="external-link">source</a>)</p>
</blockquote>
<p>I will first demonstrate a simple example for conducting the
analysis, exporting the table of results to Microsoft Word, and
producing the figure. After demonstrating it for a single variable, we
will then look at a full workflow, i.e., how we can automatize the
process for several variables simultaneously.</p>
<div class="section level3">
<h3 id="getting-started">Getting started<a class="anchor" aria-label="anchor" href="#getting-started"></a>
</h3>
<p>For the minimal example, we will use the <code>iris</code> dataset,
which is installed with <code>R</code> by default.</p>
</div>
<div class="section level3">
<h3 id="using-nice_contrasts">Using <code>nice_contrasts()</code><a class="anchor" aria-label="anchor" href="#using-nice_contrasts"></a>
</h3>
<p><strong>Load the <code>rempsyc</code> package:</strong></p>
<div class="sourceCode" id="cb1"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://rempsyc.remi-theriault.com">rempsyc</a></span><span class="op">)</span></span></code></pre></div>
<blockquote>
<p><strong><em>Note:</em></strong> If you haven‚Äôt installed this package
yet, you will need to install it via the following command:
<code>install.packages("rempsyc")</code>.</p>
</blockquote>
<p>Let‚Äôs test out the function on existing data</p>
<div class="sourceCode" id="cb2"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">table.stats</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/nice_contrasts.html">nice_contrasts</a></span><span class="op">(</span>response <span class="op">=</span> <span class="st">"Sepal.Length"</span>,</span>
<span>                              group <span class="op">=</span> <span class="st">"Species"</span>,</span>
<span>                              data <span class="op">=</span> <span class="va">iris</span><span class="op">)</span></span>
<span><span class="va">table.stats</span></span></code></pre></div>
<pre><code><span><span class="co">##   Dependent Variable             Comparison  df          t            p</span></span>
<span><span class="co">## 1       Sepal.Length     setosa - virginica 147 -15.365506 2.214821e-32</span></span>
<span><span class="co">## 2       Sepal.Length versicolor - virginica 147  -6.332686 2.765638e-09</span></span>
<span><span class="co">## 3       Sepal.Length    setosa - versicolor 147  -9.032819 8.770194e-16</span></span>
<span><span class="co">##           d  CI_lower   CI_upper</span></span>
<span><span class="co">## 1 -3.073101 -3.539458 -2.4698132</span></span>
<span><span class="co">## 2 -1.266537 -1.710106 -0.7764728</span></span>
<span><span class="co">## 3 -1.806564 -2.155151 -1.3940633</span></span></code></pre>
<p>This will give us Cohen‚Äôs <em>d</em> by default for the effect size,
but it is possible to request the ‚Äòrobust‚Äô version (i.e., robust to
deviations from parametric assumptions) of Cohen‚Äôs <em>d</em> by
specifying <code>effect.type = "akp.robust.d"</code>. It will also
provide us with bootstrapped 95% confidence intervals of that effect
size.</p>
</div>
<div class="section level3">
<h3 id="make-it-publication-ready-using-nice_table-">Make it publication-ready using <a href="../articles/table.html"><code>nice_table()</code></a>.<a class="anchor" aria-label="anchor" href="#make-it-publication-ready-using-nice_table-"></a>
</h3>
<div class="sourceCode" id="cb4"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="op">(</span><span class="va">my_table</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/nice_table.html">nice_table</a></span><span class="op">(</span><span class="va">table.stats</span><span class="op">)</span><span class="op">)</span></span></code></pre></div>
<div class="tabwid">
<style>.cl-106e8cf2{table-layout:auto;}.cl-10453924{font-family:'Times New Roman';font-size:12pt;font-weight:normal;font-style:normal;text-decoration:none;color:rgba(0, 0, 0, 1.00);background-color:transparent;}.cl-10453925{font-family:'Times New Roman';font-size:12pt;font-weight:normal;font-style:italic;text-decoration:none;color:rgba(0, 0, 0, 1.00);background-color:transparent;}.cl-1062cee4{margin:0;text-align:center;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 2;background-color:transparent;}.cl-1062cee5{margin:0;text-align:left;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 2;background-color:transparent;}.cl-10631cf0{background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(0, 0, 0, 1.00);border-top: 0.5pt solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-10631cf1{background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-10631cf2{background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-10631cf3{background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-10631cf4{background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}</style>
<table data-quarto-disable-processing="true" class="table cl-106e8cf2">
<thead><tr style="overflow-wrap:break-word;">
<th class="cl-10631cf0"><p class="cl-1062cee4"><span class="cl-10453924">Dependent Variable</span></p></th>
<th class="cl-10631cf0"><p class="cl-1062cee4"><span class="cl-10453924">Comparison</span></p></th>
<th class="cl-10631cf0"><p class="cl-1062cee4"><span class="cl-10453925">df</span></p></th>
<th class="cl-10631cf0"><p class="cl-1062cee4"><span class="cl-10453925">t</span></p></th>
<th class="cl-10631cf0"><p class="cl-1062cee4"><span class="cl-10453925">p</span></p></th>
<th class="cl-10631cf0"><p class="cl-1062cee4"><span class="cl-10453925">d</span></p></th>
<th class="cl-10631cf0"><p class="cl-1062cee4"><span class="cl-10453924">95% CI</span></p></th>
</tr></thead>
<tbody>
<tr style="overflow-wrap:break-word;">
<td rowspan="3" class="cl-10631cf1"><p class="cl-1062cee5"><span class="cl-10453924">Sepal.Length</span></p></td>
<td class="cl-10631cf2"><p class="cl-1062cee4"><span class="cl-10453924">setosa - virginica</span></p></td>
<td class="cl-10631cf2"><p class="cl-1062cee4"><span class="cl-10453924">147</span></p></td>
<td class="cl-10631cf2"><p class="cl-1062cee4"><span class="cl-10453924">-15.37</span></p></td>
<td class="cl-10631cf2"><p class="cl-1062cee4"><span class="cl-10453924">&lt; .001***</span></p></td>
<td class="cl-10631cf2"><p class="cl-1062cee4"><span class="cl-10453924">-3.07</span></p></td>
<td class="cl-10631cf2"><p class="cl-1062cee4"><span class="cl-10453924">[-3.54, -2.47]</span></p></td>
</tr>
<tr style="overflow-wrap:break-word;">
<td class="cl-10631cf2"><p class="cl-1062cee4"><span class="cl-10453924">versicolor - virginica</span></p></td>
<td class="cl-10631cf2"><p class="cl-1062cee4"><span class="cl-10453924">147</span></p></td>
<td class="cl-10631cf2"><p class="cl-1062cee4"><span class="cl-10453924">-6.33</span></p></td>
<td class="cl-10631cf2"><p class="cl-1062cee4"><span class="cl-10453924">&lt; .001***</span></p></td>
<td class="cl-10631cf2"><p class="cl-1062cee4"><span class="cl-10453924">-1.27</span></p></td>
<td class="cl-10631cf2"><p class="cl-1062cee4"><span class="cl-10453924">[-1.71, -0.78]</span></p></td>
</tr>
<tr style="overflow-wrap:break-word;">
<td class="cl-10631cf4"><p class="cl-1062cee4"><span class="cl-10453924">setosa - versicolor</span></p></td>
<td class="cl-10631cf4"><p class="cl-1062cee4"><span class="cl-10453924">147</span></p></td>
<td class="cl-10631cf4"><p class="cl-1062cee4"><span class="cl-10453924">-9.03</span></p></td>
<td class="cl-10631cf4"><p class="cl-1062cee4"><span class="cl-10453924">&lt; .001***</span></p></td>
<td class="cl-10631cf4"><p class="cl-1062cee4"><span class="cl-10453924">-1.81</span></p></td>
<td class="cl-10631cf4"><p class="cl-1062cee4"><span class="cl-10453924">[-2.16, -1.39]</span></p></td>
</tr>
</tbody>
</table>
</div>
<p><strong>Save the table to Word</strong></p>
<div class="sourceCode" id="cb5"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu">flextable</span><span class="fu">::</span><span class="fu"><a href="https://davidgohel.github.io/flextable/reference/save_as_docx.html" class="external-link">save_as_docx</a></span><span class="op">(</span><span class="va">my_table</span>, path <span class="op">=</span> <span class="st">"contrasts.docx"</span><span class="op">)</span></span></code></pre></div>
</div>
<div class="section level3">
<h3 id="make-a-violin-plot-comparing-groups-through-nice_violin-">Make a violin plot comparing groups through <a href="../articles/violin.html"><code>nice_violin()</code></a>.<a class="anchor" aria-label="anchor" href="#make-a-violin-plot-comparing-groups-through-nice_violin-"></a>
</h3>
<div class="sourceCode" id="cb6"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="op">(</span><span class="va">figure</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/nice_violin.html">nice_violin</a></span><span class="op">(</span>group <span class="op">=</span> <span class="st">"Species"</span>, </span>
<span>                       response <span class="op">=</span> <span class="st">"Sepal.Length"</span>, </span>
<span>                       data <span class="op">=</span> <span class="va">iris</span>,</span>
<span>                       ytitle <span class="op">=</span> <span class="st">"Length of Sepal"</span>, </span>
<span>                       signif_annotation <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"***"</span>, <span class="st">"***"</span>, <span class="st">"***"</span><span class="op">)</span>,</span>
<span>                       signif_yposition <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">8.7</span>, <span class="fl">7.3</span>, <span class="fl">8.2</span><span class="op">)</span>,</span>
<span>                       signif_xmin <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"setosa"</span>, <span class="st">"setosa"</span>, <span class="st">"versicolor"</span><span class="op">)</span>,</span>
<span>                       signif_xmax <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"virginica"</span>, <span class="st">"versicolor"</span>, <span class="st">"virginica"</span><span class="op">)</span><span class="op">)</span><span class="op">)</span></span></code></pre></div>
<p><img src="contrasts_files/figure-html/unnamed-chunk-5-1.png" width="70%"></p>
<p>Let‚Äôs save a high-resolution/vector version of this figure in PDF (it
could be .png or any other format too if necessary).</p>
<div class="sourceCode" id="cb7"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu">ggplot2</span><span class="fu">::</span><span class="fu"><a href="https://ggplot2.tidyverse.org/reference/ggsave.html" class="external-link">ggsave</a></span><span class="op">(</span><span class="st">'Figure 1.pdf'</span>, <span class="va">figure</span>, width <span class="op">=</span> <span class="fl">7</span>, height <span class="op">=</span> <span class="fl">7</span>, </span>
<span>                unit <span class="op">=</span> <span class="st">'in'</span>, dpi <span class="op">=</span> <span class="fl">300</span><span class="op">)</span></span></code></pre></div>
<p>Congratulations for making it that far! You‚Äôve done it! From A to Z,
you now know how to make things work! If you would like to integrate
this with a broader workflow, read on for the next part!</p>
</div>
</div>
<div class="section level2">
<h2 id="full-workflow">Full Workflow<a class="anchor" aria-label="anchor" href="#full-workflow"></a>
</h2>
<p>For the full workflow, we will use the dataset from one of my studies
published at the <em>Quarterly Journal of Experimental Psychology</em>
(<a href="https://doi.org/10.1177/17470218211024826" class="external-link uri">https://doi.org/10.1177/17470218211024826</a>) and available
on the Open Science Framework.</p>
<p><strong>Load the data file from the Open Science
Framework</strong></p>
<div class="sourceCode" id="cb8"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">data</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/utils/read.table.html" class="external-link">read.csv</a></span><span class="op">(</span><span class="st">"https://osf.io/qkmnp//?action=download"</span>, header<span class="op">=</span><span class="cn">TRUE</span><span class="op">)</span></span></code></pre></div>
<p><strong>Specify the order of factor levels for ‚ÄúGroup‚Äù</strong>
(otherwise R will alphabetize them)</p>
<div class="sourceCode" id="cb9"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="op">(</span><span class="va">data</span><span class="op">$</span><span class="va">Group</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/factor.html" class="external-link">factor</a></span><span class="op">(</span><span class="va">data</span><span class="op">$</span><span class="va">Group</span>, levels <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"Embodied"</span>, <span class="st">"Mental"</span>, <span class="st">"Control"</span><span class="op">)</span><span class="op">)</span><span class="op">)</span></span></code></pre></div>
<pre><code><span><span class="co">##  [1] Embodied Embodied Control  Control  Mental   Embodied Control  Control </span></span>
<span><span class="co">##  [9] Control  Embodied Mental   Mental   Control  Control  Mental   Control </span></span>
<span><span class="co">## [17] Mental   Mental   Embodied Embodied Control  Embodied Mental   Control </span></span>
<span><span class="co">## [25] Embodied Embodied Mental   Control  Mental   Embodied Embodied Mental  </span></span>
<span><span class="co">## [33] Mental   Mental   Embodied Mental   Embodied Mental   Control  Embodied</span></span>
<span><span class="co">## [41] Mental   Mental   Embodied Mental   Mental   Embodied Control  Control </span></span>
<span><span class="co">## [49] Control  Mental   Embodied Control  Embodied Control  Mental   Embodied</span></span>
<span><span class="co">## [57] Embodied Embodied Control  Control  Control  Control  Mental   Control </span></span>
<span><span class="co">## [65] Mental   Embodied Embodied Mental   Embodied Control  Control  Mental  </span></span>
<span><span class="co">## [73] Mental   Control  Control  Embodied Mental   Control  Embodied Embodied</span></span>
<span><span class="co">## [81] Embodied Mental   Control  Control  Embodied Mental   Mental   Mental  </span></span>
<span><span class="co">## [89] Embodied Control </span></span>
<span><span class="co">## Levels: Embodied Mental Control</span></span></code></pre>
<p><strong>Define our dependent variables</strong></p>
<div class="sourceCode" id="cb11"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://dplyr.tidyverse.org" class="external-link">dplyr</a></span><span class="op">)</span></span>
<span><span class="op">(</span><span class="va">DV</span> <span class="op">&lt;-</span> <span class="va">data</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%&gt;%</a></span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html" class="external-link">select</a></span><span class="op">(</span><span class="va">QCAEPR</span><span class="op">:</span><span class="va">IOS</span><span class="op">)</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%&gt;%</a></span> <span class="va">names</span><span class="op">)</span></span></code></pre></div>
<pre><code><span><span class="co">## [1] "QCAEPR" "IRIPT"  "IRIFS"  "IRIEC"  "IRIPD"  "IOS"</span></span></code></pre>
<div class="sourceCode" id="cb13"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">table.stats</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/nice_contrasts.html">nice_contrasts</a></span><span class="op">(</span>response <span class="op">=</span> <span class="va">DV</span>,</span>
<span>                              group <span class="op">=</span> <span class="st">"Group"</span>,</span>
<span>                              data <span class="op">=</span> <span class="va">data</span><span class="op">)</span></span>
<span><span class="va">table.stats</span></span></code></pre></div>
<pre><code><span><span class="co">##    Dependent Variable         Comparison df           t            p</span></span>
<span><span class="co">## 1              QCAEPR Embodied - Control 87  2.19599050 3.075313e-02</span></span>
<span><span class="co">## 2              QCAEPR   Mental - Control 87  0.23740438 8.129013e-01</span></span>
<span><span class="co">## 3              QCAEPR  Embodied - Mental 87  1.95858612 5.336471e-02</span></span>
<span><span class="co">## 4               IRIPT Embodied - Control 86  0.12249596 9.027921e-01</span></span>
<span><span class="co">## 5               IRIPT   Mental - Control 86  0.01932946 9.846231e-01</span></span>
<span><span class="co">## 6               IRIPT  Embodied - Mental 86  0.10212396 9.188960e-01</span></span>
<span><span class="co">## 7               IRIFS Embodied - Control 86  0.15139155 8.800214e-01</span></span>
<span><span class="co">## 8               IRIFS   Mental - Control 86 -1.38629687 1.692400e-01</span></span>
<span><span class="co">## 9               IRIFS  Embodied - Mental 86  1.53639996 1.281114e-01</span></span>
<span><span class="co">## 10              IRIEC Embodied - Control 86  2.30118373 2.379970e-02</span></span>
<span><span class="co">## 11              IRIEC   Mental - Control 86  1.44763512 1.513548e-01</span></span>
<span><span class="co">## 12              IRIEC  Embodied - Mental 86  0.83396371 4.066119e-01</span></span>
<span><span class="co">## 13              IRIPD Embodied - Control 86  2.13034255 3.599933e-02</span></span>
<span><span class="co">## 14              IRIPD   Mental - Control 86  0.85841114 3.930517e-01</span></span>
<span><span class="co">## 15              IRIPD  Embodied - Mental 86  1.25380051 2.133121e-01</span></span>
<span><span class="co">## 16                IOS Embodied - Control 87  4.70778837 9.385982e-06</span></span>
<span><span class="co">## 17                IOS   Mental - Control 87  2.12312024 3.658408e-02</span></span>
<span><span class="co">## 18                IOS  Embodied - Mental 87  2.58466812 1.141344e-02</span></span>
<span><span class="co">##               d    CI_lower  CI_upper</span></span>
<span><span class="co">## 1   0.567002309  0.01430252 1.0868181</span></span>
<span><span class="co">## 2   0.061297547 -0.51543339 0.5629653</span></span>
<span><span class="co">## 3   0.505704762  0.01603980 0.9669974</span></span>
<span><span class="co">## 4   0.031628320 -0.52085825 0.5615530</span></span>
<span><span class="co">## 5   0.005033685 -0.51281341 0.4599128</span></span>
<span><span class="co">## 6   0.026594635 -0.49551590 0.5100897</span></span>
<span><span class="co">## 7   0.039089129 -0.47970421 0.5793142</span></span>
<span><span class="co">## 8  -0.361012819 -0.90874617 0.1609175</span></span>
<span><span class="co">## 9   0.400101948 -0.11538511 0.9216909</span></span>
<span><span class="co">## 10  0.594163085  0.07690191 1.1668972</span></span>
<span><span class="co">## 11  0.376986233 -0.15147602 0.9231150</span></span>
<span><span class="co">## 12  0.217176852 -0.30170994 0.6760969</span></span>
<span><span class="co">## 13  0.550052081  0.03336366 1.0432145</span></span>
<span><span class="co">## 14  0.223543334 -0.25798385 0.7017699</span></span>
<span><span class="co">## 15  0.326508748 -0.26403006 0.8642355</span></span>
<span><span class="co">## 16  1.215545729  0.63068139 1.7824378</span></span>
<span><span class="co">## 17  0.548187290  0.04558968 1.0555871</span></span>
<span><span class="co">## 18  0.667358440  0.11918761 1.2435837</span></span></code></pre>
<p><strong>Add more meaningful names for measures</strong></p>
<div class="sourceCode" id="cb15"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">table.stats</span><span class="op">[</span><span class="fl">1</span><span class="op">]</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/rep.html" class="external-link">rep</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"Peripheral Responsivity (QCAE)"</span>,</span>
<span>                        <span class="st">"Perspective-Taking (IRI)"</span>, </span>
<span>                        <span class="st">"Fantasy (IRI)"</span>, <span class="st">"Empathic Concern (IRI)"</span>, </span>
<span>                        <span class="st">"Personal Distress (IRI)"</span>,</span>
<span>                        <span class="st">"Inclusion of Other in the Self (IOS)"</span><span class="op">)</span>, each <span class="op">=</span> <span class="fl">3</span><span class="op">)</span></span></code></pre></div>
<div class="section level3">
<h3 id="make-it-publication-ready-using-nice_table--1">Make it publication-ready using <a href="../articles/table.html">nice_table()</a>.<a class="anchor" aria-label="anchor" href="#make-it-publication-ready-using-nice_table--1"></a>
</h3>
<p>Note that with option <code>highlight = TRUE</code>, it will
automatically highlight significant results.</p>
<div class="sourceCode" id="cb16"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="op">(</span><span class="va">my_table</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/nice_table.html">nice_table</a></span><span class="op">(</span><span class="va">table.stats</span>, </span>
<span>                        highlight <span class="op">=</span> <span class="cn">TRUE</span>,</span>
<span>                        title <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"Table 1"</span>, <span class="st">"Results of multiple regression with planned contrasts analyses for empathy subscales and self‚Äìother merging (confirmatory analyses with the exception of self‚Äìother merging)"</span><span class="op">)</span>,</span>
<span>                        note <span class="op">=</span> <span class="st">"\U1D451\U1D3F = robust Cohen‚Äôs \U1D451; CI = bootstrapped confidence interval. The comparisons were between-groups only (i.e., there were no within-subject pre/post comparisons). One participant did not complete the Interpersonal Reactivity Index. Bold/Grey background values represent statistically significant differences between the groups on that row and variable."</span><span class="op">)</span><span class="op">)</span></span></code></pre></div>
<div class="tabwid">
<style>.cl-1c656a44{table-layout:auto;}.cl-1c4d0422{font-family:'Times New Roman';font-size:12pt;font-weight:bold;font-style:normal;text-decoration:none;color:rgba(0, 0, 0, 1.00);background-color:transparent;}.cl-1c4d0423{font-family:'Times New Roman';font-size:12pt;font-weight:bold;font-style:italic;text-decoration:none;color:rgba(0, 0, 0, 1.00);background-color:transparent;}.cl-1c4d0424{font-family:'Times New Roman';font-size:12pt;font-weight:normal;font-style:italic;text-decoration:none;color:rgba(0, 0, 0, 1.00);background-color:transparent;}.cl-1c4d0425{font-family:'Times New Roman';font-size:12pt;font-weight:normal;font-style:normal;text-decoration:none;color:rgba(0, 0, 0, 1.00);background-color:transparent;}.cl-1c55673e{margin:0;text-align:left;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 2;background-color:transparent;}.cl-1c55673f{margin:0;text-align:center;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 2;background-color:transparent;}.cl-1c556740{margin:0;text-align:left;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 1;background-color:transparent;}.cl-1c55dc64{background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-1c55dc65{background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-1c55dc66{background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(0, 0, 0, 1.00);border-top: 0.5pt solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-1c55dc67{background-color:rgba(217, 217, 217, 1.00);vertical-align: middle;border-bottom: 0.5pt solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-1c55dc68{background-color:rgba(217, 217, 217, 1.00);vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-1c55dc69{background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-1c55dc6a{background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-1c55dc6b{background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-1c55dc6c{background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-1c55dc6d{background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(0, 0, 0, 1.00);border-top: 0.5pt solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-1c55dc6e{background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0.5pt solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-1c56036a{background-color:rgba(217, 217, 217, 1.00);vertical-align: middle;border-bottom: 0.5pt solid rgba(0, 0, 0, 1.00);border-top: 0.5pt solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-1c56036b{background-color:rgba(217, 217, 217, 1.00);vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0.5pt solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-1c56036c{background-color:rgba(217, 217, 217, 1.00);vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-1c56036d{background-color:rgba(217, 217, 217, 1.00);vertical-align: middle;border-bottom: 0.5pt solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-1c56036e{background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(255, 255, 255, 0.00);border-top: 0 solid rgba(255, 255, 255, 0.00);border-left: 0 solid rgba(255, 255, 255, 0.00);border-right: 0 solid rgba(255, 255, 255, 0.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}</style>
<table data-quarto-disable-processing="true" class="table cl-1c656a44">
<thead>
<tr style="overflow-wrap:break-word;"><th colspan="7" class="cl-1c55dc64"><p class="cl-1c55673e"><span class="cl-1c4d0422">Table 1</span></p></th></tr>
<tr style="overflow-wrap:break-word;"><th colspan="7" class="cl-1c55dc65"><p class="cl-1c55673e"><span class="cl-1c4d0424">Results of multiple regression with planned contrasts analyses for empathy subscales and self‚Äìother merging (confirmatory analyses with the exception of self‚Äìother merging)</span></p></th></tr>
<tr style="overflow-wrap:break-word;">
<th class="cl-1c55dc66"><p class="cl-1c55673f"><span class="cl-1c4d0425">Dependent Variable</span></p></th>
<th class="cl-1c55dc66"><p class="cl-1c55673f"><span class="cl-1c4d0425">Comparison</span></p></th>
<th class="cl-1c55dc66"><p class="cl-1c55673f"><span class="cl-1c4d0424">df</span></p></th>
<th class="cl-1c55dc66"><p class="cl-1c55673f"><span class="cl-1c4d0424">t</span></p></th>
<th class="cl-1c55dc66"><p class="cl-1c55673f"><span class="cl-1c4d0424">p</span></p></th>
<th class="cl-1c55dc66"><p class="cl-1c55673f"><span class="cl-1c4d0424">d</span></p></th>
<th class="cl-1c55dc66"><p class="cl-1c55673f"><span class="cl-1c4d0425">95% CI</span></p></th>
</tr>
</thead>
<tbody>
<tr style="overflow-wrap:break-word;">
<td rowspan="3" class="cl-1c55dc67"><p class="cl-1c55673e"><span class="cl-1c4d0422">Peripheral Responsivity (QCAE)</span></p></td>
<td class="cl-1c55dc68"><p class="cl-1c55673f"><span class="cl-1c4d0422">Embodied - Control</span></p></td>
<td class="cl-1c55dc68"><p class="cl-1c55673f"><span class="cl-1c4d0422">87</span></p></td>
<td class="cl-1c55dc68"><p class="cl-1c55673f"><span class="cl-1c4d0422">2.20</span></p></td>
<td class="cl-1c55dc68"><p class="cl-1c55673f"><span class="cl-1c4d0422">.031*</span></p></td>
<td class="cl-1c55dc68"><p class="cl-1c55673f"><span class="cl-1c4d0422">0.57</span></p></td>
<td class="cl-1c55dc68"><p class="cl-1c55673f"><span class="cl-1c4d0422">[0.01, 1.09]</span></p></td>
</tr>
<tr style="overflow-wrap:break-word;">
<td class="cl-1c55dc6a"><p class="cl-1c55673f"><span class="cl-1c4d0425">Mental - Control</span></p></td>
<td class="cl-1c55dc6a"><p class="cl-1c55673f"><span class="cl-1c4d0425">87</span></p></td>
<td class="cl-1c55dc6a"><p class="cl-1c55673f"><span class="cl-1c4d0425">0.24</span></p></td>
<td class="cl-1c55dc6a"><p class="cl-1c55673f"><span class="cl-1c4d0425">.813</span></p></td>
<td class="cl-1c55dc6a"><p class="cl-1c55673f"><span class="cl-1c4d0425">0.06</span></p></td>
<td class="cl-1c55dc6a"><p class="cl-1c55673f"><span class="cl-1c4d0425">[-0.52, 0.56]</span></p></td>
</tr>
<tr style="overflow-wrap:break-word;">
<td class="cl-1c55dc6c"><p class="cl-1c55673f"><span class="cl-1c4d0425">Embodied - Mental</span></p></td>
<td class="cl-1c55dc6c"><p class="cl-1c55673f"><span class="cl-1c4d0425">87</span></p></td>
<td class="cl-1c55dc6c"><p class="cl-1c55673f"><span class="cl-1c4d0425">1.96</span></p></td>
<td class="cl-1c55dc6c"><p class="cl-1c55673f"><span class="cl-1c4d0425">.053</span></p></td>
<td class="cl-1c55dc6c"><p class="cl-1c55673f"><span class="cl-1c4d0425">0.51</span></p></td>
<td class="cl-1c55dc6c"><p class="cl-1c55673f"><span class="cl-1c4d0425">[0.02, 0.97]</span></p></td>
</tr>
<tr style="overflow-wrap:break-word;">
<td rowspan="3" class="cl-1c55dc6d"><p class="cl-1c55673e"><span class="cl-1c4d0425">Perspective-Taking (IRI)</span></p></td>
<td class="cl-1c55dc6e"><p class="cl-1c55673f"><span class="cl-1c4d0425">Embodied - Control</span></p></td>
<td class="cl-1c55dc6e"><p class="cl-1c55673f"><span class="cl-1c4d0425">86</span></p></td>
<td class="cl-1c55dc6e"><p class="cl-1c55673f"><span class="cl-1c4d0425">0.12</span></p></td>
<td class="cl-1c55dc6e"><p class="cl-1c55673f"><span class="cl-1c4d0425">.903</span></p></td>
<td class="cl-1c55dc6e"><p class="cl-1c55673f"><span class="cl-1c4d0425">0.03</span></p></td>
<td class="cl-1c55dc6e"><p class="cl-1c55673f"><span class="cl-1c4d0425">[-0.52, 0.56]</span></p></td>
</tr>
<tr style="overflow-wrap:break-word;">
<td class="cl-1c55dc6a"><p class="cl-1c55673f"><span class="cl-1c4d0425">Mental - Control</span></p></td>
<td class="cl-1c55dc6a"><p class="cl-1c55673f"><span class="cl-1c4d0425">86</span></p></td>
<td class="cl-1c55dc6a"><p class="cl-1c55673f"><span class="cl-1c4d0425">0.02</span></p></td>
<td class="cl-1c55dc6a"><p class="cl-1c55673f"><span class="cl-1c4d0425">.985</span></p></td>
<td class="cl-1c55dc6a"><p class="cl-1c55673f"><span class="cl-1c4d0425">0.01</span></p></td>
<td class="cl-1c55dc6a"><p class="cl-1c55673f"><span class="cl-1c4d0425">[-0.51, 0.46]</span></p></td>
</tr>
<tr style="overflow-wrap:break-word;">
<td class="cl-1c55dc6c"><p class="cl-1c55673f"><span class="cl-1c4d0425">Embodied - Mental</span></p></td>
<td class="cl-1c55dc6c"><p class="cl-1c55673f"><span class="cl-1c4d0425">86</span></p></td>
<td class="cl-1c55dc6c"><p class="cl-1c55673f"><span class="cl-1c4d0425">0.10</span></p></td>
<td class="cl-1c55dc6c"><p class="cl-1c55673f"><span class="cl-1c4d0425">.919</span></p></td>
<td class="cl-1c55dc6c"><p class="cl-1c55673f"><span class="cl-1c4d0425">0.03</span></p></td>
<td class="cl-1c55dc6c"><p class="cl-1c55673f"><span class="cl-1c4d0425">[-0.50, 0.51]</span></p></td>
</tr>
<tr style="overflow-wrap:break-word;">
<td rowspan="3" class="cl-1c55dc6d"><p class="cl-1c55673e"><span class="cl-1c4d0425">Fantasy (IRI)</span></p></td>
<td class="cl-1c55dc6e"><p class="cl-1c55673f"><span class="cl-1c4d0425">Embodied - Control</span></p></td>
<td class="cl-1c55dc6e"><p class="cl-1c55673f"><span class="cl-1c4d0425">86</span></p></td>
<td class="cl-1c55dc6e"><p class="cl-1c55673f"><span class="cl-1c4d0425">0.15</span></p></td>
<td class="cl-1c55dc6e"><p class="cl-1c55673f"><span class="cl-1c4d0425">.880</span></p></td>
<td class="cl-1c55dc6e"><p class="cl-1c55673f"><span class="cl-1c4d0425">0.04</span></p></td>
<td class="cl-1c55dc6e"><p class="cl-1c55673f"><span class="cl-1c4d0425">[-0.48, 0.58]</span></p></td>
</tr>
<tr style="overflow-wrap:break-word;">
<td class="cl-1c55dc6a"><p class="cl-1c55673f"><span class="cl-1c4d0425">Mental - Control</span></p></td>
<td class="cl-1c55dc6a"><p class="cl-1c55673f"><span class="cl-1c4d0425">86</span></p></td>
<td class="cl-1c55dc6a"><p class="cl-1c55673f"><span class="cl-1c4d0425">-1.39</span></p></td>
<td class="cl-1c55dc6a"><p class="cl-1c55673f"><span class="cl-1c4d0425">.169</span></p></td>
<td class="cl-1c55dc6a"><p class="cl-1c55673f"><span class="cl-1c4d0425">-0.36</span></p></td>
<td class="cl-1c55dc6a"><p class="cl-1c55673f"><span class="cl-1c4d0425">[-0.91, 0.16]</span></p></td>
</tr>
<tr style="overflow-wrap:break-word;">
<td class="cl-1c55dc6c"><p class="cl-1c55673f"><span class="cl-1c4d0425">Embodied - Mental</span></p></td>
<td class="cl-1c55dc6c"><p class="cl-1c55673f"><span class="cl-1c4d0425">86</span></p></td>
<td class="cl-1c55dc6c"><p class="cl-1c55673f"><span class="cl-1c4d0425">1.54</span></p></td>
<td class="cl-1c55dc6c"><p class="cl-1c55673f"><span class="cl-1c4d0425">.128</span></p></td>
<td class="cl-1c55dc6c"><p class="cl-1c55673f"><span class="cl-1c4d0425">0.40</span></p></td>
<td class="cl-1c55dc6c"><p class="cl-1c55673f"><span class="cl-1c4d0425">[-0.12, 0.92]</span></p></td>
</tr>
<tr style="overflow-wrap:break-word;">
<td rowspan="3" class="cl-1c56036a"><p class="cl-1c55673e"><span class="cl-1c4d0422">Empathic Concern (IRI)</span></p></td>
<td class="cl-1c56036b"><p class="cl-1c55673f"><span class="cl-1c4d0422">Embodied - Control</span></p></td>
<td class="cl-1c56036b"><p class="cl-1c55673f"><span class="cl-1c4d0422">86</span></p></td>
<td class="cl-1c56036b"><p class="cl-1c55673f"><span class="cl-1c4d0422">2.30</span></p></td>
<td class="cl-1c56036b"><p class="cl-1c55673f"><span class="cl-1c4d0422">.024*</span></p></td>
<td class="cl-1c56036b"><p class="cl-1c55673f"><span class="cl-1c4d0422">0.59</span></p></td>
<td class="cl-1c56036b"><p class="cl-1c55673f"><span class="cl-1c4d0422">[0.08, 1.17]</span></p></td>
</tr>
<tr style="overflow-wrap:break-word;">
<td class="cl-1c55dc6a"><p class="cl-1c55673f"><span class="cl-1c4d0425">Mental - Control</span></p></td>
<td class="cl-1c55dc6a"><p class="cl-1c55673f"><span class="cl-1c4d0425">86</span></p></td>
<td class="cl-1c55dc6a"><p class="cl-1c55673f"><span class="cl-1c4d0425">1.45</span></p></td>
<td class="cl-1c55dc6a"><p class="cl-1c55673f"><span class="cl-1c4d0425">.151</span></p></td>
<td class="cl-1c55dc6a"><p class="cl-1c55673f"><span class="cl-1c4d0425">0.38</span></p></td>
<td class="cl-1c55dc6a"><p class="cl-1c55673f"><span class="cl-1c4d0425">[-0.15, 0.92]</span></p></td>
</tr>
<tr style="overflow-wrap:break-word;">
<td class="cl-1c55dc6c"><p class="cl-1c55673f"><span class="cl-1c4d0425">Embodied - Mental</span></p></td>
<td class="cl-1c55dc6c"><p class="cl-1c55673f"><span class="cl-1c4d0425">86</span></p></td>
<td class="cl-1c55dc6c"><p class="cl-1c55673f"><span class="cl-1c4d0425">0.83</span></p></td>
<td class="cl-1c55dc6c"><p class="cl-1c55673f"><span class="cl-1c4d0425">.407</span></p></td>
<td class="cl-1c55dc6c"><p class="cl-1c55673f"><span class="cl-1c4d0425">0.22</span></p></td>
<td class="cl-1c55dc6c"><p class="cl-1c55673f"><span class="cl-1c4d0425">[-0.30, 0.68]</span></p></td>
</tr>
<tr style="overflow-wrap:break-word;">
<td rowspan="3" class="cl-1c56036a"><p class="cl-1c55673e"><span class="cl-1c4d0422">Personal Distress (IRI)</span></p></td>
<td class="cl-1c56036b"><p class="cl-1c55673f"><span class="cl-1c4d0422">Embodied - Control</span></p></td>
<td class="cl-1c56036b"><p class="cl-1c55673f"><span class="cl-1c4d0422">86</span></p></td>
<td class="cl-1c56036b"><p class="cl-1c55673f"><span class="cl-1c4d0422">2.13</span></p></td>
<td class="cl-1c56036b"><p class="cl-1c55673f"><span class="cl-1c4d0422">.036*</span></p></td>
<td class="cl-1c56036b"><p class="cl-1c55673f"><span class="cl-1c4d0422">0.55</span></p></td>
<td class="cl-1c56036b"><p class="cl-1c55673f"><span class="cl-1c4d0422">[0.03, 1.04]</span></p></td>
</tr>
<tr style="overflow-wrap:break-word;">
<td class="cl-1c55dc6a"><p class="cl-1c55673f"><span class="cl-1c4d0425">Mental - Control</span></p></td>
<td class="cl-1c55dc6a"><p class="cl-1c55673f"><span class="cl-1c4d0425">86</span></p></td>
<td class="cl-1c55dc6a"><p class="cl-1c55673f"><span class="cl-1c4d0425">0.86</span></p></td>
<td class="cl-1c55dc6a"><p class="cl-1c55673f"><span class="cl-1c4d0425">.393</span></p></td>
<td class="cl-1c55dc6a"><p class="cl-1c55673f"><span class="cl-1c4d0425">0.22</span></p></td>
<td class="cl-1c55dc6a"><p class="cl-1c55673f"><span class="cl-1c4d0425">[-0.26, 0.70]</span></p></td>
</tr>
<tr style="overflow-wrap:break-word;">
<td class="cl-1c55dc6c"><p class="cl-1c55673f"><span class="cl-1c4d0425">Embodied - Mental</span></p></td>
<td class="cl-1c55dc6c"><p class="cl-1c55673f"><span class="cl-1c4d0425">86</span></p></td>
<td class="cl-1c55dc6c"><p class="cl-1c55673f"><span class="cl-1c4d0425">1.25</span></p></td>
<td class="cl-1c55dc6c"><p class="cl-1c55673f"><span class="cl-1c4d0425">.213</span></p></td>
<td class="cl-1c55dc6c"><p class="cl-1c55673f"><span class="cl-1c4d0425">0.33</span></p></td>
<td class="cl-1c55dc6c"><p class="cl-1c55673f"><span class="cl-1c4d0425">[-0.26, 0.86]</span></p></td>
</tr>
<tr style="overflow-wrap:break-word;">
<td rowspan="3" class="cl-1c56036a"><p class="cl-1c55673e"><span class="cl-1c4d0422">Inclusion of Other in the Self (IOS)</span></p></td>
<td class="cl-1c56036b"><p class="cl-1c55673f"><span class="cl-1c4d0422">Embodied - Control</span></p></td>
<td class="cl-1c56036b"><p class="cl-1c55673f"><span class="cl-1c4d0422">87</span></p></td>
<td class="cl-1c56036b"><p class="cl-1c55673f"><span class="cl-1c4d0422">4.71</span></p></td>
<td class="cl-1c56036b"><p class="cl-1c55673f"><span class="cl-1c4d0422">&lt; .001***</span></p></td>
<td class="cl-1c56036b"><p class="cl-1c55673f"><span class="cl-1c4d0422">1.22</span></p></td>
<td class="cl-1c56036b"><p class="cl-1c55673f"><span class="cl-1c4d0422">[0.63, 1.78]</span></p></td>
</tr>
<tr style="overflow-wrap:break-word;">
<td class="cl-1c55dc68"><p class="cl-1c55673f"><span class="cl-1c4d0422">Mental - Control</span></p></td>
<td class="cl-1c55dc68"><p class="cl-1c55673f"><span class="cl-1c4d0422">87</span></p></td>
<td class="cl-1c55dc68"><p class="cl-1c55673f"><span class="cl-1c4d0422">2.12</span></p></td>
<td class="cl-1c55dc68"><p class="cl-1c55673f"><span class="cl-1c4d0422">.037*</span></p></td>
<td class="cl-1c55dc68"><p class="cl-1c55673f"><span class="cl-1c4d0422">0.55</span></p></td>
<td class="cl-1c55dc68"><p class="cl-1c55673f"><span class="cl-1c4d0422">[0.05, 1.06]</span></p></td>
</tr>
<tr style="overflow-wrap:break-word;">
<td class="cl-1c56036d"><p class="cl-1c55673f"><span class="cl-1c4d0422">Embodied - Mental</span></p></td>
<td class="cl-1c56036d"><p class="cl-1c55673f"><span class="cl-1c4d0422">87</span></p></td>
<td class="cl-1c56036d"><p class="cl-1c55673f"><span class="cl-1c4d0422">2.58</span></p></td>
<td class="cl-1c56036d"><p class="cl-1c55673f"><span class="cl-1c4d0422">.011*</span></p></td>
<td class="cl-1c56036d"><p class="cl-1c55673f"><span class="cl-1c4d0422">0.67</span></p></td>
<td class="cl-1c56036d"><p class="cl-1c55673f"><span class="cl-1c4d0422">[0.12, 1.24]</span></p></td>
</tr>
</tbody>
<tfoot><tr style="overflow-wrap:break-word;"><td colspan="7" class="cl-1c56036e"><p class="cl-1c556740"><span class="cl-1c4d0424">Note. </span><span class="cl-1c4d0425">ùëë·¥ø = robust Cohen‚Äôs ùëë; CI = bootstrapped confidence interval. The comparisons were between-groups only (i.e., there were no within-subject pre/post comparisons). One participant did not complete the Interpersonal Reactivity Index. Bold/Grey background values represent statistically significant differences between the groups on that row and variable.</span></p></td></tr></tfoot>
</table>
</div>
<p><strong>Save the table to Word</strong></p>
<div class="sourceCode" id="cb17"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu">flextable</span><span class="fu">::</span><span class="fu"><a href="https://davidgohel.github.io/flextable/reference/save_as_docx.html" class="external-link">save_as_docx</a></span><span class="op">(</span><span class="va">my_table</span>, path <span class="op">=</span> <span class="st">"contrasts.docx"</span><span class="op">)</span></span></code></pre></div>
</div>
<div class="section level3">
<h3 id="make-violin-plots-comparing-groups-through-nice_violin-">Make violin plots comparing groups through <a href="../articles/violin.html"><code>nice_violin</code></a>.<a class="anchor" aria-label="anchor" href="#make-violin-plots-comparing-groups-through-nice_violin-"></a>
</h3>
<p>We will have to make the four figures for which comparisons were
significant and then combine them in one plot.</p>
<p>This function will throw an error if your dataset contains missing
data. We will omit those rows missing data for now.</p>
<div class="sourceCode" id="cb18"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">Data</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/stats/na.fail.html" class="external-link">na.omit</a></span><span class="op">(</span><span class="va">data</span><span class="op">)</span></span></code></pre></div>
<p><strong>Make figure panel 1</strong></p>
<div class="sourceCode" id="cb19"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="op">(</span><span class="va">EC</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/nice_violin.html">nice_violin</a></span><span class="op">(</span>group <span class="op">=</span> <span class="st">"Group"</span>,</span>
<span>                   response <span class="op">=</span> <span class="st">"IRIEC"</span>, </span>
<span>                   data <span class="op">=</span> <span class="va">Data</span>,</span>
<span>                   colours <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"#00BA38"</span>, <span class="st">"#619CFF"</span>, <span class="st">"#F8766D"</span><span class="op">)</span>, </span>
<span>                   ytitle <span class="op">=</span> <span class="st">"Empathic Concern (from IRI)"</span>, </span>
<span>                   signif_annotation <span class="op">=</span> <span class="st">"*"</span>, </span>
<span>                   signif_yposition <span class="op">=</span> <span class="fl">5.2</span>, </span>
<span>                   signif_xmin <span class="op">=</span> <span class="fl">1</span>, </span>
<span>                   signif_xmax <span class="op">=</span> <span class="fl">3</span><span class="op">)</span><span class="op">)</span></span></code></pre></div>
<p><img src="contrasts_files/figure-html/unnamed-chunk-16-1.png" width="70%"></p>
<p><strong>Make figure panel 2</strong></p>
<div class="sourceCode" id="cb20"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="op">(</span><span class="va">PD</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/nice_violin.html">nice_violin</a></span><span class="op">(</span>group <span class="op">=</span> <span class="st">"Group"</span>, </span>
<span>                   response <span class="op">=</span> <span class="st">"IRIPD"</span>, </span>
<span>                   data <span class="op">=</span> <span class="va">Data</span>,</span>
<span>                   colours <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"#00BA38"</span>, <span class="st">"#619CFF"</span>, <span class="st">"#F8766D"</span><span class="op">)</span>, </span>
<span>                   ytitle <span class="op">=</span> <span class="st">"Personal Distress (from IRI)"</span>, </span>
<span>                   signif_annotation <span class="op">=</span> <span class="st">"*"</span>, </span>
<span>                   signif_yposition <span class="op">=</span> <span class="fl">5</span>, </span>
<span>                   signif_xmin <span class="op">=</span> <span class="fl">1</span>,</span>
<span>                   signif_xmax <span class="op">=</span> <span class="fl">3</span><span class="op">)</span><span class="op">)</span></span></code></pre></div>
<p><img src="contrasts_files/figure-html/unnamed-chunk-17-1.png" width="70%"></p>
<p><strong>Make figure panel 3</strong></p>
<div class="sourceCode" id="cb21"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="op">(</span><span class="va">PR</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/nice_violin.html">nice_violin</a></span><span class="op">(</span>group <span class="op">=</span> <span class="st">"Group"</span>, </span>
<span>                   response <span class="op">=</span> <span class="st">"QCAEPR"</span>, </span>
<span>                   data <span class="op">=</span> <span class="va">Data</span>,</span>
<span>                   colours <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"#00BA38"</span>, <span class="st">"#619CFF"</span>, <span class="st">"#F8766D"</span><span class="op">)</span>, </span>
<span>                   ytitle <span class="op">=</span> <span class="st">"Peripheral Responsivity (from QCAE)"</span>, </span>
<span>                   signif_annotation<span class="op">=</span><span class="st">"*"</span>,</span>
<span>                   signif_yposition<span class="op">=</span><span class="fl">4.2</span>,</span>
<span>                   signif_xmin<span class="op">=</span><span class="fl">1</span>,</span>
<span>                   signif_xmax<span class="op">=</span><span class="fl">3</span><span class="op">)</span><span class="op">)</span></span></code></pre></div>
<p><img src="contrasts_files/figure-html/unnamed-chunk-18-1.png" width="70%"></p>
<p><strong>Make figure panel 4</strong></p>
<div class="sourceCode" id="cb22"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="op">(</span><span class="va">IOS</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/nice_violin.html">nice_violin</a></span><span class="op">(</span>group <span class="op">=</span> <span class="st">"Group"</span>, </span>
<span>                    response <span class="op">=</span> <span class="st">"IOS"</span>, </span>
<span>                    data <span class="op">=</span> <span class="va">Data</span>,</span>
<span>                    colours <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"#00BA38"</span>, <span class="st">"#619CFF"</span>, <span class="st">"#F8766D"</span><span class="op">)</span>, </span>
<span>                    ytitle <span class="op">=</span> <span class="st">"Self-Other Merging (from IOS)"</span>, </span>
<span>                    signif_annotation<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"***"</span>, <span class="st">"*"</span>, <span class="st">"*"</span><span class="op">)</span>,</span>
<span>                    signif_yposition<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">8.25</span>, <span class="fl">7.5</span>, <span class="fl">6.75</span><span class="op">)</span>,</span>
<span>                    signif_xmin<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">1</span>,<span class="fl">1</span>,<span class="fl">2</span><span class="op">)</span>,</span>
<span>                    signif_xmax<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">3</span>,<span class="fl">2</span>,<span class="fl">3</span><span class="op">)</span><span class="op">)</span><span class="op">)</span></span></code></pre></div>
<p><img src="contrasts_files/figure-html/unnamed-chunk-19-1.png" width="70%"></p>
<p>It‚Äôs now time to combine our four plots into one figure! Yeah!</p>
<div class="sourceCode" id="cb23"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://rpkgs.datanovia.com/ggpubr/" class="external-link">ggpubr</a></span><span class="op">)</span></span>
<span><span class="op">(</span><span class="va">figure</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rpkgs.datanovia.com/ggpubr/reference/ggarrange.html" class="external-link">ggarrange</a></span><span class="op">(</span><span class="va">EC</span>, <span class="va">PD</span>, <span class="va">PR</span>, <span class="va">IOS</span>,</span>
<span>                     labels <span class="op">=</span> <span class="st">"AUTO"</span>,</span>
<span>                     ncol <span class="op">=</span> <span class="fl">2</span>, nrow <span class="op">=</span> <span class="fl">2</span><span class="op">)</span><span class="op">)</span></span></code></pre></div>
<p><img src="contrasts_files/figure-html/unnamed-chunk-20-1.png" width="100%"></p>
<p>Let‚Äôs save a high-resolution/vector version of this figure in PDF (it
could be .png or any other format too if necessary).</p>
<div class="sourceCode" id="cb24"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu">ggplot2</span><span class="fu">::</span><span class="fu"><a href="https://ggplot2.tidyverse.org/reference/ggsave.html" class="external-link">ggsave</a></span><span class="op">(</span><span class="st">'Figure 1.pdf'</span>, <span class="va">figure</span>, width <span class="op">=</span> <span class="fl">14</span>, height <span class="op">=</span> <span class="fl">14</span>, </span>
<span>                unit <span class="op">=</span> <span class="st">'in'</span>, dpi <span class="op">=</span> <span class="fl">300</span><span class="op">)</span></span></code></pre></div>
</div>
<div class="section level3">
<h3 id="thanks-for-checking-in">Thanks for checking in<a class="anchor" aria-label="anchor" href="#thanks-for-checking-in"></a>
</h3>
<p>Make sure to check out this page again if you use the code after a
time or if you encounter errors, as I periodically update or improve the
code. Feel free to contact me for comments, questions, or requests to
improve this function at <a href="https://github.com/rempsyc/rempsyc/issues" class="external-link">https://github.com/rempsyc/rempsyc/issues</a>.
See all tutorials here: <a href="https://remi-theriault.com/tutorials" class="external-link">https://remi-theriault.com/tutorials</a>.</p>
</div>
</div>
  </main><aside class="col-md-3"><nav id="toc"><h2>On this page</h2>
    </nav></aside>
</div>



    <footer><div class="pkgdown-footer-left">
  <p></p>
<p>Developed by <a href="https://remi-theriault.com" class="external-link">R√©mi Th√©riault</a>.</p>
</div>

<div class="pkgdown-footer-right">
  <p></p>
<p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.7.9000.</p>
</div>

    </footer>
</div>

  

  

  </body>
</html>
