Skip to content

Comments

[NM-90] Add structure for functions to return sample size for programme data#455

Draft
r-ash wants to merge 1 commit intomasterfrom
nm-90
Draft

[NM-90] Add structure for functions to return sample size for programme data#455
r-ash wants to merge 1 commit intomasterfrom
nm-90

Conversation

@r-ash
Copy link
Contributor

@r-ash r-ash commented Nov 22, 2024

We want to add sample sizes into the choropleth tooltips for input data. For survey this is ok and we will show n_observations column. It is less simple for ANC and ART data.

I've added template for a couple of functions to add this to the data.

art_prepare_hintr and anc_prepare_hintr (we had a similar function previously for ANC so I have modified that)

Can @jeffeaton or @rtesra fill in the body of these functions? I've added a basic test too which is failing at the moment. It should pass after we implement the new functions.

Please feel free to change name, column name or anything if there is something better.

Thinking about this the ANC data is in wide format,

> str(anc_data)
tibble [416 × 10] (S3: tbl_df/tbl/data.frame)
 $ area_id        : chr [1:416] "MWI_4_10_demo" "MWI_4_10_demo" "MWI_4_10_demo" "MWI_4_10_demo" ...
 $ age_group      : chr [1:416] "Y015_049" "Y015_049" "Y015_049" "Y015_049" ...
 $ year           : int [1:416] 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 ...
 $ anc_clients    : num [1:416] 5470 10415 10881 11064 13060 ...
 $ anc_known_pos  : num [1:416] 49 100 79 99 232 143 119 181 129 139 ...
 $ anc_already_art: num [1:416] 0 61 67 71 142 139 129 181 128 134 ...
 $ anc_tested     : num [1:416] 4049 7980 9298 9406 10538 ...
 $ anc_tested_pos : num [1:416] 59 107 107 89 158 147 105 83 62 52 ...
 $ anc_known_neg  : num [1:416] 191 256 153 221 789 ...
 $ births_facility: num [1:416] 4029 7216 8771 9386 9668 ...

so I wonder if we can add the sample size into this when different indicators are along the top? Without changing the structure to long format. We should think about that because it will make the data much larger to transfer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant