Re: [R] rootogram for normal distributions

2011-01-18 Thread Deepayan Sarkar
On Mon, Jan 17, 2011 at 8:24 PM, S Ellison wrote: > I was distracted enough by the possibility of hijacking hist() for this > to give it a go. > > The following code implements a basic hanging rootogram based on a > normal density with hist() breaks used as bins and bin midpoints used as > the han

Re: [R] rootogram for normal distributions

2011-01-17 Thread S Ellison
I was distracted enough by the possibility of hijacking hist() for this to give it a go. The following code implements a basic hanging rootogram based on a normal density with hist() breaks used as bins and bin midpoints used as the hanging location (not exact, I suspect, but perhaops good enough

Re: [R] rootogram for normal distributions

2011-01-16 Thread Deepayan Sarkar
On Sun, Jan 16, 2011 at 11:58 AM, Hugo Mildenberger wrote: > Thank you very much for your qualified answers, and also for the > link to the Tukey paper. I appreciate Tukey's writings very much. Yes, thanks to Hadley for the nice reference, I hadn't seen it before. > Looking at the lattice code (

Re: [R] rootogram for normal distributions

2011-01-16 Thread Hugo Mildenberger
Thank you very much for your qualified answers, and also for the link to the Tukey paper. I appreciate Tukey's writings very much. Looking at the lattice code (below), a possible implementation might involve binning, not so? I see a problematic part here: xx <- sort(unique(x)) Unique cer

Re: [R] rootogram for normal distributions

2011-01-16 Thread Achim Zeileis
On Sun, 16 Jan 2011, Hadley Wickham wrote: The normal distribution is a continuous distribution, i.e., the frequency for each observed value will essentially be 1/n and not converge to the density function. Hence, you would need to look at histogram or smoothed densities. Rootograms, on the othe

Re: [R] rootogram for normal distributions

2011-01-16 Thread Hadley Wickham
> The normal distribution is a continuous distribution, i.e., the frequency > for each observed value will essentially be 1/n and not converge to the > density function. Hence, you would need to look at histogram or smoothed > densities. Rootograms, on the other hand, are intended for discrete > di

Re: [R] rootogram for normal distributions

2011-01-16 Thread Achim Zeileis
On Sun, 16 Jan 2011, Hugo Mildenberger wrote: Using R-2.12.1 and latticeExtra-0.6-14, I would like to understand why a rootogram displaying samples from the Poisson distribution looks like I expected it, whereas a rootogram using the normal distribution does not: library(latticeExtra) rootogram

[R] rootogram for normal distributions

2011-01-16 Thread Hugo Mildenberger
Using R-2.12.1 and latticeExtra-0.6-14, I would like to understand why a rootogram displaying samples from the Poisson distribution looks like I expected it, whereas a rootogram using the normal distribution does not: library(latticeExtra) rootogram(~rpois(1000, lambda = 50), dfun = function(x)