moonBook (version 0.3.1)

mytable: Produce table for descriptive statistics

Description

Produce table for descriptive statistics by groups for several variables easily. Depending on the nature of these variables, different descriptive statistical methods were used(t-test, ANOVA,Kruskal-Wallis, chisq, Fisher,...)

Usage

mytable(x, ...)

# S3 method for formula mytable(x, ...)

# S3 method for data.frame mytable(x, ...)

Arguments

x

An R object, formula or data.frame

...

arguments to be passed to mytable_sub

Methods (by class)

  • formula: S3 method for formula

  • data.frame: S3 method for data.frame

Examples

Run this code
# NOT RUN {
mytable(acs)
mytable(~age+sex,data=acs)
mytable(Dx~age+sex+height+weight+TC+TG+HDLC,data=acs,method=3,digits=2)
mytable(am+cyl~.,data=mtcars)
out=mytable(sex~.,data=acs)
out
summary(out)
# }
# NOT RUN {
require(ztable)
ztable(out)
# }
# NOT RUN {
mytable(acs)
# }

Run the code above in your browser using DataLab