statsQT: Generate description of numeric varaible.

Description Usage Arguments Value Examples

View source: R/statistic_functions.R

Description

A method that generate description of numeric variable and perform comparative statistic test in case of comparaison group.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
statsQT(
  data,
  variable,
  group = NULL,
  group_str = NULL,
  all = FALSE,
  round = 3,
  confint = FALSE,
  desc = c("Mean", "Median", "Range"),
  p_value = FALSE,
  forcedTest = NULL,
  NA_group_AsModality = FALSE,
  output = NULL
)

Arguments

data

a data.frame containing the data to describe

variable

a character vector of length 1. The name of the numeric column to describe.

group

a character vector of length 1. The name of the factor column to use as commparaison group. Default to NULL.

group_str

a character vector. The name of the levels of the group variable to use. Default to NULL.

all

a boolean. If TRUE, total column will be displayed. Default to FALSE

round

an integer, number of maximal decimal. Default to 3

confint

a boolean. If TRUE, the confidence interval of the mean will be displayed. Default to FALSE

desc

a character vector. Could contain "Mean", "Median", "Range" and/or "Mode"

p_value

a boolean. If TRUE, comparaison test are performed.

forcedTest

a character vector of length 1. Must be one of "t-test for inequal variances", "t-test for equal variances", "Wilcoxon test", "Analysis of variance", or "Kruskal-Wallis test". Default to NULL.

NA_group_AsModality

a boolean. If TRUE, missing data of the group variable will be considered as levels. Default to FALSE

output

a data.frame, containing a previously generated data.frame or a new data.frame. data.frame are generated using createOutput() function.

Value

a data.frame containing the description of the variable

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(mtcars)
mtcars$am <- as.factor(mtcars$am)
output <- createOutput()
output <- statsQT(output = output,
                  data = mtcars,
                  variable = "mpg",
                  group = "am")
output <- statsQT(output = output,
                  data = mtcars,
                  variable = "disp",
                  group = "am")

rgriffier/statsBordeaux documentation built on Aug. 11, 2021, 9:59 a.m.