Generate graphics and LaTeX with descriptive statistics
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),
summaryPsort = FALSE,
exclude1 = TRUE,
stable = TRUE,
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,
lattice = FALSE
)
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
.
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.
"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 y
, Wilson confidence intervals for proportions when y
is binary, or means and parametric confidence limits when y
is not continuous but is not binary. If what
is omitted or what="byx"
, actions will be inferred from the most continuous variable listed in formula
. When fun
is given, different behavior results (see below).
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 plot half-violin plots at each x
.
set to TRUE
to add violin plots to box plots
a list to pass to panel.violin
set to TRUE
to sort categories in descending order of frequencies
logical used for latex
methods when summaryM
or summaryP
are called by dReport
, or for plot methods for summaryP
. The default is TRUE
to cause the most frequent level of any two-level categorical variable to not be used as a separate category in the graphic or table. See summaryM
.
set to FALSE
to suppress creation of backup supplemental tables for graphics
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 collapsed to one row per condition. Dot charts are drawn when fun
is given.
data frame
a subsetting epression for the entire analysis
a NA handling function for data frames, default is na.retain
character string. Name of panel, which goes into file base names and figure labels for cross-referencing
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
when creating figure labels and cross-references.
character string. Specifies initial text in the figure caption, otherwise a default is used
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.
the minimum number of numeric values a variable must have in order to be considered continuous. Also passed to summaryM
.
numeric. Height of plot, in inches
numeric. Width of plot
logical that if TRUE
, pass lattice
graphics through the latticeExtra
package's useOuterStrips
function if there are two conditioning (paneling) variables, to put panel labels in outer margins.
logical. Set to FALSE
to start a new panel
list specifying extra arguments to pass to bpplotM
, summaryP
, or summaryS
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 analysis variables. Another common use is for example popts=list(layout=c(columns,rows))
to be used in rendering lattice
plots. key
and panel
are also frequently used.
set to TRUE
to use lattice
instead of ggplot2
for proportions. When this option is in effect, numerators and denominators are shown.
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
.
# See test.Rnw in tests directory
Run the code above in your browser using DataLab