qqnorm2t {Ecfun}R Documentation

Normal Probability Plot with Multiple Lines and Multiple Symbols


Create a normal probability plot of y with one line for each level of a factor or character variable x and (optionally) different symbols for the different levels of a variable z.

To create a normal probability plot with one line for each of multiple y variables, see qqnorm2s.

To create a normal probability plot with one line and different symbols for each level of a variable z, see qqnorm2.


qqnorm2t(y, x, z=NULL, data., plot.it=TRUE, 
    datax=TRUE, outnames=NULL, pch=NULL, 
    col=c(1:4, 6), legend.=NULL, ...)



a character vector of length 1 with the name of a column of data. for which normal probability plots are desired, with one line for each level of x.


a factor or character vector indicating how to split y for plotting.


A character vector giving the name of a column of data. to indicate different plotting symbols.


a data.frame with columns named in y, x, and z.


logical: Should the result be plotted?


The datax argument of qqnorm: If TRUE, the data are displayed on the horizontal rather than the vertical axis. (The default value for datax is the opposite of that for qqnorm.)


Names for the components of the qqnorm2s object returned by the qqnorm2s function. Equal to the levels of x by default.


a named vector of the plotting symbols to be used with names corresponding to the levels of z.

By default, if z takes levels FALSE and TRUE (or 0 and 1), pch=c(4, 1) to plot a "x" for FALSE and "o" for TRUE.

If z assumes integer values between 0 and 255, by default, the symbols are chosen as described with points.

Otherwise, by default, z is coerced to character, and the result is plotted.

If pch is provided, it must either have names corresponding to levels of z, or z must be integers between 1 and length(pch).


A vector indicating the colors corresponding to each element of x. Defaults to rep(c(1:4, 6), length=length(x)), with 1:4 and 6 being black, red, green, blue, and pink.


A list with components pch and col providing information for legend to identify the plotting symbols (pch) and colors (col).

By default, pch = list(x='right', legend=names(qq2s[[1]][['pch']]), pch=qq2s[[1]][['pch']]), where qq2s is described below in details.

Similarly, by default, lines = list(x='bottomright', legend=y, lty=1, pch=NA, col=qq2s[[1]][['col']]).


Optional arguments.

For plot.qqnorm2s, they are passed to plot.

For qqnorm2s, they are passed to qqnorm2 and to plot.qqnorm2s.


data. is split by x and the result is passed to qqnorm2s


Returns an object of class qqnorm2s.


Spencer Graves

See Also

qqnorm2, qqnorm2s, plot


## One data.frame
tstDF2 <- data.frame(y=1:6, x=c('a','b'), 
    z2=c(TRUE, TRUE, FALSE),
    z3=c('tell', 'me', 'why') )
# produce the object and plot it
Qnt <- qqnorm2t('y', 'x', 'z2', tstDF2)

# plot the object previously created

Qnt0 <- qqnorm2t('y', 'x', data.=tstDF2)
# without z 
qqnorm2t('y', 'x', data.=tstDF2)

[Package Ecfun version 0.3-2 Index]