<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://bridgeslab.sph.umich.edu/protocols/index.php?action=history&amp;feed=atom&amp;title=General_Statistics</id>
	<title>General Statistics - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://bridgeslab.sph.umich.edu/protocols/index.php?action=history&amp;feed=atom&amp;title=General_Statistics"/>
	<link rel="alternate" type="text/html" href="https://bridgeslab.sph.umich.edu/protocols/index.php?title=General_Statistics&amp;action=history"/>
	<updated>2026-05-31T23:47:00Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://bridgeslab.sph.umich.edu/protocols/index.php?title=General_Statistics&amp;diff=2703&amp;oldid=prev</id>
		<title>Davebrid: Fixed tags on this page</title>
		<link rel="alternate" type="text/html" href="https://bridgeslab.sph.umich.edu/protocols/index.php?title=General_Statistics&amp;diff=2703&amp;oldid=prev"/>
		<updated>2024-10-16T00:12:48Z</updated>

		<summary type="html">&lt;p&gt;Fixed tags on this page&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:12, 16 October 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;div class=&quot;cell&quot;&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[ Category&lt;/ins&gt;: &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;General ]]	&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[ Category&lt;/ins&gt;: &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Data ]]	&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;syntaxhighlight lang=&quot;r&quot;&amp;gt;library(knitr)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[ Category&lt;/ins&gt;: &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Statistics ]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;#figures makde will go to directory called figures, will make them as both png and pdf files &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;opts_chunk$set(fig.path=&#039;figures/&#039;,dev=c(&#039;png&#039;,&#039;pdf&#039;))&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;options(scipen = 2, digits = 3)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# set echo and message to TRUE if you want to display code blocks and code output respectively&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;knitr::knit_hooks$set(inline = function(x) {&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;  knitr:::format_sci(x, &#039;md&#039;)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;})&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;superpose.eb &amp;lt;- function (x, y, ebl, ebu = ebl, length = 0.08, ...)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;  arrows(x, y + ebu, x, y - ebl, angle = 90, code = 3,&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;  length = length, ...)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;  &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;se &amp;lt;- function(x) sd(x, na.rm=T)/sqrt(length(x))&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;#load these packages, nearly always needed&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;library(tidyr)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;library(dplyr)&amp;lt;/syntaxhighlight&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;div class=&quot;cell-output cell-output-stderr&quot;&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;pre&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Attaching package&lt;/del&gt;: &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;dplyr&#039;&amp;lt;/pre&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;div class=&quot;cell-output cell-output-stderr&quot;&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;pre&amp;gt;The following objects are masked from &#039;package:stats&#039;&lt;/del&gt;:&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    filter, lag&amp;lt;/pre&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;div class=&quot;cell-output cell-output-stderr&quot;&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;pre&amp;gt;The following objects are masked from &#039;package&lt;/del&gt;:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;base&#039;:&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    intersect, setdiff, setequal, union&amp;lt;/pre&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;syntaxhighlight lang=&quot;r&quot;&amp;gt;# sets maize and blue color scheme&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;color.scheme &amp;lt;- c(&#039;#00274c&#039;, &#039;#ffcb05&#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;span id=&quot;general-statistical-methods&quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= General Statistical Methods =&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= General Statistical Methods =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key bridgeslabproto-mw_:diff:1.41:old-2702:rev-2703:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Davebrid</name></author>
	</entry>
	<entry>
		<id>https://bridgeslab.sph.umich.edu/protocols/index.php?title=General_Statistics&amp;diff=2702&amp;oldid=prev</id>
		<title>Davebrid: Updated general statistics wiki page</title>
		<link rel="alternate" type="text/html" href="https://bridgeslab.sph.umich.edu/protocols/index.php?title=General_Statistics&amp;diff=2702&amp;oldid=prev"/>
		<updated>2024-10-16T00:10:30Z</updated>

		<summary type="html">&lt;p&gt;Updated general statistics wiki page&lt;/p&gt;
&lt;a href=&quot;https://bridgeslab.sph.umich.edu/protocols/index.php?title=General_Statistics&amp;amp;diff=2702&amp;amp;oldid=2697&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Davebrid</name></author>
	</entry>
	<entry>
		<id>https://bridgeslab.sph.umich.edu/protocols/index.php?title=General_Statistics&amp;diff=2697&amp;oldid=prev</id>
		<title>Davebrid: Updated to match github version</title>
		<link rel="alternate" type="text/html" href="https://bridgeslab.sph.umich.edu/protocols/index.php?title=General_Statistics&amp;diff=2697&amp;oldid=prev"/>
		<updated>2024-08-11T19:09:06Z</updated>

		<summary type="html">&lt;p&gt;Updated to match github version&lt;/p&gt;
&lt;a href=&quot;https://bridgeslab.sph.umich.edu/protocols/index.php?title=General_Statistics&amp;amp;diff=2697&amp;amp;oldid=1402&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Davebrid</name></author>
	</entry>
	<entry>
		<id>https://bridgeslab.sph.umich.edu/protocols/index.php?title=General_Statistics&amp;diff=1402&amp;oldid=prev</id>
		<title>Davebrid: copied from markdown converted mediawiki</title>
		<link rel="alternate" type="text/html" href="https://bridgeslab.sph.umich.edu/protocols/index.php?title=General_Statistics&amp;diff=1402&amp;oldid=prev"/>
		<updated>2017-12-11T02:11:39Z</updated>

		<summary type="html">&lt;p&gt;copied from markdown converted mediawiki&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= General Statistical Methods =&lt;br /&gt;
&lt;br /&gt;
There are several important concepts that we will adhere to in our group. These involve design considerations, execution considerations and analysis concerns.&lt;br /&gt;
&lt;br /&gt;
== Experimental Design ==&lt;br /&gt;
&lt;br /&gt;
Where possible, prior to performing an experiment or study perform a power analysis. This is mainly to determine the appropriate sample sizes. To do this, you need to know a few of things:&lt;br /&gt;
&lt;br /&gt;
* Either the sample size or the difference. The difference is provided in standard deviations. This means that you need to know the standard deviation of your measurement in question. It is a good idea to keep a log of these for your data, so that you can approximate what this is. If you hope to detect a correlation you will need to know the expected correlation coefficient.&lt;br /&gt;
* The desired false positive rate (normally 0.05). This is the rate at which you find a difference where there is none. This is also known as the type I error rate.&lt;br /&gt;
* The desired power (normally 0.8). This indicates that 80% of the time you will detect the effect if there is one. This is also known as 1 minus the false negative rate or 1 minus the Type II error rate.&lt;br /&gt;
&lt;br /&gt;
We use the R package &amp;#039;&amp;#039;&amp;#039;pwr&amp;#039;&amp;#039;&amp;#039; to do a power analysis (Champely, 2017). Here is an example:&lt;br /&gt;
&lt;br /&gt;
=== Pairwise Comparasons ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;require(pwr)&lt;br /&gt;
false.negative.rate &amp;amp;lt;- 0.05&lt;br /&gt;
statistical.power &amp;amp;lt;- 0.8&lt;br /&gt;
sd &amp;amp;lt;- 3.5 #this is calculated from known measurements&lt;br /&gt;
difference &amp;amp;lt;- 3  #you hope to detect a difference &lt;br /&gt;
pwr.t.test(d = difference, sig.level = false.negative.rate, power=statistical.power)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;## &lt;br /&gt;
##      Two-sample t test power calculation &lt;br /&gt;
## &lt;br /&gt;
##               n = 3.07&lt;br /&gt;
##               d = 3&lt;br /&gt;
##       sig.level = 0.05&lt;br /&gt;
##           power = 0.8&lt;br /&gt;
##     alternative = two.sided&lt;br /&gt;
## &lt;br /&gt;
## NOTE: n is number in *each* group&amp;lt;/pre&amp;gt;&lt;br /&gt;
This tells us that in order to see a difference of at least 3, with at standard devation of 3.5 we need at least &amp;#039;&amp;#039;&amp;#039;3&amp;#039;&amp;#039;&amp;#039; observations in each group.&lt;br /&gt;
&lt;br /&gt;
=== Correlations ===&lt;br /&gt;
&lt;br /&gt;
The following is an example for detecting a correlation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;require(pwr)&lt;br /&gt;
false.negative.rate &amp;amp;lt;- 0.05&lt;br /&gt;
statistical.power &amp;amp;lt;- 0.8&lt;br /&gt;
correlation.coefficient &amp;amp;lt;- 0.6 #note that this is the r, to get the R2 value you will have to square this result.&lt;br /&gt;
pwr.r.test(r = correlation.coefficient, sig.level = false.negative.rate, power=statistical.power)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;## &lt;br /&gt;
##      approximate correlation power calculation (arctangh transformation) &lt;br /&gt;
## &lt;br /&gt;
##               n = 18.6&lt;br /&gt;
##               r = 0.6&lt;br /&gt;
##       sig.level = 0.05&lt;br /&gt;
##           power = 0.8&lt;br /&gt;
##     alternative = two.sided&amp;lt;/pre&amp;gt;&lt;br /&gt;
This tells us that in order to detect a correlation coefficient of at least 0.6 (or an R^2 of 0.36) you need more than &amp;#039;&amp;#039;&amp;#039;18&amp;#039;&amp;#039;&amp;#039; observations.&lt;br /&gt;
&lt;br /&gt;
= Pairwise Testing =&lt;br /&gt;
&lt;br /&gt;
If you have two groups (and two groups only) that you want to know if they are different, you will normally want to do a pairwise test. This is &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; the case if you have paired data (before and after for example). The most common of these is something called a Student&amp;#039;s &amp;#039;&amp;#039;t&amp;#039;&amp;#039;-test, but this test has two key assumptions:&lt;br /&gt;
&lt;br /&gt;
* The data are normally distributed&lt;br /&gt;
* The two groups have equal variance&lt;br /&gt;
&lt;br /&gt;
== Testing the Assumptions ==&lt;br /&gt;
&lt;br /&gt;
Best practice is to first test for normality, and if that test passes, to then test for equal variance&lt;br /&gt;
&lt;br /&gt;
=== Testing Normality ===&lt;br /&gt;
&lt;br /&gt;
To test normality, we use a Shapiro-Wilk test (details on [https://en.wikipedia.org/wiki/Shapiro%E2%80%93Wilk_test Wikipedia] on each of your two groups). Below is an example where there are two groups:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;#create seed for reproducibility&lt;br /&gt;
set.seed(1265)&lt;br /&gt;
test.data &amp;amp;lt;- tibble(Treatment=c(rep(&amp;amp;quot;Experiment&amp;amp;quot;,6), rep(&amp;amp;quot;Control&amp;amp;quot;,6)),&lt;br /&gt;
           Result = rnorm(n=12, mean=10, sd=3))&lt;br /&gt;
#test.data$Treatment &amp;amp;lt;- as.factor(test.data$Treatment)&lt;br /&gt;
kable(test.data, caption=&amp;amp;quot;The test data used in the following examples&amp;amp;quot;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|+ The test data used in the following examples&lt;br /&gt;
! Treatment&lt;br /&gt;
!align=&amp;quot;right&amp;quot;| Result&lt;br /&gt;
|-&lt;br /&gt;
| Experiment&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 11.26&lt;br /&gt;
|-&lt;br /&gt;
| Experiment&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 8.33&lt;br /&gt;
|-&lt;br /&gt;
| Experiment&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 9.94&lt;br /&gt;
|-&lt;br /&gt;
| Experiment&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 11.83&lt;br /&gt;
|-&lt;br /&gt;
| Experiment&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 6.56&lt;br /&gt;
|-&lt;br /&gt;
| Experiment&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 11.41&lt;br /&gt;
|-&lt;br /&gt;
| Control&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 8.89&lt;br /&gt;
|-&lt;br /&gt;
| Control&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 11.59&lt;br /&gt;
|-&lt;br /&gt;
| Control&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 9.39&lt;br /&gt;
|-&lt;br /&gt;
| Control&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 8.74&lt;br /&gt;
|-&lt;br /&gt;
| Control&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 6.31&lt;br /&gt;
|-&lt;br /&gt;
| Control&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 7.82&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Each of the two groups, in this case &amp;#039;&amp;#039;&amp;#039;Test&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;Control&amp;#039;&amp;#039;&amp;#039; must have Shapiro-Wilk tests done separately. Some sample code for this is below (requires dplyr to be loaded):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;#filter only for the control data&lt;br /&gt;
control.data &amp;amp;lt;- filter(test.data, Treatment==&amp;amp;quot;Control&amp;amp;quot;)&lt;br /&gt;
#The broom package makes the results of the test appear in a table, with the tidy command&lt;br /&gt;
library(broom)&lt;br /&gt;
&lt;br /&gt;
#run the Shapiro-Wilk test on the values&lt;br /&gt;
shapiro.test(control.data$Result) %&amp;amp;gt;% tidy %&amp;amp;gt;% kable&amp;lt;/pre&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
!align=&amp;quot;right&amp;quot;| statistic&lt;br /&gt;
!align=&amp;quot;right&amp;quot;| p.value&lt;br /&gt;
! method&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 0.968&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 0.88&lt;br /&gt;
| Shapiro-Wilk normality test&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;experiment.data &amp;amp;lt;- filter(test.data, Treatment==&amp;amp;quot;Experiment&amp;amp;quot;)&lt;br /&gt;
shapiro.test(test.data$Result) %&amp;amp;gt;% tidy %&amp;amp;gt;% kable&amp;lt;/pre&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
!align=&amp;quot;right&amp;quot;| statistic&lt;br /&gt;
!align=&amp;quot;right&amp;quot;| p.value&lt;br /&gt;
! method&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 0.93&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 0.377&lt;br /&gt;
| Shapiro-Wilk normality test&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Based on these results, since both p-values are &amp;amp;gt;0.05 we do not reject the presumption of normality and can go on. If one or more of the p-values were less than 0.05 we would then use a Mann-Whitney test (also known as a Wilcoxon rank sum test) will be done, see below for more details.&lt;br /&gt;
&lt;br /&gt;
=== Testing for Equal Variance ===&lt;br /&gt;
&lt;br /&gt;
We generally use the [https://cran.r-project.org/web/packages/car/index.html car] package which contains code for [https://en.wikipedia.org/wiki/Levene%27s_test Levene&amp;#039;s Test] to see if two groups can be assumed to have equal variance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;#load the car package&lt;br /&gt;
library(car)&lt;br /&gt;
&lt;br /&gt;
#runs the test, grouping by the Treatment variable&lt;br /&gt;
leveneTest(Result ~ Treatment, data=test.data) %&amp;amp;gt;% tidy %&amp;amp;gt;% kable&amp;lt;/pre&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
! term&lt;br /&gt;
!align=&amp;quot;right&amp;quot;| df&lt;br /&gt;
!align=&amp;quot;right&amp;quot;| statistic&lt;br /&gt;
!align=&amp;quot;right&amp;quot;| p.value&lt;br /&gt;
|-&lt;br /&gt;
| group&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 1&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 0.368&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 0.558&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 10&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| NA&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| NA&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Performing the Appropriate Pairwise Test ==&lt;br /&gt;
&lt;br /&gt;
The logic to follow is:&lt;br /&gt;
&lt;br /&gt;
* If the Shapiro-Wilk test passes, do Levene&amp;#039;s test. If it fails for either group, move on to a &amp;#039;&amp;#039;&amp;#039;Wilcoxon Rank Sum Test&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* If Levene&amp;#039;s test &amp;#039;&amp;#039;passes&amp;#039;&amp;#039;, do a Student&amp;#039;s &amp;#039;&amp;#039;t&amp;#039;&amp;#039; Test, which assumes equal variance.&lt;br /&gt;
* If Levene&amp;#039;s test &amp;#039;&amp;#039;fails&amp;#039;&amp;#039;, do a Welch&amp;#039;s &amp;#039;&amp;#039;t&amp;#039;&amp;#039; Test, which does not assume equal variance.&lt;br /&gt;
&lt;br /&gt;
=== Student&amp;#039;s &amp;#039;&amp;#039;t&amp;#039;&amp;#039; Test ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;#The default for t.test in R is Welch&amp;#039;s, so you need to set the var.equal variable to be TRUE&lt;br /&gt;
t.test(Result~Treatment,data=test.data, var.equal=T) %&amp;amp;gt;% tidy %&amp;amp;gt;% kable&amp;lt;/pre&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
!align=&amp;quot;right&amp;quot;| estimate1&lt;br /&gt;
!align=&amp;quot;right&amp;quot;| estimate2&lt;br /&gt;
!align=&amp;quot;right&amp;quot;| statistic&lt;br /&gt;
!align=&amp;quot;right&amp;quot;| p.value&lt;br /&gt;
!align=&amp;quot;right&amp;quot;| parameter&lt;br /&gt;
!align=&amp;quot;right&amp;quot;| conf.low&lt;br /&gt;
!align=&amp;quot;right&amp;quot;| conf.high&lt;br /&gt;
! method&lt;br /&gt;
! alternative&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 8.79&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 9.89&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| -0.992&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 0.345&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 10&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| -3.56&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 1.37&lt;br /&gt;
| Two Sample t-test&lt;br /&gt;
| two.sided&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Welch&amp;#039;s &amp;#039;&amp;#039;t&amp;#039;&amp;#039; Test ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;#The default for t.test in R is Welch&amp;#039;s, so you need to set the var.equal variable to be FALSE, or leave the default&lt;br /&gt;
t.test(Result~Treatment,data=test.data, var.equal=F) %&amp;amp;gt;% tidy %&amp;amp;gt;% kable&amp;lt;/pre&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
!align=&amp;quot;right&amp;quot;| estimate&lt;br /&gt;
!align=&amp;quot;right&amp;quot;| estimate1&lt;br /&gt;
!align=&amp;quot;right&amp;quot;| estimate2&lt;br /&gt;
!align=&amp;quot;right&amp;quot;| statistic&lt;br /&gt;
!align=&amp;quot;right&amp;quot;| p.value&lt;br /&gt;
!align=&amp;quot;right&amp;quot;| parameter&lt;br /&gt;
!align=&amp;quot;right&amp;quot;| conf.low&lt;br /&gt;
!align=&amp;quot;right&amp;quot;| conf.high&lt;br /&gt;
! method&lt;br /&gt;
! alternative&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| -1.1&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 8.79&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 9.89&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| -0.992&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 0.345&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 9.72&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| -3.57&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 1.38&lt;br /&gt;
| Welch Two Sample t-test&lt;br /&gt;
| two.sided&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Wilcoxon Rank Sum Test ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;# no need to specify anything about variance&lt;br /&gt;
wilcox.test(Result~Treatment,data=test.data) %&amp;amp;gt;% tidy %&amp;amp;gt;% kable&amp;lt;/pre&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
!align=&amp;quot;right&amp;quot;| statistic&lt;br /&gt;
!align=&amp;quot;right&amp;quot;| p.value&lt;br /&gt;
! method&lt;br /&gt;
! alternative&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 12&lt;br /&gt;
|align=&amp;quot;right&amp;quot;| 0.394&lt;br /&gt;
| Wilcoxon rank sum test&lt;br /&gt;
| two.sided&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Corrections for Multiple Observations =&lt;br /&gt;
&lt;br /&gt;
The best illustration I have seen for the need for multiple observation corrections is this cartoon from XKCD (see http://xkcd.com/882/):&lt;br /&gt;
&lt;br /&gt;
[[File:http://imgs.xkcd.com/comics/significant.png|frame|none|alt=Significance by XKCD. Image is from http://imgs.xkcd.com/comics/significant.png|caption Significance by XKCD. Image is from http://imgs.xkcd.com/comics/significant.png]]&lt;br /&gt;
&lt;br /&gt;
Any conceptually coherent set of observations must therefore be corrected for multiple observations. In most cases, we will use the method of Benjamini and Hochberg since our p-values are not entirely independent. Some sample code for this is here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;p.values &amp;amp;lt;- c(0.023, 0.043, 0.056, 0.421, 0.012)&lt;br /&gt;
data.frame(unadjusted = p.values, adjusted=p.adjust(p.values, method=&amp;amp;quot;BH&amp;amp;quot;))&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;##   unadjusted adjusted&lt;br /&gt;
## 1      0.023   0.0575&lt;br /&gt;
## 2      0.043   0.0700&lt;br /&gt;
## 3      0.056   0.0700&lt;br /&gt;
## 4      0.421   0.4210&lt;br /&gt;
## 5      0.012   0.0575&amp;lt;/pre&amp;gt;&lt;br /&gt;
= Session Information =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;sessionInfo()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;## R version 3.4.2 (2017-09-28)&lt;br /&gt;
## Platform: x86_64-apple-darwin15.6.0 (64-bit)&lt;br /&gt;
## Running under: macOS High Sierra 10.13.1&lt;br /&gt;
## &lt;br /&gt;
## Matrix products: default&lt;br /&gt;
## BLAS: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRblas.0.dylib&lt;br /&gt;
## LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib&lt;br /&gt;
## &lt;br /&gt;
## locale:&lt;br /&gt;
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8&lt;br /&gt;
## &lt;br /&gt;
## attached base packages:&lt;br /&gt;
## [1] stats     graphics  grDevices utils     datasets  methods   base     &lt;br /&gt;
## &lt;br /&gt;
## other attached packages:&lt;br /&gt;
## [1] car_2.1-6           broom_0.4.3         bindrcpp_0.2       &lt;br /&gt;
## [4] pwr_1.2-1           knitcitations_1.0.9 dplyr_0.7.4        &lt;br /&gt;
## [7] tidyr_0.7.2         knitr_1.17         &lt;br /&gt;
## &lt;br /&gt;
## loaded via a namespace (and not attached):&lt;br /&gt;
##  [1] Rcpp_0.12.14       nloptr_1.0.4       compiler_3.4.2    &lt;br /&gt;
##  [4] plyr_1.8.4         highr_0.6          bindr_0.1         &lt;br /&gt;
##  [7] tools_3.4.2        lme4_1.1-14        digest_0.6.12     &lt;br /&gt;
## [10] jsonlite_1.5       lubridate_1.7.1    evaluate_0.10.1   &lt;br /&gt;
## [13] tibble_1.3.4       nlme_3.1-131       lattice_0.20-35   &lt;br /&gt;
## [16] mgcv_1.8-22        pkgconfig_2.0.1    rlang_0.1.4       &lt;br /&gt;
## [19] Matrix_1.2-12      psych_1.7.8        bibtex_0.4.2      &lt;br /&gt;
## [22] yaml_2.1.15        parallel_3.4.2     SparseM_1.77      &lt;br /&gt;
## [25] RefManageR_0.14.20 stringr_1.2.0      httr_1.3.1        &lt;br /&gt;
## [28] xml2_1.1.1         MatrixModels_0.4-1 nnet_7.3-12       &lt;br /&gt;
## [31] rprojroot_1.2      grid_3.4.2         glue_1.2.0        &lt;br /&gt;
## [34] R6_2.2.2           foreign_0.8-69     rmarkdown_1.8     &lt;br /&gt;
## [37] minqa_1.2.4        reshape2_1.4.2     purrr_0.2.4       &lt;br /&gt;
## [40] magrittr_1.5       splines_3.4.2      MASS_7.3-47       &lt;br /&gt;
## [43] backports_1.1.1    htmltools_0.3.6    pbkrtest_0.4-7    &lt;br /&gt;
## [46] assertthat_0.2.0   mnormt_1.5-5       quantreg_5.34     &lt;br /&gt;
## [49] stringi_1.1.6&amp;lt;/pre&amp;gt;&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;a name=bib-pwr&amp;gt;&amp;lt;/a&amp;gt;[[#cite-pwr|[1]]] S. Champely. &amp;#039;&amp;#039;pwr: Basic Functions for Power Analysis&amp;#039;&amp;#039;. R package version 1.2-1. 2017. URL: https://CRAN.R-project.org/package=pwr.&lt;/div&gt;</summary>
		<author><name>Davebrid</name></author>
	</entry>
</feed>