Skip to content

Commit

Permalink
change DHS codes associated with receiving ACT
Browse files Browse the repository at this point in the history
  • Loading branch information
MAmbrose-IDM committed Oct 30, 2024
1 parent 17ea87f commit 8c9d0c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion r_utilities/data_processing/1_DHS_data_extraction.R
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ any_matches = function(df_row, pos_codes){
# create new column describing whether an individual received effective treatment given they received any antimalarial.
# Column value will be 1 if an individual received rectal artesunate, IV artesunate, or an ACT and 0 if they received a different antimalarial
# note: currently does not include individuals who reported country-specific antimalarial ("ml13g", "ml13f"), since it's not clear whether or not those are ACT
received_art_antimalarial = function(dta_dir, DHS_file_recode_df, var_index, art_codes = c("ml13e", "ml13aa", "ml13ab"), non_art_codes = c("ml13a", "ml13b", "ml13c", "ml13d", "ml13da", "ml13h")){
received_art_antimalarial = function(dta_dir, DHS_file_recode_df, var_index, art_codes = c("ml13e", "ml13ab"), non_art_codes = c("ml13a", "ml13b", "ml13c", "ml13d", "ml13aa", "ml13da", "ml13h")){
cur_dta = read.dta(paste0(dta_dir, '/', DHS_file_recode_df$folder_dir[var_index], '/', DHS_file_recode_df$filename[var_index]))
# change columns to strings (the any_matches function does not work as expected if there are factors)
cur_dta = data.frame(lapply(cur_dta, as.character), stringsAsFactors=FALSE)
Expand Down
5 changes: 3 additions & 2 deletions r_utilities/data_processing/DHS_code_examination.R
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ for(ii in 6:length(house_codes)){

# individual codes
ind_codes = c('caseid','bidx','v001','v012','v014','v006','v007','v105', 'hw16', 'h32z','h47','m49a', 'ml1', 'h3', 'h5', 'h7', 'h9', art_codes, non_art_codes)
ind_filenum = 1 # 2010:1, 2013:1, 2015:4, 2018:1, 2021: 5
ind_filenum = 5 # 2010:1, 2013:1, 2015:4, 2018:1, 2021: 5
dta_filepaths[ind_filenum]
View(dta_list[[ind_filenum]][1:50,ind_codes[ind_codes %in% colnames(dta_list[[ind_filenum]])]])
for(ii in 6:length(ind_codes)){
Expand Down Expand Up @@ -173,8 +173,9 @@ find_code_locations(dta_list=dta_list, code_str='h37e') # combination with arte
find_code_locations(dta_list=dta_list, code_str='ml13e') # combination with artemisinin
find_code_locations(dta_list=dta_list, code_str='ml20a') # how long after fever started did first take ACT
# # view all the artesunate versus non-ACT antimalarials
# art_codes = c("ml13e", "ml13aa", "ml13ab")
# art_codes = c("ml13e", "ml13aa", "ml13ab") # 'ml13aa' is rectal artesunate, moving to non-ACT
# non_art_codes = c("ml13a", "ml13b", "ml13c", "ml13d", "ml13da", "ml13h") #, "ml13g", "ml13f") # country-specific antimalarial: "ml13g", "ml13f",
find_code_locations(dta_list=dta_list, code_str='ml13aa') # rectal artesunate



Expand Down

0 comments on commit 8c9d0c2

Please sign in to comment.