Skip to content

Commit

Permalink
Update calculation of C11 per issue #6.
Browse files Browse the repository at this point in the history
  • Loading branch information
grosscol committed May 19, 2020
1 parent a1ca8cc commit afc8009
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hurley_ingest.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ calculate_hurley_components <- function(proc_data){
C8 = sum(contra_choice != "unknown"),
C9 = sum(contra_choice == "immediate pp iud" | contra_choice == "immediate pp nexplanon"),
#C10 = sum(contra_choice != "none"), # deprecated
C11 = sum(contra_choice != "unknown" & contra_choice == imm_method),
C11 = sum(contra_choice != "unknown" & contra_choice == imm_method & contra_prov == "0-3 days"),
C12 = sum(larc_prov == "4-60 days pp visit" | larc_prov == "4-60 days not pp visit"),
C13 = sum(contra_choice == "immediate pp iud"),
C14 = sum(contra_choice == "immediate pp nexplanon"),
Expand Down
18 changes: 17 additions & 1 deletion umich_ingest.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ calculate_components <- function(proc_data){
C8 = sum(contra_choice != "unknown"),
C9 = sum(contra_choice == "immediate pp iud" | contra_choice == "immediate pp nexplanon"),
#C10 = sum(contra_choice != "none"), # deprecated
C11 = sum(contra_choice != "unknown" & contra_choice == imm_method),
C11 = sum(contra_choice != "unknown" & contra_choice == imm_method & contra_prov == "0-3 days"),
C12 = sum(larc_prov == "4-60 days pp visit" | larc_prov == "4-60 days not pp visit"),
C13 = sum(contra_choice == "immediate pp iud"),
C14 = sum(contra_choice == "immediate pp nexplanon"),
Expand Down Expand Up @@ -120,3 +120,19 @@ maptg <- measure_df %>%

# Emit cleaned data to file
write_csv(maptg, "maptg_umich.csv")

# df_norm %>%
# filter(delivery_date >= ymd("2020-01-01"), delivery_date < ymd("2020-04-01")) %>%
# select(counseling, contra_choice, imm_method, contra_prov) %>%
# mutate(
# foo = imm_method == contra_choice & contra_prov == '0-3 days',
# `0to3` = contra_prov == "0-3 days",
# match = imm_method == contra_choice,
# isOther = contra_choice == "other") %>%
# summarize(
# matches = sum(match),
# matches_0to3 = sum(match & `0to3`),
# n_0to3 = sum(`0to3`),
# n_foo = sum(foo),
# n_rows = n()) %>%
# pivot_longer(cols=everything())

0 comments on commit afc8009

Please sign in to comment.