Closed samclifford closed 2 years ago
The wpp2019 package should be enough here
what year should i draw the population from, given that we're summarizing here? just the most recent but for the entire subregions?
Using each country's most recent is probably the best approach. I think wpp2019 has 2020 data in it.
so i should first get a weighted average for each country based on total tested in each country (over the studies), then take the country weighted average to the subregions, where i will be weighting by total pop?
Use the country level weighted averages that are already calculated. Merge with the country's latest population from wpp2019 (or WDI if necessary). Group by UN subregion and calculate weighted means.
https://github.com/samclifford/MeganVermaMsc/blob/6e98e78cb50fad0a9a3b493f87f7845eec2c95f8/mscprojectscript_03_explore_data.R#L92
You probably need to look at the national population rather than the study size, as if we have lots of studies from a small country then that won't be as representative of the entire subregion.