biv_perc: Percentages table for 0-1 variables

View source: R/tables_bivariate.R

biv_percR Documentation

Percentages table for 0-1 variables

Description

The function make descriptive statistics (n, percentages) for 0-1 (or factor) x variables stratifying for the y variable

Usage

biv_perc(
  x = NULL,
  y = NULL,
  xname = NULL,
  yname = NULL,
  collapse_binary_y = FALSE,
  only_non_zero_perc = FALSE,
  style = c("long", "wide"),
  sort_freq = FALSE,
  latex = TRUE,
  latex_placement = "ht",
  label_prefix = "",
  label = "",
  caption_prefix = "",
  caption = "",
  wb = NULL,
  sheets = ""
)

Arguments

x

a single quantitative variable or a data.frame of qualitative variable

y

a single qualitative variable or a data.frame of qualitative variable

collapse_binary_y

regarding y, keep in row only the 1 in 0-1 variable or the last level for factors

only_non_zero_perc

print only non zero percentages rows

style

print different groups in different columns

sort_freq

decreasing frequencies ordered table

latex

output the table using xtable::xtable

latex_placement

table placement for latex printing

label_prefix

latex label prefix (useful for a common prefix in univariate_tables and multivariate_tables). It's ignored if label is specified (eg the latter is considered full/complete/correct)

label

latex label

caption_prefix

a prefix for latex caption (useful for a common prefix in univariate_tables and multivariate_tables)

caption

latex caption

wb

an openxlsx Workbook; if not NULL the table will be saved in the workbook too, aside printing

sheets

optional sheet names


lbraglia/lbstat documentation built on Sept. 17, 2023, 2:30 p.m.