USAID-OHA-SI / TeamTracking

Project Management Tracker for the SI Team
0 stars 0 forks source link

week 2 data pack target extraction, add fy19 targets #116

Open jaliasd opened 5 years ago

jaliasd commented 5 years ago

Per Elan's request, create a file that has

COP19 datapack targets for TX_NEW, TX_CURR, HTS_TST, and HTS_TST_POS, at the OU by IM level

the FY19 targets at the same aggragation from the MER structured datasets.

I pulled the targets from the MSD and merged them into the munged datapack targets

code here

jrose202 commented 5 years ago

is there an output file somewhere that we can download?

achafetz commented 5 years ago

Heads up with your code @jaliasd, you are aggregating ALL of HTS_TST for df_hts and df_pos. You need to first drop out the KP disaggs, otherwise you're double counting.

## create HTS frm all week2 dps, summarize at im/indicator level
df_hts <- cascade %>% 
  filter(indicator == "HTS_TST") 

df_hts_tst <- df_hts %>%
  group_by(mechanismid, indicator) %>% 
  summarise_at(vars(fy2020_targets), sum, na.rm = TRUE) %>% 
  ungroup() 

df_pos <- df_hts %>%
  group_by(mechanismid, indicator, resultstatus) %>% 
  summarise_at(vars(fy2020_targets), sum, na.rm = TRUE) %>%
  ungroup() %>% 
  dplyr::mutate(indicator = dplyr::case_when(resultstatus == "Positive" ~ "HTS_TST_POS", resultstatus == "Negative" ~ "HTS_TST_NEG")) %>% 
  select(-resultstatus)