Skip to content
Prev 247471 / 398503 Next

rootogram for normal distributions

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 certainly works well with Poisson distributed data, but is 
essentially a no-op when confronted with continous floating-point 
numbers.

Best

Hugo
function (x, y = table(x), dfun = NULL, transformation = sqrt, 
    hang = TRUE, ...) 
{
    plot.line <- trellis.par.get("plot.line")
    stopifnot(is.function(dfun))
    yy <- transformation(y/sum(y))
    xx <- sort(unique(x))
    dotArgs <- list(...)
    dfunArgs <- names(formals(dfun))
    if (!("..." %in% dfunArgs)) 
        dotArgs <- dotArgs[dfunArgs[-1]]
    dd <- transformation(do.call(dfun, c(list(xx), dotArgs)))
    list(xlim = range(xx), ylim = if (hang) range(dd, dd - yy, 
        0) else range(dd, yy, 0), dx = diff(xx), dy = diff(dd))
}
function (x, y = table(x), dfun = NULL, col = plot.line$col, 
    lty = plot.line$lty, lwd = plot.line$lwd, alpha = plot.line$alpha, 
    transformation = sqrt, hang = TRUE, ...) 
{
    plot.line <- trellis.par.get("plot.line")
    ref.line <- trellis.par.get("reference.line")
    stopifnot(is.function(dfun))
    yy <- transformation(y/sum(y))
    xx <- sort(unique(x))
    dotArgs <- list(...)
    dfunArgs <- names(formals(dfun))
    if (!("..." %in% dfunArgs)) 
        dotArgs <- dotArgs[dfunArgs[-1]]
    dd <- transformation(do.call(dfun, c(list(xx), dotArgs)))
    panel.abline(h = 0, col = ref.line$col, lty = ref.line$lty, 
        lwd = ref.line$lwd, alpha = ref.line$alpha)
    panel.segments(xx, if (hang) 
        dd
    else 0, xx, if (hang) 
        (dd - yy)
    else yy, col = col, lty = lty, lwd = lwd, alpha = alpha, 
        ...)
    panel.lines(xx, dd)
}
<environment: namespace:latticeExtra>

        
On Sunday 16 January 2011 15:59:58 Achim Zeileis wrote: