dReport {greport}R Documentation

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),
  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
)

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 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).

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 plot half-violin plots at each x.

violinbox

set to TRUE to add violin plots to box plots

violinbox.opts

a list to pass to panel.violin

summaryPsort

set to TRUE to sort categories in descending order of frequencies

exclude1

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.

stable

set to FALSE to suppress creation of backup supplemental tables for graphics

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 collapsed to one row per condition. Dot charts are drawn when fun is given.

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 when creating figure labels and cross-references.

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. Also passed to summaryM.

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 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.

lattice

set to TRUE to use lattice instead of ggplot2 for proportions. When this option is in effect, numerators and denominators are shown.

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

# See test.Rnw in tests directory

[Package greport version 0.7-4 Index]