Wrapper for Performing Age-Sex Male-Female Data Quality Checks

do_qualitychecks(
  XY,
  XX,
  fn = c("sexRatioScore", "ageSexAccuracy", "ageSexAccuracyDasGupta"),
  verbose = TRUE,
  ...
)

Arguments

XY

Input data for male population. UN format.

XX

Input data for female population. UN format.

fn

Method to be called from DemoTools. Available aternatives: "sexRatioScore", "ageSexAccuracy", "ageSexAccuracyDasGupta".

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.

Value

A data.frame having the same number of columns as input data. Different numbers of rows. UN format.

Examples

M5 <- DDSQLtools.data$Pop5_Egypt_M_DB
F5 <- DDSQLtools.data$Pop5_Egypt_F_DB

Q1 <- do_qualitychecks(M5, F5, fn = "sexRatioScore")
#> Additional (optional) arguments to control the output for the DemoTools::sexRatioScore method:
#> ageMin ageMax
#> Check ?sexRatioScore for details and default values.
Q2 <- do_qualitychecks(M5, F5, fn = "ageSexAccuracy")
#> Additional (optional) arguments to control the output for the DemoTools::ageSexAccuracy method:
#> ageMin ageMax method adjust
#> Check ?ageSexAccuracy for details and default values.
Q3 <- do_qualitychecks(M5, F5, fn = "ageSexAccuracyDasGupta")
#> Additional (optional) arguments to control the output for the DemoTools::ageSexAccuracyDasGupta method:
#> ageMin ageMax
#> Check ?ageSexAccuracyDasGupta for details and default values.

select_columns <- c("AgeID", "AgeStart", "AgeMid", "AgeEnd", "AgeLabel",
                    "DataTypeName", "DataTypeID", "DataValue")
Q <- rbind(Q1, Q2, Q3)
Q[, select_columns]
#> # A tibble: 3 × 8
#>   AgeID AgeStart AgeMid AgeEnd AgeLabel DataTypeName   DataTypeID      DataValue
#>   <dbl>    <dbl>  <dbl>  <dbl> <chr>    <chr>          <chr>               <dbl>
#> 1    NA        0     50     75 0-75+    DemoTools::se… "do_qualityche…      4.91
#> 2    NA        0     50     75 0-75+    DemoTools::ag… "do_qualityche…     24.5 
#> 3    NA        0     50     75 0-75+    DemoTools::ag… "do_qualityche…      5.64