Skip to contents

Attrition associated with an prevalence analysis

Usage

prevalenceAttrition(result)

Arguments

result

Result for which to get attrition

Value

tibble with counts and reasons for attrition.

Examples

# \donttest{
cdm <- mockIncidencePrevalenceRef(sampleSize = 200)
cdm <- generateDenominatorCohortSet(cdm, name = "denominator")
#>  Creating denominator cohorts
#>  Cohorts created in 0 min and 3 sec
prev <- estimatePointPrevalence(
  cdm = cdm,
  denominatorTable = "denominator",
  outcomeTable = "outcome"
)
#> Getting prevalence for analysis 1 of 1
#> Time taken: 0 mins and 0 secs
prevalenceAttrition(prev)
#> Warning: `prevalenceAttrition()` was deprecated in IncidencePrevalence 0.6.2.
#>  Please use `attrition()` instead.
#> # A tibble: 11 × 25
#>    analysis_id number_records number_subjects reason_id reason  excluded_records
#>    <chr>       <chr>          <chr>               <int> <chr>   <chr>           
#>  1 1           200            200                     1 Starti… NA              
#>  2 1           200            200                     2 Missin… 0               
#>  3 1           200            200                     3 Missin… 0               
#>  4 1           200            200                     4 Cannot… 0               
#>  5 1           200            200                     5 No obs… 0               
#>  6 1           200            200                     6 Doesn'… 0               
#>  7 1           200            200                     7 Prior … 0               
#>  8 1           191            191                    10 No obs… 9               
#>  9 1           191            191                    11 Starti… NA              
#> 10 1           191            191                    12 Not ob… 0               
#> 11 1           191            191                    14 Do not… 0               
#> # ℹ 19 more variables: excluded_subjects <chr>, outcome_cohort_id <int>,
#> #   outcome_cohort_name <chr>, analysis_type <chr>, analysis_interval <chr>,
#> #   analysis_complete_database_intervals <lgl>, analysis_time_point <chr>,
#> #   analysis_full_contribution <lgl>, analysis_min_cell_count <dbl>,
#> #   denominator_cohort_id <int>, denominator_cohort_name <chr>,
#> #   denominator_age_group <chr>, denominator_sex <chr>,
#> #   denominator_days_prior_observation <dbl>, denominator_start_date <date>, …
# }