
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,...)
mytable(x, ...)# S3 method for formula
mytable(x, ...)
# S3 method for data.frame
mytable(x, ...)
An R object, formula or data.frame
arguments to be passed to mytable_sub
formula
: S3 method for formula
data.frame
: S3 method for data.frame
# 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