Skip to content

Commit

Permalink
Deploying to gh-pages from @ 0c38128 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
3mmaRand committed Mar 10, 2024
1 parent ae9e466 commit fff41ba
Show file tree
Hide file tree
Showing 32 changed files with 207 additions and 42 deletions.
Binary file modified pgt52m/week-4/workshop_files/figure-html/unnamed-chunk-10-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pgt52m/week-4/workshop_files/figure-html/unnamed-chunk-11-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pgt52m/week-4/workshop_files/figure-html/unnamed-chunk-12-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pgt52m/week-4/workshop_files/figure-html/unnamed-chunk-5-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pgt52m/week-4/workshop_files/figure-html/unnamed-chunk-7-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pgt52m/week-4/workshop_files/figure-html/unnamed-chunk-8-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pgt52m/week-4/workshop_files/figure-html/unnamed-chunk-9-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pgt52m/week-7/workshop_files/figure-html/unnamed-chunk-11-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pgt52m/week-7/workshop_files/figure-html/unnamed-chunk-12-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pgt52m/week-8/workshop_files/figure-html/unnamed-chunk-13-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified r4babs1/week-9/workshop_files/figure-html/unnamed-chunk-10-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified r4babs1/week-9/workshop_files/figure-html/unnamed-chunk-11-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified r4babs1/week-9/workshop_files/figure-html/unnamed-chunk-12-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified r4babs1/week-9/workshop_files/figure-html/unnamed-chunk-5-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified r4babs1/week-9/workshop_files/figure-html/unnamed-chunk-7-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified r4babs1/week-9/workshop_files/figure-html/unnamed-chunk-8-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified r4babs1/week-9/workshop_files/figure-html/unnamed-chunk-9-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified r4babs2/week-3/workshop_files/figure-html/unnamed-chunk-11-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified r4babs2/week-3/workshop_files/figure-html/unnamed-chunk-12-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified r4babs2/week-4/workshop_files/figure-html/unnamed-chunk-13-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified r4babs2/week-5/workshop_files/figure-html/unnamed-chunk-16-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified r4babs2/week-5/workshop_files/figure-html/unnamed-chunk-17-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified r4babs2/week-5/workshop_files/figure-html/unnamed-chunk-18-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified r4babs2/week-5/workshop_files/figure-html/unnamed-chunk-19-1.png
Binary file modified r4babs2/week-5/workshop_files/figure-html/unnamed-chunk-20-1.png
124 changes: 124 additions & 0 deletions r4babs2/week-6/data-raw/slugs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
colour pop
black x
black x
black x
black x
black x
black x
black x
black x
black x
black x
black x
black x
black x
black x
black x
black x
black x
black x
black x
black x
black x
black x
black x
black x
black x
black x
black x
black y
black y
black y
black y
black y
black y
black y
black y
black y
black y
black y
black y
black y
black y
black y
black y
black y
black y
black y
black y
black y
black y
black y
black y
black y
black y
black y
black y
black y
black y
black y
black y
black y
black y
black y
black y
black y
black y
black y
brown x
brown x
brown x
brown x
brown x
brown x
brown x
brown x
brown x
brown x
brown x
brown x
brown x
brown x
brown x
brown x
brown x
brown y
brown y
brown y
brown y
brown y
brown y
brown y
brown y
brown y
brown y
red x
red x
red x
red x
red x
red x
red x
red x
red x
red y
red y
red y
red y
red y
red y
red y
red y
red y
red y
red y
red y
red y
red y
red y
red y
red y
red y
red y
red y
red y
14 changes: 9 additions & 5 deletions r4babs2/week-6/overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -429,13 +429,14 @@ <h1 class="title">Overview</h1>
</header>


<p>Congratulations on making it to the end of the stage 1 Data Analysis in R teaching!</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="images/code-hero.gif" class="img-fluid figure-img" width="600"></p>
<figcaption>Artwork by <span class="citation" data-cites="allison_horst">Horst (<a href="#ref-allison_horst" role="doc-biblioref">2023</a>)</span>:</figcaption>
</figure>
</div>
<p>This week you will</p>
<p>This week you will learn how to test whether there is an association between two categorical variables using the chi-squared contingency test and how to test whether there is an association between two continuous variables using the correlation test.</p>
<section id="learning-objectives" class="level3">
<h3 class="anchored" data-anchor-id="learning-objectives">Learning objectives</h3>
<p>The successful student will be able to:</p>
Expand All @@ -456,13 +457,16 @@ <h3 class="anchored" data-anchor-id="instructions">Instructions</h3>
</ol></li>
<li><p><a href="../../r4babs2/week-6/workshop.html">Workshop</a></p>
<ol type="i">
<li>💻 Test whether there is an association between the heights of sibling pairs</li>
<li>💻 Test whether there is an association between blood type and peptic ulcers</li>
<li>💻 Test whether there is an association between the heights of sibling pairs.</li>
<li>💻 Learn about the effect of sample size on correlation</li>
<li>💻 Apply the Spearman rank correlation test to the heights of sibling pairs.</li>
<li>💻 Test whether there is an association between blood type and peptic ulcers.</li>
<li>💻 Repeat iv. using untabulated data.</li>
</ol></li>
<li><p><a href="../../r4babs2/week-6/study_after_workshop.html">Consolidate</a></p>
<ol type="i">
<li>💻 Test whether there the proportion of slug colour morphs is the same in two populations</li>
<li>💻 Test whether there is an association between …..</li>
<li>💻 Test whether there the proportion of slug colour morphs is the same in two populations.</li>
<li>💻 Repeat i. using untabulated data.</li>
</ol></li>
</ol>

Expand Down
51 changes: 48 additions & 3 deletions r4babs2/week-6/study_after_workshop.html
Original file line number Diff line number Diff line change
Expand Up @@ -420,12 +420,57 @@ <h1 class="title">Independent Study to consolidate this week</h1>
</div>
</section><section id="exercises" class="level1"><h1>Exercises</h1>
<ol type="1">
<li>💻</li>
<li>💻 The slug <em>Arion ater</em> has three major colour forms, black, chocolate brown and red. Sampling in population X revealed 27 black, 17 brown and 9 red individuals, whereas in population Y the corresponding numbers were 39, 10 and 21. Create an appropriate data structure and test whether the proportion of black, brown and red slugs differs between the two populations.</li>
</ol>
<div class="cell">
<details class="code-fold"><summary>Answer - don’t look until you have tried!</summary><div class="sourceCode" id="cb2"><pre class="downlit sourceCode r code-with-copy"><code class="sourceCode R"><span><span class="co"># names for the rows and columns</span></span>
<span><span class="va">vars</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span>pop <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="st">"x"</span>,<span class="st">"y"</span><span class="op">)</span>, </span>
<span> colour <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="st">"black"</span>, <span class="st">"brown"</span>, <span class="st">"red"</span><span class="op">)</span><span class="op">)</span></span>
<span></span>
<span><span class="co"># matrix of the data with named columns and rows</span></span>
<span><span class="va">slugs</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/matrix.html">matrix</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="fl">27</span>, <span class="fl">39</span>, <span class="fl">17</span>, <span class="fl">10</span>, <span class="fl">9</span>, <span class="fl">21</span><span class="op">)</span>, </span>
<span> nrow <span class="op">=</span> <span class="fl">2</span>, dimnames <span class="op">=</span> <span class="va">vars</span><span class="op">)</span></span>
<span><span class="va">slugs</span></span>
<span><span class="co"># gives me</span></span>
<span><span class="co"># colour</span></span>
<span><span class="co"># pop black brown red</span></span>
<span><span class="co"># x 27 17 9</span></span>
<span><span class="co"># y 39 10 21</span></span>
<span></span>
<span><span class="co"># you may need to try a couple of times to get the numbers in </span></span>
<span><span class="co"># the right places</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
</div>
<div class="cell">
<details class="code-fold"><summary>Answer - don’t look until you have tried!</summary><div class="sourceCode" id="cb3"><pre class="downlit sourceCode r code-with-copy"><code class="sourceCode R"><span><span class="fu"><a href="https://rdrr.io/r/stats/chisq.test.html">chisq.test</a></span><span class="op">(</span><span class="va">slugs</span><span class="op">)</span></span>
<span><span class="co"># X-squared = 6.5726, df = 2, p-value = 0.03739</span></span>
<span></span>
<span><span class="co"># p &lt; 0.05 so we reject the null hypothesis i.e., the proportions of the colour </span></span>
<span><span class="co"># forms are significantly different in the two populations </span></span>
<span><span class="co"># (mostly as a result of differences in the brown and red classes - </span></span>
<span><span class="co"># look at the differences between observed and expected values for </span></span>
<span><span class="co"># the three colour forms in the table above).</span></span>
<span><span class="fu"><a href="https://rdrr.io/r/stats/chisq.test.html">chisq.test</a></span><span class="op">(</span><span class="va">slugs</span><span class="op">)</span><span class="op">$</span><span class="va">expected</span></span>
<span><span class="co"># colour</span></span>
<span><span class="co"># pop black brown red</span></span>
<span><span class="co"># x 28.43902 11.63415 12.92683</span></span>
<span><span class="co"># y 37.56098 15.36585 17.07317</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
</div>
<ol start="2" type="1">
<li>📖 Read <a href="https://3mmarand.github.io/comp4biosci/xxx.html">xxx</a>
</li>
<li>💻 The raw, untabulated data are in <a href="data-raw/slugs.txt">slugs.txt</a>. Perform the test on these data.</li>
</ol>
<div class="cell">
<details class="code-fold"><summary>Answer - don’t look until you have tried!</summary><div class="sourceCode" id="cb4"><pre class="downlit sourceCode r code-with-copy"><code class="sourceCode R"><span><span class="co"># import the data</span></span>
<span><span class="va">slugs</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://readr.tidyverse.org/reference/read_table.html">read_table</a></span><span class="op">(</span><span class="st">"data-raw/slugs.txt"</span><span class="op">)</span></span>
<span></span>
<span><span class="co"># put it into a table</span></span>
<span><span class="va">slugtab</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/table.html">table</a></span><span class="op">(</span><span class="va">slugs</span><span class="op">$</span><span class="va">colour</span>, <span class="va">slugs</span><span class="op">$</span><span class="va">pop</span><span class="op">)</span></span>
<span></span>
<span><span class="co"># carry out the test</span></span>
<span><span class="fu"><a href="https://rdrr.io/r/stats/chisq.test.html">chisq.test</a></span><span class="op">(</span><span class="va">slugtab</span><span class="op">)</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
</div>


</section></main><!-- /main --><script id="quarto-html-after-body" type="application/javascript">
Expand Down
Loading

0 comments on commit fff41ba

Please sign in to comment.