data
argument is a bigdata bdFrame (see the DETAILS).
qqmath(formula, distribution=qnorm, f.value=ppoints, ...)The following arguments have special meaning within this function. The common meanings for these and all other arguments are listed separately under
trellis.args
.
~ x | g1 * g2 * ...
however the given variables
g1
,
g2
,
...
may be omitted.
x
is a numeric vector.
qnorm
,
qunif
, or
your own function (see the examples).
function(n) c(.01, .05, seq(.1,.9,.1), .95, .99)
trellis
,
which is automatically plotted by
print.trellis
.
If the
data
argument is a bdFrame then approximate quantiles
(based on binning the data into 1000 equi-spaced bins)
are computed and plotted.
# how well is a normal sample fit by a t distn on 7 df? qqmath( ~ rnorm(100), distribution=function(p) qt(p, df=7)) qqmath( ~ height | voice.part, data=singer, prepanel = prepanel.qqmathline, panel = function(x, y, ...) { panel.grid() panel.qqmathline(y, distribution=qnorm, ...) panel.qqmath(x, y, ...) }, layout=c(2, 4), aspect=1, xlab="Unit Normal Quantile", ylab="Height (inches)") # residuals for each voice part plotted against distn of pooled residuals qqmath( ~ height | voice.part, data=as.bdFrame(singer), prepanel = prepanel.qqmathline, panel = function(x, y, ...) { panel.grid() panel.bd.qqmathline(x, y, ...) panel.qqmath(x, y, ...) }, layout=c(2, 4), aspect=1, xlab="Unit Normal Quantile", ylab="Height (inches)") # like above but for bigdata. Note x argument to panel.bd.qqmathline # and the lack of distribution=qnorm argument. attach(singer) oneway.residuals <- oneway(height ~ voice.part, spread=1)$residuals qqmath( ~ oneway.residuals | voice.part, distribution=function(p) quantile(oneway.residuals, p), panel=function(x, y) { panel.grid() panel.abline(0, 1) panel.qqmath(x, y) }, aspect=1, layout=c(2, 4), xlab="Pooled Residual Height (inches)", ylab="Residual Height (inches)") # specifying different plotting parameters in the panel function qqmath(~Weight|Fuel, panel=function(...) panel.qqmath(..., cex= 2))