lhtab2 | R Documentation |
Generate descriptive statistic of continuous variable with style
lhtab2(
data,
sort.by = c("AGEGRP"),
cont = c("WT", "C6h", "Cmax", "Cavg"),
stats = c("length(x[!is.na(x)])=N", "length(x[is.na(x)])=Nmiss", "geom(x)=GeoMean",
"median(x,na.rm=T)=Median", "quantile(x,0.5,na.rm=T)=50thPI", "mean(x,na.rm=T)=Mean",
"cv(x)=CV%", "min(x)=Min", "max(x)=Max", "geocv(x)=GeoCV%"),
stat.group = list(c("N", " (", "Nmiss", ")"), c("Mean", " (", "CV%", ")"), c("Median",
" [", "Min", ", ", "Max", "]"), c("GeoMean", " (", "GeoCV%", ")")),
render = "flextable",
overall = "yes",
format = "stacked"
)
data |
dataset |
sort.by |
sorting variables |
cont |
list of continuous variables |
stats |
statistic functions. stat1 contained most of basic statistic function (mean, median up to CI95). User can define personal list of function (ex: c("length(x)/mean(x)=RT")) |
render |
the output format as flexible table "flex", as "csv". Note that officer package is required for the word format and save the output as docx (ex: print(doc,"table1.docx)) |
overall |
if the overall stats required then overall="yes" |
format |
two formats available, stacked or not |
cat |
list of categorical variables |
fun |
define the output |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.