Closed jeffreyad closed 3 months ago
This seems like a good idea for implementation. I wonder though ifi would be better to store the country codes in a small dataset provided with the package?
This gets a bit in the realm of metadata. We've always tried to shy away from getting to much into that...but we have exceptions like lab grading.
How come this can't be fed in via a spec sheet and make use of metatools? Maybe a cool example for the examples site?
@pharmaverse/admiral and @pharmaverse/admiral_comm What do you think?
@bms63 it would definitely be a candidate for metatools::create_var_from_codelist()
if the codes were stored in Codelist. This is currently in examples for ADPPK
: create_var_from_codelist(metacore, input_var = COUNTRY, out_var = COUNTRYN)
.
Feature Idea
ADPPK
(Population PK) requires numeric decodes for covariates.COUNTRYN
is the numeric decoded version ofCOUNTRY
. Sometimes the list of decodes can be very long for large studies. One option that some sponsors may use is to use a number based on the ISO 3166-1 alpha-3 codes.For example: Set to the country [ADSL.COUNTRY] using the code list which assigns the numerical representation of the standard-defined 249 countries after alphabetical sorting.
1 = ABW (ARUBA) 2 = AFG (AFGHANISTAN) 3 = AGO (ANGOLA) …
The 249 3-letter codes correspond to the ISO 3166-1 alpha-3 codes:
https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
The decodes could be stored in function as below or in a tibble.
Relevant Input
No response
Relevant Output
No response
Reproducible Example/Pseudo Code
No response