Learn R Programming

IncidencePrevalence (version 1.1.0)

tablePrevalence: Table of prevalence results

Description

Table of prevalence results

Usage

tablePrevalence(
  result,
  type = "gt",
  header = c("estimate_name"),
  groupColumn = c("cdm_name", "outcome_cohort_name"),
  settingsColumn = c("denominator_age_group", "denominator_sex"),
  hide = c("denominator_cohort_name", "analysis_interval"),
  .options = list()
)

Value

Table of prevalence results

Arguments

result

Prevalence results

type

Type of table. Can be "gt", "flextable", or "tibble"

header

A vector specifying the elements to include in the header. The order of elements matters, with the first being the topmost header. The header vector can contain one of the following variables: "cdm_name", "denominator_cohort_name", "outcome_cohort_name", "prevalence_start_date", "prevalence_end_date", "estimate_name", variables in the strata_name column, and any of the settings columns specified in settingsColumn argument. The header can also include other names to use as overall header labels

groupColumn

Variables to use as group labels. Allowed columns are the same as in header

settingsColumn

Variables from the settings attribute to display in the table

hide

Table columns to exclude, options are the ones described in header

.options

Table options to apply

Examples

Run this code
# \donttest{
cdm <- mockIncidencePrevalence(sampleSize = 1000)
cdm <- generateDenominatorCohortSet(
  cdm = cdm,
  name = "denominator",
  cohortDateRange = c(as.Date("2008-01-01"), as.Date("2018-01-01"))
)
prev <- estimatePointPrevalence(
  cdm = cdm,
  denominatorTable = "denominator",
  outcomeTable = "outcome",
  interval = "months"
)
tablePrevalence(prev)
# }

Run the code above in your browser using DataLab