athowes / multi-agyw

Spatio-temporal estimates of HIV risk group proportions for AGYW across 13 priority countries in sub-Saharan Africa
https://athowes.github.io/multi-agyw
MIT License
2 stars 2 forks source link

Add PHIA surveys #41

Closed athowes closed 2 years ago

athowes commented 2 years ago
athowes commented 2 years ago
athowes commented 2 years ago

The relevant PHIA surveys are:

athowes commented 2 years ago

The steps needed I think are:

  1. Access all the prior objects like survey_meta survey_regions
  2. Transform them to have the same structure as DHS surveys (following this example)
  3. See if they can be merged together with DHS versions (e.g. a bind_rows) to use one call of calc_survey_indicators
athowes commented 2 years ago

Want to replicate this section of create_sexbehav_dhs (including the Adam adjustments at the end)

athowes commented 2 years ago

To-do on this tomorrow:

athowes commented 2 years ago

Based on the below call, it looks like everyone who is in not exactly one category is in none of them. Hopeful that this can be fixed.

> survey_sexbehav %>%
+   mutate(
+     r_tot = nosex12m + sexcohab + sexnonreg + sexpaid12m
+   ) %>%
+   filter(
+     r_tot != 1
+   ) %>%
+   summary()
  survey_id         individual_id          sex12m     nosex12m    sexcohab   sexnonreg   sexpaid12m sexnonregplus     r_tot  
 Length:119         Length:119         Min.   :1   Min.   :0   Min.   :0   Min.   :0   Min.   :0    Min.   :0     Min.   :0  
 Class :character   Class :character   1st Qu.:1   1st Qu.:0   1st Qu.:0   1st Qu.:0   1st Qu.:0    1st Qu.:0     1st Qu.:0  
 Mode  :character   Mode  :character   Median :1   Median :0   Median :0   Median :0   Median :0    Median :0     Median :0  
                                       Mean   :1   Mean   :0   Mean   :0   Mean   :0   Mean   :0    Mean   :0     Mean   :0  
                                       3rd Qu.:1   3rd Qu.:0   3rd Qu.:0   3rd Qu.:0   3rd Qu.:0    3rd Qu.:0     3rd Qu.:0  
                                       Max.   :1   Max.   :0   Max.   :0   Max.   :0   Max.   :0    Max.   :0     Max.   :0
athowes commented 2 years ago

Let NIQ be "not in questionnaire". Here are the list of deviations away from LEPHIA, probably need to be dealt with a bit manually:

Survey Variable Issue Fixed?
ZimPHIA analsxever sex is defined as either anal or vaginal Y: removed check for anal sex
ZimPHIA lifetimesex, lifetimesexdk NIQ Y: not using
ZimPHIA part12modkr called part12monumdk instead Y
ZamPHIA analsxever called ansxfrstage instead Y: removed check for anal sex
ZamPHIA lifetimesex, lifetimesexdk called partlifetm, partlifetmdk instead Y: not using
ZamPHIA part12monum called part12mo instead Y
UPHIA analsxever sex is defined as either anal or vaginal Y: removed check for anal sex
UPHIA sellsx12mo NIQ Y
UPHIA buysx12mo NIQ Y
THIS lifetimesex, lifetimesexdk NIQ Y: not using
THIS partlastsxtimed1, partlastsxtimed2, partlastsxtimed3 NIQ Y: not using
SHIMS2 sellsx12mo in questionnaire but not in our ind extract (why?) Y (email pending)
NAMPHIA analsxever has kindsex_a, kindsex_b, ... instead. Also skips section if no vaginal sex Y: removed check for anal sex
NAMPHIA partlastsxtimed1, partlastsxtimed2, partlastsxtimed3 NIQ Y
MPHIA analsxever called ansxyn instead Y: removed check for anal sex
MPHIA lifetimesex, lifetimesexdk NIQ Y: not using
MPHIA part12modkr called part12monumdk instead Y
CAMPHIA analsxever ever had sex defined via evrhdsx "Sex can be when a penis enters a vagina, when a penis enters an anus, or when a person puts his/her mouth on the penis or vagina of another person." Y: removed check for anal sex
CAMPHIA partlastsxtimed1, partlastsxtimed2, partlastsxtimed3 NIQ Y: not using
CAMPHIA sellsx12mo NIQ Y
athowes commented 2 years ago

Running through the combination pipeline for ZWE as example:

athowes commented 2 years ago
athowes commented 2 years ago

aaa_survey_behav failed on the following. Find way to fix:

athowes commented 2 years ago

The PHIA part of this is done, so closing and adding new issue relating to adding new DHS surveys back to 1994 #46

athowes commented 2 years ago
athowes commented 2 years ago

Fixed those zeros in sexcohab by changing the sexbehav-vars-adam branch of naomi.utils. All good now I think!