Learn R Programming

easyDes (version 6.0)

easyDes: An Easy Way to Descriptive Analysis

Description

Descriptive analysis is essential for publishing medical articles. This package provides an easy way to conduct the descriptive analysis. 1. Both numeric and factor variables can be handled. For numeric variables, normality test will be applied to choose the parametric and nonparametric test. 2. Both two or more groups can be handled. For groups more than two, the post hoc test will be applied, 'Tukey' for the numeric variables and 'FDR' for the factor variables. 3. T test, ANOVA or Fisher test can be forced to apply. 4. Mean and standard deviation can be forced to display.

Usage

easyDes(nc.g,nc.n,nc.f,nc.of,dataIn,fisher,aov,t,mean,
    mcp.test.method,mcp.stat,mcp.t.test,mcp.t.test.method,
    table.margin,decimal.p,decimal.prop)

Arguments

nc.g

integer, the column number of the grouping variable, length of 'nc.g' must be 1

nc.n

numeric vector, the column number of the numeric variable, length of 'nc.n' can be more than 1

nc.f

numeric vector, the column number of the factor variable, length of 'nc.f' can be more than 1

nc.of

numeric vector, the column number of the ordinal factor variable, length of 'nc.of' can be more than 1

dataIn

data frame including variables above

fisher

logic, whether to apply Fisher test by force, the default is 'TRUE'

aov

logic, whether to apply ANOVA test by force, the default is 'FALSE'

t

logic, whether to apply T test by force, the default is 'FALSE'

mean

logic, whether to disply the mean and standar deviation for the numeric variables by force, the default is 'FALSE'

mcp.test.method

character, specific for ANOVA, the method for the multiple comparisons in 'multcomp' package, 'Tukey' or 'Dunnett'

mcp.stat

logic, whether to display the statistic for the multiple comparsions

mcp.t.test

logic, specific for ANOVA, wether to use the pairwise t tests as the multiple comparsions instead of that in 'multcomp' package

mcp.t.test.method

character, specific for 'mcp.t.test'==TRUE, the method for the pairwise t tests, 'holm' (Holm, 1979), 'hochberg' (Hochberg, 1988), 'hommel' (Hommel, 1988), 'bonferroni', 'BH' (Benjamini & Hochberg, 1995), 'BY' (Benjamini & Yekutieli, 2001), 'fdr', 'none'

table.margin

1 or 2, which margin of the table should be calculated the proportion, 1=row, 2=column

decimal.p

integer, the number of decimals of the p value

decimal.prop

integer, the number of decimals of the proportions for factor variables

Value

total

the descriptive statistic for all data

group names

the descriptive statistic for data of each group

method

the method applied to test between groups, i.e. ANOVA and Tukey, Fisher and FDR

statistic

the statistic of test, i.e., the 'W' to Wilcoxon test, the 'chi-squared' to Kruskal-Wallis, the 't' to t test, the 'F' to ANOVA test

p.value

the p value derived from the test between groups

stat.*_va_*

the statistic derived from the post hoc test, the 't' of Tukey for ANOVA, the 'q' of Nemenyi for Kruskal-Wallis

p.*_va_*

the p value derived from the post hoc test

Details

1. Nemenyi test was used as a Kruskal-Wallis post-hoc test.

2. FDR (False Discovery Rate) was used to adjust the p values after pairwise comparision of Chi-square test or Fisher test.

3. Tukey test was used as a ANOVA (Analysis of Variance) post-hoc test.

4. Shapiro-Wilk test was used as normality test if the sample size was between 3~5,000, while Kolmogorov-Smirnov test was used if the sample size was greater than 5,000.

Examples

Run this code
# NOT RUN {
group=rep(c(0,1),each=30)
nx1=rnorm(60)
nx2=rnorm(60)
fx1=rep(c(1:3),20)
fx2=rep(c(1:5),12)
fx3=factor(fx2)
data=data.frame(group,nx1,nx2,fx1,fx2,fx3)

easyDes(nc.g=1,nc.n=2:3,nc.f=4:5,nc.of=6,dataIn=data,
        fisher=TRUE,aov=FALSE,t=FALSE,mean=FALSE,mcp.stat=FALSE)
easyDes(nc.g=4,nc.n=2:3,nc.f=c(5,5),nc.of=6,dataIn=data,
        fisher=TRUE,aov=FALSE,t=FALSE,mean=FALSE,mcp.stat=FALSE)
easyDes(nc.g=4,nc.n=3,nc.f=5,nc.of=6,dataIn=data,
        fisher=TRUE,aov=FALSE,t=FALSE,mean=FALSE,mcp.stat=TRUE)
# }

Run the code above in your browser using DataLab