tableContinuous2: Table Continuous 2

Description Usage Arguments Value

Description

This function takes a data frame of continuous variables and possible grouping, weighting, and subset variables and provides a LaTeX table of descriptive statistics separately per group and jointly for all observations, per variable.

Usage

1
2
3
4
5
6
7
tableContinuous2(vars, weights = NA, subset = NA, group = NA,
  stats = c("n", "min", "q1", "median", "mean", "q3", "max", "s", "iqr",
  "na"), prec = 1, col.tit = NA, col.tit.font = c("bf", "", "sf", "it",
  "rm"), print.pval = c("none", "anova", "kruskal"), pval.bound = 10^-4,
  declare.zero = 10^-10, cap = "", lab = "", font.size = "footnotesize",
  longtable = TRUE, disp.cols = NA, nams = NA, varSizeC = "0.15",
  levSizeC = "0.15", ...)

Arguments

vars

A data frame containing continuous variables. See nams for an alternative way of specifying the variables to be displayed.

weights

Optional vector of weights of each observation.

subset

Optional logical vector, indicates subset of observations to be used.

group

Optional grouping variable.

stats

Specify which descriptive statistics should be displayed in the table, by either directly providing one or more of the default character strings (in arbitrary order) or a user-defined function. A user-defined function must bear a name, take a vector as an argument (NA's are removed by default) and return a single number (the desired statistic).

prec

Specify number of decimals to be displayed.

col.tit

pecify titles of columns. Note that the length of this vector must be equal to the length of stats plus the number of potential user-defined functions added to stats.

col.tit.font

If col.tit has not been specified, choose the font for the column titles here (default: no special font face)

print.pval

If print.pval == "anova", p-values for an analysis of variance for a location difference between groups are added to the table. If print.pval == "kruskal", p-values of a Kruskal-Wallis test are given. If group has only two levels, the respective p-values of a t- or Mann-Whitney test are provided. Only applies if group is provided. Note that by default, any missing values are removed for computation of p-values. If missings should be considered a separate level, define the input variables accordingly.

pval.bound

p-values below pval.bound are formatted as < pval.bound.

declare.zero

Computed descriptive statistics (not p-values) below that constant are set to 0. Yields nicer tables, especially when displaying centered or standardized variables.

cap

The caption of the resulting LaTeX table.

lab

The label of the resulting LaTeX table.

font.size

Font size for the generated table in LaTeX.

longtable

If TRUE, function makes use of package longtable in LaTex to generate tables that span more than one page. If FALSE, generates a table in tabular environment.

disp.cols

Only included for backward compatibility. Needs to be a vector built of (some of) the default statistics character strings if not equal to NA. From package version 1.0.2 on use of stats is recommended.

nams

A vector of strings, containing the names corresponding to the variables in vars, if vars is not a data frame but a list of variables. These are then the names that appear in the LaTeX table. This option is only kept for backward compatibility.

varSizeC

Character vector that can be used to specify the size of the column (as a percentage) that contain the variables.

...

Arguments pass through to print.xtable.

Value

Generate a LaTeX table of descriptive statistics for continuous variables


Boshoffsmit/novaReport documentation built on May 6, 2019, 8 a.m.