From 70808cddb6c9ec189eec18f7d05e67580b3ee625 Mon Sep 17 00:00:00 2001 From: robinlovelace-ate Date: Tue, 25 Jun 2024 17:01:12 +0100 Subject: [PATCH] Add summary statistics, close #1 --- README.md | 12 ++++++++++++ README.qmd | 22 ++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/README.md b/README.md index 82d9b99..d24a248 100644 --- a/README.md +++ b/README.md @@ -25,3 +25,15 @@ Let’s visualise the change in % active travel by group, with breaks at -0.5, 0, 0.01, 0.02, 0.05, 0.08, 1: ![](README_files/figure-commonmark/mode-proportion-time-single-1.png) + +The graph shows that schools that have increased active travel +(excluding walking to public transport) have done so primarily by +boosting walking. However, some schools have been very successful in +boosting cycling. Summary statistics for the 10% of schools with the +largest increase in active travel, for walking and cycling, are shown +below: + +Overall, we found that the 10% of schools with the largest increase in +active travel (walking and cycling) boosted walking by an average of 4.8 +percentage points per year and cycling by an average of 1.9 percentage +points per year. diff --git a/README.qmd b/README.qmd index c47bd7b..7e020f8 100644 --- a/README.qmd +++ b/README.qmd @@ -218,3 +218,25 @@ school_proportions_urn_summary_long |> # % y lab: scale_y_continuous(labels = scales::percent_format()) ``` + +The graph shows that schools that have increased active travel (excluding walking to public transport) have done so primarily by boosting walking. +However, some schools have been very successful in boosting cycling. +Summary statistics for the 10% of schools with the largest increase in active travel, for walking and cycling, are shown below: + + +```{r} +success_10pct_walk = school_proportions_urn_summary |> + arrange(desc(`Walk/Scoot`)) |> + slice(1:round(0.1 * n())) +success_10pct_cycle = school_proportions_urn_summary |> + arrange(desc(Cycle)) |> + slice(1:round(0.1 * n())) +# mean(success_10pct_walk$`Walk/Scoot`) +# mean(success_10pct_cycle$Cycle) +# # Change per year: +mean_change_walk = mean(success_10pct_walk$`Walk/Scoot`) / 5 +mean_change_cycle = mean(success_10pct_cycle$Cycle) / 5 +``` + +Overall, we found that the 10% of schools with the largest increase in walking boosted walking by an average of `r round(mean_change_walk * 100, 1)` percentage points per year. +The 10% of schools with the largest increase in cycling boosted cycling by an average of `r round(mean_change_cycle * 100, 1)` percentage points per year. \ No newline at end of file