knitr::opts_chunk$set(
collapse = TRUE,
comment = "."
)

These functions create summary tables for continuous data. There is a long format and a wide format.

Long format

library(pmtables)
library(dplyr)

id <- pmtables:::data("id") 

A summary of covariates

pt_cont_long(id, cols = "WT,ALB,SCR")

Paneled summary

Use the panel argument to split this by, for example, study

pt_cont_long(
  id, 
  cols = "WT,ALB,SCR",
  panel = vars(Study = STUDYf)
)

Wide format

There is also a wide format, where variable names go across the table.

pt_cont_wide(id, cols = "WT,ALB,SCR")

We can use the by argument here

pt_cont_wide(id,cols="WT,ALB,SCR",by = vars(Study = STUDYf))

Or use by and panel

pt_cont_wide(
  id,
  cols=vars(WT,ALB,SCR),
  by = vars(Study = STUDYf),
  panel=vars(Sex = SEXf)
)


metrumresearchgroup/pmtables documentation built on Oct. 27, 2024, 5:16 p.m.