Skip to contents

Creates a table with the incidence rates and optionally demographics

Usage

viewIncidenceRate(
  incidenceData,
  ageData = NULL,
  genderData = NULL,
  stratification = "overall",
  maxAgeSampleSize = 5000
)

Arguments

incidenceData

The data extracted using 'getIncidenceRates'

ageData

The data extracted using 'getBinaryTargetBaseline' with analysisIds = 3

genderData

The data extracted using 'getBinaryTargetBaseline' with analysisIds = 1

stratification

Pick either overall/age/sex/year to specify whether to view the overall rates or stratified by age/sex/year

maxAgeSampleSize

When creating the age distributions this is the max age vector length to create

Value

Returns a gt table that displays the incidence rates

Details

Input the incidence rate data (and optionally demographic data)

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)
#> Connecting using SQLite driver
schema <- 'main'

incidenceData <- getIncidenceRates(
  connectionHandler = connectionHandler , 
  schema = schema
  )
  
  # incidence data does not have rate values to imputing them
  incidenceData$incidenceRateP100py <- 1 +
    sample(c(-1,1),replace = TRUE)*runif(nrow(incidenceData))
  incidenceData$incidenceProportionP100p <- 0.5 +
    sample(c(-1,1),replace = TRUE)*runif(nrow(incidenceData))
  
 ageData <- getBinaryTargetBaseline(
  connectionHandler = connectionHandler, 
  schema = schema,  
  analysisIds = 3
 )
 
 genderData <- getBinaryTargetBaseline(
  connectionHandler = connectionHandler, 
  schema = schema,  
  analysisIds = 1
 )

viewIncidenceRate(
  incidenceData = incidenceData,
  ageData = ageData,
  genderData = genderData
  )
#> Closing database connection
#> Closing database connection
Database Rate per 100 person years Proportion per 100 persons N Mean Follow-up Days Outcomes Age Male %
- GI bleed ( wo 9999) during ( start + 0 ) - ( end + 0 )
Celecoxib ( 1 ) Synthea 0.022 1.191 1800 1 0 49.7
Celecoxib - age 18 to 64 Age 18 to 64 ( 1001 ) Synthea 0.202 1.429 1800 1 0 49.7
Diclofenac ( 2 ) Synthea 0.181 0.707 830 1 0 47.6
Diclofenac - age 18 to 64 Age 18 to 64 ( 2001 ) Synthea 0.815 1.012 830 1 0 47.6
- GI bleed ( wo 9999) during ( start + 0 ) - ( start + 365 )
Celecoxib ( 1 ) Synthea 0.634 0.807 1800 300 0 49.7
Celecoxib - age 18 to 64 Age 18 to 64 ( 1001 ) Synthea 0.667 1.364 1800 300 0 49.7
Diclofenac ( 2 ) Synthea 1.846 1.481 830 314 0 47.6
Diclofenac - age 18 to 64 Age 18 to 64 ( 2001 ) Synthea 1.125 0.885 830 314 0 47.6