lhtab2: Descriptive Statistics Continuous with Style

lhtab2R Documentation

Descriptive Statistics Continuous with Style

Description

Generate descriptive statistic of continuous variable with style

Usage

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"
)

Arguments

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


leonpheng/lhtool2 documentation built on April 13, 2025, 5:42 p.m.