ucr.base.tab | R Documentation |
Creates a baseline table from a data frame. The data may be partitioned in two or more groups. A column for the "combined" group (all data) can also be included.
ucr.base.tab(
data,
group.name = NULL,
combined.name = "Combined",
x.names = setdiff(names(data), group.name),
num.format = "median",
median.format = "iqr",
mean.format = "par",
factor.format = "count.perc",
perc.method = "group",
print.perc = T,
print.perc.space = F,
omit.perc.decimal = F,
use.texttt = F,
omit.ref.level = F,
separate.factor.row = F,
show.missing = "none",
digits = 1,
spec.digits = NULL,
include.combined = T,
include.n = T,
include.p = T,
test.x.names = x.names,
num.test = "nonparam",
factor.test = "fisher",
min.p = "0.001"
)
data |
The data frame. |
group.name |
Name of the variable in 'data' that defines the groups, or NULL (default) if there are no groups. The group variable must be a factor without missing.. |
combined.name |
Column heading for the combined group. Defaults to "Combined". |
x.names |
Names and order of the variables in 'data' that shall be included in the table. By default, all variables except the group variable, if any, are included. |
num.format |
How to present numerical variables. Allowed values:
|
median.format |
What measure of dispersion to give together with medians. Allowed values:
|
mean.format |
How to present standard deviations. Allowed values:
|
factor.format |
How to present factor variables. Allowed values:
|
perc.method |
How to compute percentages for factor variables. Allowed values:
|
print.perc |
TRUE if a percent sign ('%') is to be printed for percentages. |
print.perc.space |
TRUE if a space is to be printed between the number and the percent sign, i.e. "12.3 %" rather than "12.3%". N/A if percent sign is disabled. |
omit.perc.decimal |
TRUE if the decimal is to be omitted for percentages above 1%, e.g. 13% rather than 13.3%. |
use.texttt |
logical; use latex texttt |
omit.ref.level |
TRUE if the reference (first) level of dichotomous factor variables should be omitted from the table. |
separate.factor.row |
TRUE if a separate row is added (first) for each factor, containing the variable name, number of inidividuals/missing etc. |
show.missing |
How should missing values, if any, per group be shown?
|
digits |
An integer, giving the number of decimals for numeric variables, unless otherwise specified through the parameter 'spec.digits'. |
spec.digits |
A list, whose names form a subset of 'x.names', and whose values are the number of decimals for those (numeric) variables. The value NULL causes 'digits' to be used throughout. |
include.combined |
TRUE if the combined group should be included in a separate column. |
include.n |
TRUE if number of valid (non-NA) observations per variable should be included in a separate column. |
include.p |
TRUE if P-values are to be included in the table. They refer to univariate tests for identical distribution in the different groups. P-values can only be included if there are groups. |
test.x.names |
Names of variables to perform tests for. |
num.test |
Which kind of test to use for numerical variables. Allowed values:
|
factor.test |
Which test to use for factor variables. Allowed values:
|
min.p |
Smallest P-value to be displayed. If smaller, then a text like "< 0.001" is given. NOTE: This value must be a string, e.g. "0.001" or "1e-3". |
The return value is an S3 object of class ucr.base.tab.
Lars Lindhagen
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.