descTab {doudpackage} | R Documentation |
Generic function to create a table of descriptive analysis of a dataset
Description
This function allows you to display all together all univariate analysis (median/mean; IQR/SD; proportions) and bivariates analysis (Wilcoxon, ChiĀ² or Fisher). The univariate analysis can be sub-grouped by a variable of interest of n levels. Appropriate statistics test will be applied
Usage
descTab(
data,
group = NULL,
quanti = TRUE,
quali = TRUE,
na.print = FALSE,
pvalue = TRUE,
digits.p = 3L,
digits.qt = 1L,
digits.ql = 1L,
normality = "normal",
parallel = FALSE,
mc.cores = 0
)
Arguments
data |
A datasaset. Needs to be a data.frame/tibble object |
group |
Optional. The name of the variable to make sub-groups comparisons. |
quanti , quali , na.print , pvalue |
Logical. If false, won't display quantitative/qualitative/Missing values/pvalues variable results |
digits.p |
Integer. Significant digits for p value |
digits.qt |
Integer. Significant digits for mean/median, SD/IQR |
digits.ql |
Integer. Significant digits for proportions |
normality |
One of "assess", "normal", "manual", "non normal". See details |
parallel |
Logical. Make analysis using parallel from |
mc.cores |
If parallel is TRUE, how many Cores to used. |
Value
A S4 objects parseClass()
containing the main table accessible by ["table"] subscript.
Examples
data(iris)
library(stringi)
iris$fact_1<-as.factor(as.character(sample(1:5, 150, replace = TRUE)))
n_na<-sample(1:150, 30)
iris[n_na, "fact_1"]<-NA
iris$fact_2<-as.factor(as.character(sample(1:2, 150, replace = TRUE)))
n_na<-sample(1:150, 10)
iris[n_na, "fact_2"]<-NA
iris$fact_3<-as.factor(as.character(stri_rand_strings(150, 1, '[A-B]')))
iris$num<-runif(150, min = 0, max = 100)
n_na<-sample(1:150, 5)
iris[n_na, "num"]<-NA
iris_test<-descTab(iris, group = "Species", na.print = TRUE)