[R] panel-dependent distribution in qqmath

From: Benjamin Tyner <btyner_at_gmail.com>
Date: Wed 11 Oct 2006 - 19:50:12 GMT


In qqmath, how would one go about having 'distribution' change with panel.number? I've tried

set.seed(1)
mydata <- data.frame(ind = factor(rep(2:4, each = 100))) mydata$val <- rt(300, df=rep(2:4, each = 100))

plot<-qqmath(~ val | ind,

             layout=c(3,1),
             data = mydata,
             prepanel = function(x, distribution, ...) {
                mydist<-function(p) qt(p, df = panel.number() + 1)
                prepanel.qqmathline(x, distribution=mydist,...)
             },
             panel = function(x, distribution, ...) {
                mydist<-function(p) qt(p, df = panel.number() + 1)
                panel.qqmathline(x, distribution=mydist,...)
                panel.qqmath(x, distribution=mydist,...)
             })

But no luck.

Ben



R-help@stat.math.ethz.ch 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 Thu Oct 12 05:53:48 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 11 Oct 2006 - 20:30:26 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.