add_death(), add_serious(), and add_fup() create outcome columns
in a vigibase dataset (typically demo), using data from the out
and followup tables.
These functions handle both in-memory and out-of-memory (Arrow) tables.
Usage
add_death(.data, out_data, col_name = "death")
add_serious(.data, out_data, col_name = "serious")
add_fup(.data, fup_data, col_name = "fup")Details
add_death()adds a column indicating whether the case resulted in death (i.e.,Seriousness == "1"in theouttable). Cases with no outcome data are codedNA. Cases with outcome data but no death are coded0. Cases with death are coded1.add_serious()adds a column indicating whether the case was serious (i.e.,Serious == "Y"in theouttable). Cases with no outcome data are codedNA. Cases with outcome data but not serious are coded0. Serious cases are coded1.add_fup()adds a column indicating whether the case has a follow-up (i.e.,UMCReportIdappears in thefollowuptable). Cases with a follow-up are coded1. Others are coded0.
Examples
demo <- demo_
out <- out_
demo <- add_death(demo, out_data = out)
#> ℹ `.data` detected as `demo` table.
demo <- add_serious(demo, out_data = out)
#> ℹ `.data` detected as `demo` table.
followup <- followup_
demo <- add_fup(demo, fup_data = followup)
#> ℹ `.data` detected as `demo` table.
desc_facvar(demo, c("death", "serious", "fup"))
#> # A tibble: 6 × 4
#> var level value n_avail
#> <chr> <chr> <chr> <int>
#> 1 death 0 612/747 (82%) 747
#> 2 death 1 135/747 (18%) 747
#> 3 serious 0 181/747 (24%) 747
#> 4 serious 1 566/747 (76%) 747
#> 5 fup 0 458/750 (61%) 750
#> 6 fup 1 292/750 (39%) 750
