descGroup: A desc_group Function

View source: R/desc_group.R

descGroupR Documentation

A desc_group Function

Description

DESCRIPCIO DE LA FUNCIO

Usage

descGroup(...)

Arguments

frml

Right side of ~ must have the terms in an additive way, and left side of ~ must contain the name of the grouping variable or can be left in blank (in this latter case descriptives for whole sample are calculated and no test is performed).

covariates

a character string with names of variables.

group

factor variable. Outcome. Default value is NULL

data

data frame, list or environment (or object coercible by 'as.data.frame' to a data frame) containing the variables in the model. If they are not found in 'data', the variables are taken from 'environment(formula)'.

method

character string indicating the method to test use; possible values are 'param' or 'non-param'. Default values is 'non-param'.

font_size

A numeric input for table font size

byrow

logical or NA. Percentage of categorical variables must be reported by rows (TRUE), by columns (FALSE) or by columns and rows to sum up 1 (NA). Default value is FALSE, which means that percentages are reported by columns (withing groups).

width_lev

defines the maximum width of table columns. Default value is 8em

pval_cut

cut p.value colored. To select

show.pval

logical indicating whether p-value of overall groups significance ('p.overall' column) is displayed or not. Default value is TRUE.

show.pval.adj

logical indicating whether adjust p-value of overall groups significance ('p.overall' column) is displayed or not. Default value is FALSE.

caption

Character vector containing the table's caption or title.

paired

logical indicating paired data. Default value is FALSE.

idvar

a character string with name of identifier variable .

Examples

 # set.seed(1)
 # dat <- df <- data.frame(MUT = factor(c(rep("A", 13),rep("B",13))),
 #                          var = factor(sample(c("Yes", "no"), 26, replace = TRUE)),
 #                          size = rnorm(26),
 #                          id = paste0("a",1:26))
 # dat$id <- as.character(dat$id)
 # res <- desc_group(group  = "MUT",covariates = names(dat), data = dat)
 # res$res
 # res <- desc_group(group  = "MUT",covariates = names(dat), data = dat, show.pval = FALSE)
 # res$res
 # desc_group(covariates = qsec, group = vs, data = mtc_bis)
 # desc_group(covariates = gear, group = vs, data = mtc_bis)
 # mtc_bis %>% desc_group(covariates = qsec, group = vs)
 # mtc_bis %>% desc_group(covariates = c(qsec, mpg, gear), group = vs)

uebvhir/anaStatsUEB documentation built on May 6, 2023, 3:46 a.m.