Wrapper for Age-Heaping Methods

do_heaping(
  X,
  fn = c("Whipple", "Myers", "Bachi", "CoaleLi", "Noumbissi", "Spoorenberg",
    "ageRatioScore", "KannistoHeap", "Jdanov"),
  verbose = TRUE,
  ...
)

Arguments

X

Input data. UN format.

fn

Method to be called from DemoTools. Available alternatives: "beers", "grabill", "sprague".

verbose

Logical value. If TRUE messages are printed as the method is applied. Set verbose = FALSE to silent the function.

...

Other arguments to be passed on to other methods and functions.

Examples

P1 <- DDSQLtools.data$Pop1_Egypt_M_DB

H1 <- do_heaping(P1, fn = "Whipple")
#> Additional (optional) arguments to control the output for the DemoTools::check_heaping_whipple method:
#> ageMin ageMax digit
#> Check ?check_heaping_whipple for details and default values.
H2 <- do_heaping(P1, fn = "Myers")
#> Additional (optional) arguments to control the output for the DemoTools::check_heaping_myers method:
#> ageMin ageMax details method
#> Check ?check_heaping_myers for details and default values.
H3 <- do_heaping(P1, fn = "Bachi")
#> Additional (optional) arguments to control the output for the DemoTools::check_heaping_bachi method:
#> ageMin ageMax method details
#> Check ?check_heaping_bachi for details and default values.
H4 <- do_heaping(P1, fn = "CoaleLi")
#> Additional (optional) arguments to control the output for the DemoTools::check_heaping_coale_li method:
#> ageMin ageMax terms digit
#> Check ?check_heaping_coale_li for details and default values.
H5 <- do_heaping(P1, fn = "Noumbissi")
#> Additional (optional) arguments to control the output for the DemoTools::check_heaping_noumbissi method:
#> ageMin ageMax digit
#> Check ?check_heaping_noumbissi for details and default values.
H6 <- do_heaping(P1, fn = "Spoorenberg")
#> Additional (optional) arguments to control the output for the DemoTools::check_heaping_spoorenberg method:
#> ageMin ageMax
#> Check ?check_heaping_spoorenberg for details and default values.
H7 <- do_heaping(P1, fn = "ageRatioScore")
#> Additional (optional) arguments to control the output for the DemoTools::ageRatioScore method:
#> ageMin ageMax method
#> Check ?ageRatioScore for details and default values.
H8 <- do_heaping(P1, fn = "KannistoHeap")
#> Additional (optional) arguments to control the output for the DemoTools::check_heaping_kannisto method:
#> Agei pow
#> Check ?check_heaping_kannisto for details and default values.
H9 <- do_heaping(P1, fn = "Jdanov")
#> Additional (optional) arguments to control the output for the DemoTools::check_heaping_jdanov method:
#> Agei
#> Check ?check_heaping_jdanov for details and default values.

H <- rbind(H1, H2, H3, H4, H5, H6, H7, H8, H9)
select_columns <- c("AgeID", "AgeStart", "AgeMid", "AgeEnd", "AgeLabel",
                    "DataTypeName", "DataTypeID", "DataValue")
H[, select_columns]
#> # A tibble: 9 × 8
#>   AgeID AgeStart AgeMid AgeEnd AgeLabel DataTypeName    DataTypeID     DataValue
#>   <dbl>    <dbl>  <dbl>  <dbl> <chr>    <chr>           <chr>              <dbl>
#> 1    NA        0   52.5     99 0-99+    DemoTools::che… "do_heaping(X…      1.78
#> 2    NA        0   52.5     99 0-99+    DemoTools::che… "do_heaping(X…     18.2 
#> 3    NA        0   52.5     99 0-99+    DemoTools::che… "do_heaping(X…     17.4 
#> 4    NA        0   52.5     99 0-99+    DemoTools::che… "do_heaping(X…      2.52
#> 5    NA        0   52.5     99 0-99+    DemoTools::che… "do_heaping(X…      1.51
#> 6    NA        0   52.5     99 0-99+    DemoTools::che… "do_heaping(X…      2.80
#> 7    NA        0   52.5     99 0-99+    DemoTools::age… "do_heaping(X…     72.6 
#> 8    NA        0   52.5     99 0-99+    DemoTools::che… "do_heaping(X…      4.20
#> 9    NA        0   52.5     99 0-99+    DemoTools::che… "do_heaping(X…    228.  

# Silence the function with verbose = FALSE
H1 <- do_heaping(P1, fn = "Whipple", verbose = FALSE)
# ... or by specifying all arguments
H1 <- do_heaping(P1, fn = "Whipple", ageMin = 10, ageMax = 90, digit = 1)