<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/new-package-polypoly-helper-functions-for-orthogonal-polynomials/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://tjmahr.github.io/polypoly-package-released/"> Higher Order Functions</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>Last week, I released a <a rel="nofollow" href="https://cran.r-project.org/web/packages/polypoly/index.html" title="CRAN page for polypoly" target="_blank">new package called polypoly to CRAN</a>. It wraps up<br>
some common tasks for dealing with orthogonal polynomials into a single package.<br>
The <a rel="nofollow" href="https://github.com/tjmahr/polypoly" target="_blank">README</a> shows off the main<br>
functionality, as well as the neat “logo” I made for the package.<br>
In this post, I use the package on some word recognition data.</p>
<h2>Demo: Growth curve analysis</h2>
<p>I primarily use orthogonal polynomials to model data from eyetracking<br>
experiments where growth curves describe how the probability of looking at a<br>
image changes as the image is named. The analysis technique, including<br>
orthogonal polynomials and mixed effects models of eyetracking data, are<br>
described in <a rel="nofollow" href="http://amzn.to/2saBuzs" target="_blank">Mirman’s 2014 book</a>.</p>
<p>In <a rel="nofollow" href="https://www.ncbi.nlm.nih.gov/pubmed/26072992" target="_blank">our 2015 paper</a>, toddlers saw<br>
two images on a computer screen. The objects in the images started with<br>
different consonants: for example, <em>duck</em> and <em>ball</em>. The toddlers heard<br>
sentences like “find the ball”, and we measured how their gaze location onscreen<br>
changed in response to speech. This setup is a pretty standard procedure for<br>
studying spoken word recognition.</p>
<p>We manipulated the vowel in the word <em>the</em>. In the <em>facilitating</em> condition, the<br>
vowel has acoustic information (via anticipatory coarticulation) which would<br>
allow an adult listener to predict the upcoming consonant. In the <em>neutral</em><br>
condition, the vowel provides no cues about the upcoming consonant. The<br>
scientific question is whether these kiddos can take advantage of these acoustic<br>
cues during word recognition.</p>
<p>Here’s how the data look, both in R and in a plot.</p>
<div>
<pre><code><span>library</span><span>(</span><span>ggplot2</span><span>)</span><span>
</span><span>library</span><span>(</span><span>dplyr</span><span>)</span><span>
</span><span># The data
</span><span>d</span><span>
</span><span>#> # A tibble: 986 x 6
#> Subj Condition Time ToDistractor ToTarget Proportion
#> </span></code></pre></div>