Skip to content

Commit

Permalink
Add summary statistics, close #1
Browse files Browse the repository at this point in the history
  • Loading branch information
robinlovelace-ate committed Jun 25, 2024
1 parent f94a507 commit 70808cd
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
22 changes: 22 additions & 0 deletions README.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit 70808cd

Please sign in to comment.