Quantile-Quantile Plots for Comparing Multiple Distributions

DESCRIPTION:

Create a Quantile-Quantile Trellis plot for comparing multiple distributions. A modified version of the plot is created if the data argument is a bigdata bdFrame (see the DETAILS).

USAGE:

qq(formula, 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.

ARGUMENTS:

formula
a formula specified as y ~ x | g1 * g2 * ... however the given variables g1, g2, ... may be omitted. x is the numeric response, and y is a numeric, shingle or factor grouping vector. y must have exactly two levels which divide the x values into two groups. Quantiles from the first of these groups are plotted on the horizontal axis; corresponding quantiles from the second group are plotted on the vertical axis. ( y will be coerced into a factor or shingle, if it is not already such).
f.value
function of a single integer, representing a sample size, that produces a vector of probabilities corresponding to which observations should be plotted. This function can be used to cut down on the number of points plotted, for example, function(n) c(.01, .05, seq(.1,.9,.1), .95, .99)

VALUE:

an object of class trellis, which is automatically plotted by print.trellis.

DETAILS:

If the data argument is a bdFrame then approximate quantiles (based on binning the data into 1000 equi-spaced bins) are computed and plotted.

SEE ALSO:

,

EXAMPLES:

# compare bass heights to tenor heights 
bass2 <- singer$height[singer$voice.part == "Bass 2"] 
tenor1 <- singer$height[singer$voice.part == "Tenor 1"] 
qq(which ~ data, data = make.groups(bass2,tenor1), aspect = 1, 
   ylab = "Tenor 1 Height (inches)", 
   xlab = "Bass 2 Height (inches)") 
# alternative to the above 
qq(voice.part ~ height, aspect = 1, data = singer, 
   subset = voice.part == "Bass 2" | voice.part == "Tenor 1", 
   ylab = "Tenor 1 Height (inches)", 
   xlab = "Bass 2 Height (inches)") 
# compare payoffs in 2 periods of lottery drawings 
qq(which ~ data, data = make.groups(lottery.payoff, lottery2.payoff))