In problem 3, I have a perfectly good plot (using plot()) of the function that seems to estimate the histogram. However, I am really having problems using lines() to overlay it on top of the histogram. It just keeps saying:
<br><br>Error in as.vector(x, &quot;double&quot;) : cannot coerce to vector<br><br>So I guess my function isn&#39;t in vector format... but I can&#39;t figure out how to make it one. In Baayen pg. 27 I think he&#39;s answering this question but I can&#39;t follow what he&#39;s saying.
<br>Any tips?<br>Kate<br><br><div><span class="gmail_quote">On 10/21/07, <b class="gmail_sendername"><a href="mailto:rlevy@ling.ucsd.edu">rlevy@ling.ucsd.edu</a></b> &lt;<a href="mailto:rlevy@ling.ucsd.edu">rlevy@ling.ucsd.edu
</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Rebecca Colavin wrote:<br>&gt; Okay, I give up.<br>&gt;<br>&gt; The graph in the question generates a distribution where the probability
<br><br>&gt; mass (=1) is contained under the curve. In short, the y axis is (0,9) or<br><br>&gt; so .<br>&gt;<br>&gt; But when I try to do lines over it with a normal distribution, the y<br>values are probabilities. The y axis for this is (0,1).
<br><br>Hi Rebecca,<br><br>Because the normal distribution is a continuous probability density, the<br>y values (for the density) are not bounded above by 1.&nbsp;&nbsp;Remember, it is<br>the *area under the curve* that must total 1.&nbsp;&nbsp;If the scale of the x&nbsp;&nbsp;axis
<br>is small, p(x) can easily surpass 1.<br><br>As an example, try:<br><br> &gt; x &lt;- seq(-5,5,by=0.01)<br> &gt; plot(x,dnorm(x,0,0.1),type=&quot;l&quot;)<br><br>This normal density peaks around p(x) = 4.<br><br>Using hist() with prob=T also is an estimation of density, which is why
<br>the hist() y axis also surpasses 1.<br><br><br>Roger<br><br><br>--<br><br>Roger Levy&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Email: <a href="mailto:rlevy@ucsd.edu">rlevy@ucsd.edu</a><br>Assistant Professor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Phone: 858-534-7219
<br>Department of Linguistics&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Fax:&nbsp;&nbsp; 858-534-4789<br>UC San Diego&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Web:&nbsp;&nbsp; <a href="http://ling.ucsd.edu/~rlevy">http://ling.ucsd.edu/~rlevy</a><br><br><br><br><br><br>_______________________________________________
<br>Lign251 mailing list<br><a href="mailto:Lign251@ling.ucsd.edu">Lign251@ling.ucsd.edu</a><br><a href="http://pidgin.ucsd.edu/mailman/listinfo/lign251">http://pidgin.ucsd.edu/mailman/listinfo/lign251</a><br></blockquote>
</div><br>