stats_table: Statistical table

Description Usage Arguments Examples

Description

Compiles a table with descriptive and inferential statistics to compare group characteristics, e.g. control variables of a treatment group and a control group.

Usage

1
2
stats_table(.data, iv, dvs, funs = c("mean", "sd"), paired = FALSE, id,
  sig = FALSE, format = c("text", "html", "latex"), ...)

Arguments

.data

a data frame

iv

name of the independent variable

dvs

names of the dependent variables

funs

character vector with function names indicating the parameters to calculate (default: c("mean", "sd")).

paired

logical indicating whether you have paired data (iv is a within factor) or non-paired data (iv is a between factor).

id

name or character string indicating the subject identifier column in .data. Only required if the independent variable has more than two levels.

sig

logical indicating whether to show significance with symbols in the last column

format

character string indicating the output format, one of "text", "html" or "latex". For HTML, the table is displayed as a htmlwidget. For LaTeX, the tabularx environment is used, which requires the tabularx package. The utilized \cmidrule command requires either the booktabs or ctable package.

...

Further arguments passed to functions. If the independent variable has two levels, then ... can contain arguments passed to t_test, e.g. var.equal = TRUE.

Examples

1
2
3
stats_table(hquest, iv = group, dvs = age:sens_seek)
stats_table(hquest, iv = group, dvs = age:sens_seek, sig = TRUE,
            format = "html", var.equal = TRUE)

dgromer/psymisc documentation built on May 15, 2019, 7:22 a.m.