summary.univariateTable: Preparing univariate tables for publication

View source: R/summary.univariateTable.R

summary.univariateTableR Documentation

Preparing univariate tables for publication

Description

Summary function for univariate table

Usage

## S3 method for class 'univariateTable'
summary(
  object,
  n = "inNames",
  drop.reference = FALSE,
  pvalue.stars = FALSE,
  pvalue.digits = 4,
  show.missing = c("ifany", "always", "never"),
  show.pvalues,
  show.totals,
  ...
)

Arguments

object

univariateTable object as obtained with function univariateTable.

n

If not missing, show the number of subjects in each column. If equal to "inNames", show the numbers in parentheses in the column names. If missing the value object$n is used.

drop.reference

Logical or character (vector). Decide if line with reference level should be suppressed for factors. If TRUE or "all" suppress for all categorical factors. If 'binary' suppress only for binary variables. Can be character vector in which case reference lines are suppressed for variables that are included in the vector.

pvalue.stars

If TRUE use symnum to parse p-values otherwise use format.pval.

pvalue.digits

Passed to format.pval.

show.missing

Decides if number of missing values are shown in table. Defaults to "ifany", and can also be set to "always" or "never".

show.pvalues

Logical. If set to FALSE the column p-values is removed. If missing the value object$compare.groups[[1]]==TRUE is used.

show.totals

Logical. If set to FALSE the column Totals is removed. If missing the value object$show.totals is used.

...

passed on to labelUnits. This overwrites labels stored in object$labels

Details

Collects results of univariate table in a matrix.

Value

Summary table

Author(s)

Thomas A. Gerds <tag@biostat.ku.dk>

Examples

data(Diabetes)
u <- univariateTable(gender~age+location+Q(BMI)+height+weight,
                data=Diabetes)
summary(u)
summary(u,n=NULL)
summary(u,pvalue.digits=2,"age"="Age (years)","height"="Body height (cm)")

u2 <- univariateTable(location~age+AgeGroups+gender+height+weight,
                data=Diabetes)
summary(u2)
summary(u2,drop.reference=TRUE)
## same but more flexible
summary(u2,drop.reference=c("binary"))
## same but even more flexible
summary(u2,drop.reference=c("gender"))



Publish documentation built on Jan. 18, 2023, 1:08 a.m.