Git Product home page Git Product logo

rifttable's Introduction

Automated, Reproducible Generation of Results Tables: Bridging the Rift Between Epidemiologists and Their Data

R-CMD-check

Tables are the key format in which epidemiologists present their results. Many results tables in applied studies merely show point estimates and confidence intervals, or even p-values, from regression models: a “growing rift between epidemiologists and their data” (Rothman 2017). “Actual,” descriptive data, such as counts stratified by exposure and a main confounder or effect modifier, are often lacking.

rifttable creates presentation-ready results tables for epidemiologists in an automated, reproducible fashion. The user provides the final analytical dataset and specifies the design of the table, with rows and/or columns defined by exposure(s), effect modifier(s), and estimands as desired, allowing to show descriptors and inferential estimates in one table – bridging the rift between epidemiologists and their data, one table at a time.

Installation

You can install the development version of rifttable directly from GitHub:

remotes::install_github("stopsack/rifttable")

The installation procedure requires the {remotes} package, obtainable via install.packages("remotes").

Example

library(rifttable)

example_design <- tibble::tribble(
  ~label,                       ~type,                   ~stratum,         
  "Overall",                    "",                      "",               
  "– Deaths/N",                 "outcomes/total",        c("Low", "High"), 
  "– Risk",                     "risk",                  c("Low", "High"), 
  "– Risk ratio (95% CI)",      "rr",                    c("Low", "High"), 
  "– Risk difference (95% CI)", "rd",                    c("Low", "High"), 
  "",                           "",                      "",               
  "Low hormone receptor",       "",                      "",               
  "– Deaths/N (Risk)",          "outcomes/total (risk)", "Low",           
  "– Risk difference (95% CI)", "rd",                    "Low",           
  "High hormone receptor",      "",                      "",               
  "– Deaths/N (Risk)",          "outcomes/total (risk)", "High",
  "– Risk difference (95% CI)", "rd",                    "High") %>%
  dplyr::mutate(
    exposure = "stage",
    outcome = "death",
    effect_modifier = "receptor")

rifttable(
  design = example_design,
  data = risks::breastcancer)
Stage Stage I Stage II Stage III
Overall
– Deaths/N 7/67 26/96 21/29
– Risk 0.10 0.27 0.72
– Risk ratio (95% CI) 1 (reference) 2.59 (1.20, 5.6) 6.9 (3.3, 14)
– Risk difference (95% CI) 0 (reference) 0.17 (0.05, 0.28) 0.62 (0.44, 0.80)
Low hormone receptor
– Deaths/N (Risk) 2/12 (0.17) 9/22 (0.41) 12/14 (0.86)
– Risk difference (95% CI) 0 (reference) 0.24 (-0.05, 0.54) 0.69 (0.41, 0.97)
High hormone receptor
– Deaths/N (Risk) 5/55 (0.09) 17/74 (0.23) 9/15 (0.60)
– Risk difference (95% CI) 0 (reference) 0.14 (0.02, 0.26) 0.51 (0.25, 0.77)

For more examples, see the Get Started vignette.

rifttable's People

Contributors

stopsack avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.