tabla3: Table 3

View source: R/tabla3.R

tabla3R Documentation

Table 3

Description

I believe it only works properly for two groups right now (2020-01-21).

Creates two data frames (alocated in a list), one for continuous variables (with columns: variable, mean, sd, median and IQR for EACH level of the grouping variable and results from *t.test()* or *coin::wilcox_test()*, depeding on 'test' value), and another for categorical variables (with columns: n and percentage for each level of the grouping variable and fisher test (*fisher.test()*), p value.).

Usage

table3(data, grupo, grupo_char, digits = 3, decimal.symbol = ",", test = c("median", "mean", "both"))


Arguments

data

Data to summarize, pay attention to column types.

grupo

Grouping variable given as column.

grupo_char

Grouping variable given as character string.

digits

Number of decimals to round.

Value

A list with two data frames, first one containing the values for continuous variables and second one for categorical variables. In the continuous data frame there is going to be parameteres responding to t.test(), or coin::wilcox_test(), or both, depeding on the value of 'test' argument.

Examples

result <- table3(mtcars, mtcars$am, "am")
result
writexl::write_xlsx(result, "exported_table3.xlsx")

ValeriaRolle/auxfun documentation built on June 29, 2023, 5:28 p.m.