pharmaverse examples
  1. TLG
  • Introduction

  • SDTM
    • DM
    • VS
    • AE
  • ADaM
    • ADSL
    • ADVS
    • ADAE
    • ADRS
    • ADTTE
    • ADPC
    • ADPPK
  • TLG
    • Demographic Table
    • Adverse Events
    • Pharmacokinetic
  • Documents
    • Slides
    • Documents
  • Interactive
    • teal applications
  • Logs
    • The Difference Between logr, logrx, and whirl
  • eSubmission
    • eSubmission

  • Session Info
  • Pharmaverse Home

TLG

Overview

This section demonstrates how to create Tables, Listings, and Graphs (TLGs) for clinical study reporting using pharmaverse packages. TLGs are essential components of clinical study reports and regulatory submissions, providing clear presentation of study results.

The examples showcase two distinct approaches for generating publication-quality outputs, working with ADaM datasets as input.

Which Approach Should I Use?

Analysis Results Datasets (ARDs) 🆕

Best for:

  • Organizations implementing the CDISC Analysis Results Standard
  • Teams wanting reusable, structured analysis results
  • Projects requiring multiple output formats from the same statistics
  • Regulatory submissions emphasizing data standardization and traceability
  • Separating statistical computation from table formatting

Packages: {cards}, {tfrmt}, {gtsummary}

Workflow: Data → ARD (structured statistics) → Formatted Table

Classic Direct Summarization 📊

Best for:

  • Quick ad-hoc analyses and exploratory work
  • Teams familiar with traditional R table packages
  • Complex nested layouts requiring fine-grained control
  • Existing workflows using {rtables}/{tern}
  • Single-purpose table generation

Packages: {rtables}, {tern}

Workflow: Data → Formatted Table (single step)

TipGetting Started

Both approaches produce publication-quality outputs - the choice depends on your workflow and organizational standards. ARDs represent the emerging standard for structured analysis results, while the classic approach offers a mature, stable ecosystem with extensive layout capabilities.

Examples by Approach

Using Analysis Results Datasets (ARDs)

These examples leverage the CDISC Analysis Results Standard, creating structured ARDs first using {cards}, then formatting them into tables. This two-step approach promotes reusability, standardization, and separation of statistical computation from presentation.

Demographic Tables

  • {cards} + {gtsummary} - Build demographics from ARDs with bidirectional workflow (ARD → Table or Table → ARD)
  • {cards} + {tfrmt} - Create highly customized demographic tables from ARDs

Adverse Events Tables

  • {cards} + {tfrmt} - Generate AE summaries with hierarchical organization and custom formatting

Classic Direct Summarization

These examples create tables directly from analysis datasets using the traditional single-step approach with {rtables} and {tern}.

Demographic Tables

  • {rtables} + {tern} - Comprehensive demographic and baseline characteristics summaries

Adverse Events Tables

  • {rtables} + {tern} - AE summaries with frequency counts, percentages, and system organ class groupings

Listings & Graphs

  • Pharmacokinetic Outputs - Concentration-time graphs and parameter summaries

Quick Reference Table

Table Type ARD Approach Classic Approach
Demographics {cards} + {gtsummary}
{cards} + {tfrmt}
{rtables} + {tern}
Adverse Events {cards} + {tfrmt} {rtables} + {tern}
PK Outputs Coming soon View example

Key Packages Used

ARD Ecosystem

  • {cards} - Create and manipulate Analysis Results Datasets following CDISC standards
  • {tfrmt} - Transform ARDs into publication-ready tables with precise formatting control
  • {gtsummary} - Generate listings or summary tables (with or without ARDs) with support for multiple output formats

Classic Ecosystem

  • {rlistings} - Create regulatory ready listings for health authority review
  • {rtables} - Create complex tables with flexible layouts and nested structures
  • {tern} - Analysis and reporting functions specifically designed for clinical trials

Graphics

  • {ggplot2} - Publication-quality graphics for all approaches

What Each Example Includes

All examples provide complete, reproducible code with:

  • Data preprocessing and preparation steps
  • Summary statistics calculation
  • Table or graph generation with detailed explanations
  • Formatting and styling for publication-ready output
  • Comments and best practices

All examples use ADaM datasets from {pharmaverseadam} as input, ensuring consistency and reproducibility.

Learn More

NoteResources
  • CDISC Analysis Results Standard - Official standard documentation
  • {cards} package documentation - Learn more about creating ARDs
  • {gtsummary} package documentation - Learn more about creating summary tables
  • {tfrmt} package documentation - Advanced table formatting with ARDs
  • {rtables} package documentation - Comprehensive table creation guide
ADPPK
Demographic Table
Source Code
---
title: "TLG"
---

## Overview

This section demonstrates how to create Tables, Listings, and Graphs (TLGs) for clinical study reporting using pharmaverse packages. TLGs are essential components of clinical study reports and regulatory submissions, providing clear presentation of study results.

The examples showcase **two distinct approaches** for generating publication-quality outputs, working with ADaM datasets as input.

## Which Approach Should I Use?

### Analysis Results Datasets (ARDs) 🆕

**Best for:**

-   Organizations implementing the CDISC Analysis Results Standard
-   Teams wanting reusable, structured analysis results
-   Projects requiring multiple output formats from the same statistics
-   Regulatory submissions emphasizing data standardization and traceability
-   Separating statistical computation from table formatting

**Packages:** `{cards}`, `{tfrmt}`, `{gtsummary}`

**Workflow:** Data → ARD (structured statistics) → Formatted Table

### Classic Direct Summarization 📊

**Best for:**

-   Quick ad-hoc analyses and exploratory work
-   Teams familiar with traditional R table packages
-   Complex nested layouts requiring fine-grained control
-   Existing workflows using `{rtables}`/`{tern}`
-   Single-purpose table generation

**Packages:** `{rtables}`, `{tern}`

**Workflow:** Data → Formatted Table (single step)

::: {.callout-tip}
## Getting Started

Both approaches produce publication-quality outputs - the choice depends on your workflow and organizational standards. ARDs represent the emerging standard for structured analysis results, while the classic approach offers a mature, stable ecosystem with extensive layout capabilities.
:::

## Examples by Approach

### Using Analysis Results Datasets (ARDs)

These examples leverage the CDISC Analysis Results Standard, creating structured ARDs first using `{cards}`, then formatting them into tables. This two-step approach promotes reusability, standardization, and separation of statistical computation from presentation.

#### Demographic Tables

-   **[{cards} + {gtsummary}](demographic.qmd#gtsummary-cards)** - Build demographics from ARDs with bidirectional workflow (ARD → Table or Table → ARD)
-   **[{cards} + {tfrmt}](demographic.qmd#tfrmt-cards)** - Create highly customized demographic tables from ARDs

#### Adverse Events Tables

-   **[{cards} + {tfrmt}](adverse_events.qmd#tfrmt-cards)** - Generate AE summaries with hierarchical organization and custom formatting

------------------------------------------------------------------------

### Classic Direct Summarization

These examples create tables directly from analysis datasets using the traditional single-step approach with `{rtables}` and `{tern}`.

#### Demographic Tables

-   **[{rtables} + {tern}](demographic.qmd#rtables-tern)** - Comprehensive demographic and baseline characteristics summaries

#### Adverse Events Tables

-   **[{rtables} + {tern}](adverse_events.qmd#rtables-tern)** - AE summaries with frequency counts, percentages, and system organ class groupings

------------------------------------------------------------------------

### Listings & Graphs

-   **[Pharmacokinetic Outputs](pharmacokinetic.qmd)** - Concentration-time graphs and parameter summaries

## Quick Reference Table

| Table Type | ARD Approach | Classic Approach |
|--------------------|-----------------------|-----------------------------|
| **Demographics** | [{cards} + {gtsummary}](demographic.qmd#gtsummary-cards)<br/>[{cards} + {tfrmt}](demographic.qmd#tfrmt-cards) | [{rtables} + {tern}](demographic.qmd#rtables-tern) |
| **Adverse Events** | [{cards} + {tfrmt}](adverse_events.qmd#tfrmt-cards) | [{rtables} + {tern}](adverse_events.qmd#rtables-tern) |
| **PK Outputs** | *Coming soon* | [View example](pharmacokinetic.qmd) |

## Key Packages Used

### ARD Ecosystem

-   **`{cards}`** - Create and manipulate Analysis Results Datasets following CDISC standards
-   **`{tfrmt}`** - Transform ARDs into publication-ready tables with precise formatting control
-   **`{gtsummary}`** - Generate listings or summary tables (with or without ARDs) with support for multiple output formats

### Classic Ecosystem

-   **`{rlistings}`** - Create regulatory ready listings for health authority review
-   **`{rtables}`** - Create complex tables with flexible layouts and nested structures
-   **`{tern}`** - Analysis and reporting functions specifically designed for clinical trials

### Graphics

-   **`{ggplot2}`** - Publication-quality graphics for all approaches

## What Each Example Includes

All examples provide complete, reproducible code with:

-   Data preprocessing and preparation steps
-   Summary statistics calculation
-   Table or graph generation with detailed explanations
-   Formatting and styling for publication-ready output
-   Comments and best practices

All examples use ADaM datasets from `{pharmaverseadam}` as input, ensuring consistency and reproducibility.

## Learn More

::: {.callout-note}
## Resources

-   [CDISC Analysis Results Standard](https://www.cdisc.org/standards/foundational/analysis-results-standard) - Official standard documentation
-   [{cards} package documentation](https://insightsengineering.github.io/cards/) - Learn more about creating ARDs
-   [{gtsummary} package documentation](https://www.danieldsjoberg.com/gtsummary) - Learn more about creating summary tables
-   [{tfrmt} package documentation](https://gsk-biostatistics.github.io/tfrmt/) - Advanced table formatting with ARDs
-   [{rtables} package documentation](https://insightsengineering.github.io/rtables/) - Comprehensive table creation guide
:::
 
Cookie Preferences