Skip to content
Prev 325775 / 398503 Next

Superpose two QQ-plots (gamma distribution) with lattice function qqmath()

Hi

Following on David's rate argument

try (with modifications of pch and grid)

rate <- 1/4
shape = 8
rate = c(rep(1/4,100),rep(1/3,100))
x = rgamma(200,shape,rate)
groups = gl(2,100,200,labels=LETTERS[1:2])
dat = data.frame(x=x, gp=groups)

qqmath(~ x,  data = dat,
        groups = gp,
        pch = 20,
        type = c("p","g"),
        distribution = function(x) qgamma(x,shape,rate),
        panel = function(x,groups,...) {
                  panel.qqmath(x,groups, ...)
        })

Duncan

Duncan Mackay
Department of Agronomy and Soil Science
University of New England
Armidale NSW 2351
Email: home: mackay at northnet.com.au
At 00:55 22/06/2013, you wrote: