Learn R Programming

greport (version 0.5-2)

dReport: Descriptive Statistics Report

Description

Generate graphics and LaTeX with descriptive statistics

Usage

dReport(formula, groups = NULL, what = c("box", "proportions", "xy", "byx"),
  byx.type = c("violin", "quantiles"), violinbox = TRUE,
  violinbox.opts = list(col = adjustcolor("blue", alpha.f = 0.25), border =
  FALSE), fun = NULL, data = NULL, subset = NULL, na.action = na.retain,
  panel = "desc", subpanel = NULL, head = NULL, tail = NULL,
  continuous = 10, h = 5.5, w = 5.5, outerlabels = TRUE,
  append = FALSE, sopts = NULL, popts = NULL)

Arguments

formula
a formula accepted by the bpplotM or summaryP functions. formula must have an id(subjectidvariable) term if there are repeated measures, in order to get correct subject counts as nobs.
groups
a superpositioning variable, usually treatment, for categorical charts. For continuous analysis variables, groups becomes the y-axis stratification variable. This is a single character string.
what
"box" (the default) or "xy" for continuous analysis variables, or "proportions" (or shorter) for categorical ones. Instead, specifying what="byx" results in an array of quantile intervals for continuous
byx.type
set to "quantiles" to show vertical quantile intervals of y at each x for when what="byx" and the y variable is continuous numeric, or set byx.type="violin" (the default) to plo
violinbox
set to TRUE to add violin plots to box plots
violinbox.opts
a list to pass to panel.violin
fun
a function that takes individual response variables (which may be matrices, as in Surv objects) and creates one or more summary statistics that will be computed while the resulting data frame is being
data
data frame
subset
a subsetting epression for the entire analysis
na.action
a NA handling function for data frames, default is na.retain
panel
character string. Name of panel, which goes into file base names and figure labels for cross-referencing
subpanel
If calling dReport more than once for the same type of chart (by different values of what), specify subpanel to distinguish the multiple calls. In that case, -subpanel will be appended to panel
head
character string. Specifies initial text in the figure caption, otherwise a default is used
tail
optional character string. Specifies final text in the figure caption, e.g., what might have been put in a footnote in an ordinary text page. This appears just before any needles.
continuous
the minimum number of numeric values a variable must have in order to be considered continuous
h
numeric. Height of plot, in inches
w
numeric. Width of plot
outerlabels
logical that if TRUE, pass lattice graphics through the latticeExtra package's useOuterStripsfunction if there are two conditioning (paneling) variables, to put panel labels in outer margins.
append
logical. Set to FALSE to start a new panel
sopts
list specifying extra arguments to pass to bpplotM, summaryP, or summaryS
popts
list specifying extra arguments to pass to a plot method. One example is text.at to specify some number beyond xlim[2] to leave extra space for numerators and denominators when using summaryP for categorical analysi
....
Passed to summaryP or bpplotM

Details

dReport generates multi-panel charts, separately for categorical analysis variables and continuous ones. The Hmisc summaryP function and its plot method are used for categorical variables, and bpplotM is used to make extended box plots for continuous ones unless what='byx'. Stratification is by treatment or other variables. The user must have defined a LaTeX macro \eboxpopup (which may be defined to do nothing) with one argument. This macro is called with argument extended box plot whenever that phrase appears in the legend, so that a PDF popup may be generated to show the prototype. See the example in report.Rnw in the tests directory. Similarly a popup macro \qintpopup must be defined, which generates a tooltip for the phrase quantile intervals.

Examples

Run this code
# See test.Rnw in tests directory

Run the code above in your browser using DataLab