Skip to content

Commit

Permalink
Merge pull request #114 from opensafely/viv3ckj/results-calculations
Browse files Browse the repository at this point in the history
Calculate total consultations and percentage of consultations linked
  • Loading branch information
viv3ckj authored Jan 30, 2025
2 parents 0411e23 + 3c49fdd commit 39b101b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion reports/create_results_manuscript.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ df_results_pf_total_counts <- df_measures %>%
select(interval_start, pf_consultation_total) %>%
distinct() %>%
ungroup() %>%
mutate(pf_consultation_diff = pf_consultation_total - lag(pf_consultation_total))
mutate(pf_consultation_diff = pf_consultation_total - lag(pf_consultation_total)) %>%
filter(interval_start >= "2024-02-01")
# Sum of consultations from feb to dec 2024
sum(df_results_pf_total_counts$pf_consultation_total)
df_results_pf_total_counts %>%
filter(interval_start %in% c("2024-02-01", "2024-12-01", "2024-08-01", "2024-09-01", "2024-10-01"))
Expand Down Expand Up @@ -192,6 +196,7 @@ df_results_pf_linkage <- df_pf_descriptive_stats %>%
ratio_total_unlinked = 1 - sum(ratio)
) %>%
mutate(
ratio_linked = percent(ratio, accuracy = 0.1),
ratio_total_linked = percent(ratio_total_linked, accuracy = 0.1),
ratio_total_unlinked = percent(ratio_total_unlinked, accuracy = 0.1)
)
Expand Down

0 comments on commit 39b101b

Please sign in to comment.