dReport: Descriptive Statistics Report

Description Usage Arguments Details Examples

View source: R/dReport.r

Description

Generate graphics and html with descriptive statistics

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
dReport(
  formula,
  groups = NULL,
  what = c("hist", "ecdf", "proportions", "xy", "byx", "stacked"),
  study = " ",
  byx.type = c("hist", "quantiles"),
  summaryPsort = FALSE,
  exclude1 = TRUE,
  fun = NULL,
  data = NULL,
  subset = NULL,
  na.action = na.retain,
  head = NULL,
  tail = NULL,
  continuous = 10,
  h = NULL,
  w = NULL,
  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

"hist" (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).

study

character string identifying the study; used in multi-study reports or where distinct patient strata are analyzed separately. Used to fetch the study-specific metadata stored by sethreportOption. Single study reports just use study=' '.

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="hist" (the default) to plot spike histograms along with quantile intervals at each x.

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.

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

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

sopts

list specifying extra arguments to pass to histboxpM, ecdfpM, summaryP, summaryS, or propsPO

popts

list specifying extra arguments to pass to a plot method.

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, bpplotM is used to make extended box plots for continuous ones unless what='byx', and propsPO is used for stack bar charts showing relative proportons. Stratification is by treatment or other variables.

Examples

1
# See test.Rnw in tests directory

harrelfe/hreport documentation built on July 26, 2021, 9:09 a.m.