Skip to contents

[Experimental]

Calculate over and under-reporting probabilities for numerator denominator ratio using simaerep::simaerep().

Uses inframe simaerep method and does not apply multiplicity correction as per latest recommendations.

The sum of under- and over reporting probability per group is usually zero, however simaerep::simaerep() adjusts edge cases in which group ratio and expected ratio are all zero. We combine both metrics into a score between 0 and 1, where 0 is under-reporting and 1 is over-reporting.

Usage

Analyze_Simaerep(dfInput, r = 1000)

Arguments

dfInput

data.frame as returned by Input_CumCount()

r

Integer or tbl_object, number of repetitions for bootstrap simulation. Pass a tbl object referring to a table with one column and as many rows as desired repetitions. Default: 1000.

Value

data.frame with the following specification:

Column NameDescriptionType
GroupIDThe group IDCharacter
GroupLevelThe group levelCharacter
NumeratorNumerator eventsNumeric
DenominatorDenominator eventsNumeric
MetricExpectedExpected ratio from simulationsNumeric
MetricRatio all subjects in GroupIDNumeric
OverReportingProbabilityProbability over-reporting numerator eventsNumeric
UnderReportingProbabilityProbability under-reporting numerator eventsNumeric
ScoreCombined Score betweenNumeric

Examples

# {clindata} Example for cumulative AE per Visit Count
dfInput <- Input_CumCount(
  dfSubjects = clindata::rawplus_dm,
  dfNumerator = clindata::rawplus_ae,
  dfDenominator = clindata::rawplus_visdt %>% dplyr::mutate(visit_dt = lubridate::ymd(visit_dt)),
  strSubjectCol = "subjid",
  strGroupCol = "siteid",
  strGroupLevel = "Site",
  strNumeratorDateCol = "aest_dt",
  strDenominatorDateCol = "visit_dt"
)

Analyze_Simaerep(dfInput)
#> # A tibble: 176 × 9
#>    GroupID GroupLevel Numerator Denominator MetricExpected Metric
#>    <chr>   <chr>          <dbl>       <dbl>          <dbl>  <dbl>
#>  1 10      Site               8         390          0.162 0.0205
#>  2 100     Site               6          41          0.158 0.146 
#>  3 101     Site               4          64          0.165 0.0625
#>  4 102     Site               8          69          0.178 0.116 
#>  5 103     Site               8          86          0.163 0.0930
#>  6 104     Site              25         182          0.171 0.137 
#>  7 105     Site              24          65          0.165 0.369 
#>  8 106     Site               7          69          0.169 0.101 
#>  9 107     Site              14          63          0.161 0.222 
#> 10 109     Site               8          89          0.167 0.0899
#> # ℹ 166 more rows
#> # ℹ 3 more variables: OverReportingProbability <dbl>,
#> #   UnderReportingProbability <dbl>, Score <dbl>