knitr::opts_chunk$set(echo = TRUE)
units <- list(WT = "(kg)", BMI = "(kg/m2)", CRCL = "(mL/min)")
table <- list(WT = "weight", BMI = "body mass index", 
              CRCL = "creatinine clearance")
library(dplyr)
library(mrggt)
library(pmtables)
data <- pmtables:::data("id")

Continuous covariates

Long

pt_cont_long(
  data, 
  cols = "WT,BMI,CRCL", 
  panel = vars(Study = STUDYf), 
  units = units, 
  table = table
)

Wide

pt_cont_wide(
  data, 
  cols = "WT,BMI,CRCL", 
  by = vars(Study = STUDYf), 
  units = units, 
  table = table
)
pt_cont_wide(
  data, 
  cols = "WT,BMI,CRCL", 
  by = vars(Study = STUDYf), 
  panel = vars(Race = ASIANf),
  units = units, 
  table = table
)

Categorical covariates

Long

pt_cat_long(
  data, 
  cols = vars(Sex = SEXf, "Renal function" = RFf, Formulation = FORMf), 
  span = vars(Study = STUDYf),
  table = table
)

Wide

pt_cat_wide(
  data, 
  cols = vars(Sex = SEXf, "Renal function" = RFf), 
  by = vars(Race = ASIANf),
  panel = vars(Formulation = FORMf),
  table = table
)

Data inventory

obs <- pmtables:::data("obs") %>% filter(SEQ==1)
count(obs,is.na(DV),BQL)
pt_data_inventory(
  obs, 
  by = vars(Study = STUDYf)
)
pt_data_inventory(
  obs, 
  panel = vars(Study = STUDYf), 
  by = vars("Renal function" = RFf)
)
obs <- pmtables:::data("obs")

pt_data_inventory(
  obs, 
  panel = vars(Endpoint = SEQf),
  by = vars(Study = STUDYf),
  stacked = TRUE
)

Parameter table

{width=90%}



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