Create graph of boxplots of groups in a cgOneFactorData
object.
1 2 
x 
A 
... 
Additional arguments, both optional. Two are currently valid:

For uncensored data, the boxplot for each group produced is a standard boxplot,
similar to that produced by
graphics::boxplot.default
,
but with the median shown as a "+" and the mean shown as a "o". A
warning is added to the plot if any of the groups or all of the groups
have 5 or fewer observations (in which case a plot from
pointGraph.cgOneFactorData
might be more suitable).
For censored data, KaplanMeier estimates are used for the quantiles, as
proposed by Gentleman and Crowley (1991). The survival::survfit
conventions are followed for interpolation of these quantiles.
Extreme values that are censored
are drawn as open arrow heads rather than open circles.
Leftcensored values are shown as a shallow "V",
which is actually just a rotated downward ">" sign. Similarly, rightcensored
values are shown as a deeper "^", which is a actually just a rotated upward ">" sign.
Individual points are jitter
ed, and open circles
are used for complete observations
to alleviate potential overlap and the danger of representing
multiple points as a single point. Individual censored values are
similarly jittered.
With enough censored data
observations in a group, certain quantiles may not be estimable, and
thus a complete box would not appear.
If logscale=TRUE
, the tick marks for the yaxis
on the left side of the plot show original values, while the
ticks mark for the yaxis on the right side of the graph
show base 10 log values.
Tick marks are attempted to be chosen wisely. For logscaled axes in
particular, leading digits of 2, 5, and 10 for values are included if
possible. Since the algorithm is empirical, the ticklabels
argument is available for further refinement or complete replacement
of tickmarks.
The heading for the graph is taken from the cgOneFactorData
object,
which prepareCGOneFactorData
sets from its analysisname
argument.
The label for the yaxis is taken from the cgOneFactorData
object,
which prepareCGOneFactorData
sets from its endptname
argument.
The number of decimal places printed in the ticks on the yaxis is taken
from the cgOneFactorData
object,
which prepareCGOneFactorData
sets from its digits
argument.
The minimum and maximum values from the range of the data are respectively labeled in the bottom and top left corners of the graph region.
If group labels along the xaxis seem to overlap in the standard horizontal form, they will be rotated 45 degrees.
boxplot.cgOneFactorData
returns
an invisible NULL
. The main purpose is the side
effect of graphing to the current device.
Contact cg@billpikounis.net for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
Gentleman, R.C. and Crowley, J. (1991). "Graphical Methods for Censored Data", Journal of the American Statistical Association, Volume 86, 678683.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18  data(canine)
canine.data < prepareCGOneFactorData(canine, format="groupcolumns",
analysisname="Canine",
endptname="Prostate Volume",
endptunits=expression(plain(cm)^3),
digits=1, logscale=TRUE, refgrp="CC")
boxplot(canine.data)
## Plot the data on the original scale instead of the log scale
boxplot(canine.data, logscale=FALSE)
## Censored Data
data(gmcsfcens)
gmcsfcens.data < prepareCGOneFactorData(gmcsfcens, format="groupcolumns",
analysisname="cytokine",
endptname="GMCSF (pg/ml)",
logscale=TRUE)
boxplot(gmcsfcens.data)

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
All documentation is copyright its authors; we didn't write any of that.