Re: [R] Need ideas on how to show spikes in my data and how to code it in R

From: Daniel Folkinshteyn <dfolkins_at_gmail.com>
Date: Fri, 27 Jun 2008 16:54:11 -0400

if you want the "frequency" scale rather than density scale, then leave hist as is (by default it uses the frequency scale), and rescale the density by multiplying it by the appropriate NOBS.

on 06/27/2008 01:16 PM Thomas Frööjd said the following:
> Hi
>
> Thank you very much for taking time to answer.
>
> The solution of using hist(data) for the main dataset and adding
> lines(density(refdata)) for the reference data seem to work great. I
> forgot to mention one thing however, I need to have frequency on the y
> azis instead of density as now.
>
> I know this is not a "real" histogram but since the audience is not
> very statistically experienced I would prefer to do it this way.
> Anyone have an idea?
>
> Thanks again for your help.
>
> Thomas Fröjd
>
> On Wed, Jun 25, 2008 at 6:16 PM, Daniel Folkinshteyn <dfolkins_at_gmail.com> wrote:

>>>    I don't understand this.  Why not just get hist() to plot on the
>>> density scale,
>>>    thereby making its output commensurate with the output of density()?
>>>    The hist() function will plot on the density scale if you ask it to.
>>>  Set freq=FALSE
>>>    (or prob=TRUE) in the call to hist.
>>
>> ehrm... because i didn't realize that option existed :) that certainly is
>> easier than manually scaling hist output by NOBS - thanks for the tip!
>>

>


R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri 27 Jun 2008 - 20:56:53 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 08 Jul 2008 - 12:31:40 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive