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

From: Rolf Turner <r.turner_at_auckland.ac.nz>
Date: Wed, 25 Jun 2008 08:04:20 +1200

On 24/06/2008, at 8:10 AM, Daniel Folkinshteyn wrote:

> on 06/23/2008 03:40 PM Thomas Frööjd said the following:

        <SNIP>

>
>> 2. Scale the data so they can be plotted on the same axis. The
>> reference dataset has around 20 000 observations and my data from the
>> clinic only around 3000 so I have to fix this otherwise the plot of
>> the reference datset will be much bigger in the graph.
>
> if you do a density plot (see ?density in R), it will automatically
> be scaled. if you want the histogram scaled too, then after
> calculating the histogram frequencies, multiply them by a ratio of
> numberofobs for your data, and number of obs for reference data
> (i.e.: NOBS_yourdata / NOSB_refdata)

        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.

		cheers,

			Rolf Turner
######################################################################
Attention:
This e-mail message is privileged and confidential. If you are not the intended recipient please delete the message and notify the sender. Any views or opinions presented are solely those of the author.

This e-mail has been scanned and cleared by MailMarshal www.marshalsoftware.com

######################################################################

______________________________________________
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 Tue 24 Jun 2008 - 20:10:02 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 Wed 25 Jun 2008 - 16:30:53 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