Description Usage Arguments Examples
View source: R/TABLE.twotoone.r
This function combines two elements into one in a format as "Mean (SD)". It converts the outputs of sumstat to a simplified format, which is ready for publishing through markdown.
1 | twotoone(a)
|
a |
The input should be a summary table, whose columns are the stratifying groups and rows are pairs of variablew in the format of "variable.Mean", "variable.SD"...etc. |
1 2 3 4 5 6 7 8 9 10 | library(data.table)
library(ifaR.handtool)
dt<-data.table(grp=rep(c("Control", "Treatment"), each=50),
time=rep(c("Base", "Follow", "Base", "Follow"), each=25),
age=rnorm(100, mean=65, sd=10),bmi=rnorm(100, mean=28, sd=4),
leanmass=rnorm(100, mean=65, sd=6))
dt$leanmass[95]<-NA
tab1<-sumtbl(dt, c("age", "bmi", "leanmass"), c("grp", "time"), n=F, mu=T, s=T, q=NULL)
twotoone(tab1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.