Skip to content

Commit

Permalink
markdown source builds
Browse files Browse the repository at this point in the history
Auto-generated via {sandpaper}
Source  : 33edbe5
Branch  : main
Author  : quirksahern <[email protected]>
Time    : 2024-08-08 10:22:14 +0000
Message : Merge pull request #15 from UCL-ARC/stats-episode-clean-up

Update 23-statistics.Rmd removal of gapminder references
  • Loading branch information
actions-user committed Aug 8, 2024
1 parent 9870e76 commit c3a6b26
Show file tree
Hide file tree
Showing 6 changed files with 1,719 additions and 17 deletions.
26 changes: 10 additions & 16 deletions 23-statistics.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,20 @@ source: Rmd
``` r
# We will need these libraries and this data later.
library(tidyverse)
library(ggplot2)

# loading data
lon_dims_imd_2019 <- read.csv("data/English_IMD_2019_Domains_rebased_London_by_CDRC.csv")
# Commenting out as not used in this version
# library(lubridate)
#library(gapminder)

# create a binary membership variable for City of London (for later examples)
lon_dims_imd_2019 <- lon_dims_imd_2019 %>% mutate(city = la19nm == "City of London")
```

We are going to use the data from the gapminder package. We have added a variable *European* indicating if a country is in Europe.
We are going to use the data from the Consumer Data Research Centre, specifically the London IMD 2019 (English IMD 2019 Domains rebased) data.
Atribution: Data provided by the Consumer Data Research Centre, an ESRC Data Investment: ES/L011840/1, ES/L011891/1

The statistical unit areas used to provide indices of relative deprivation across the country are Lower layer Super Output Areas (LSOAs), dimensions of depravation include income, employment, education, health, crime, barriers to housing and services, and the living environment.
We have added a variable *city* indicating if an LSOA is within the City of London, or not.

## The big picture

Expand Down Expand Up @@ -402,7 +406,7 @@ It all starts with a hypothesis

## Comparing means

Is there an absolute difference between the income ranks of the Lower-layer Super Output Areas
Is there an absolute difference between the income ranks of the Lower-layer Super Output Areas?


``` r
Expand Down Expand Up @@ -483,14 +487,6 @@ While the t-test is sufficient where there are two levels of the IV, for situati


``` r
# quantile(gapminder$gdpPercap)
# IQR(gapminder$gdpPercap)

# gapminder$gdpGroup <- cut(gapminder$gdpPercap, breaks = c(241.1659, 1202.0603, 3531.8470, 9325.4623, 113523.1329), labels = FALSE)

# gapminder$gdpGroup <- factor(gapminder$gdpGroup)

# anovamodel <- aov(gapminder$pop ~ gapminder$gdpGroup)
anovamodel <- aov(lon_dims_imd_2019$health_london_rank ~ lon_dims_imd_2019$la19nm)
summary(anovamodel)
```
Expand Down Expand Up @@ -1580,7 +1576,6 @@ The most common use of regression modelling is to explore the relationship betwe


``` r
# cor.test(gapminder$gdpPercap, gapminder$lifeExp)
cor.test(lon_dims_imd_2019$Income_london_rank, lon_dims_imd_2019$health_london_rank)
```

Expand All @@ -1599,7 +1594,6 @@ sample estimates:
```

``` r
# ggplot(gapminder, aes(gdpPercap, log(lifeExp))) +
ggplot(lon_dims_imd_2019, aes(Income_london_rank, health_london_rank)) +
geom_point() +
geom_smooth()
Expand Down Expand Up @@ -1642,7 +1636,7 @@ F-statistic: 8632 on 1 and 4833 DF, p-value: < 2.2e-16

## Regression with a categorical IV (the t-test)

Run the following code chunk and compare the results to the t test conducted earlier.
Run the following code chunk and compare the results to the t-test conducted earlier.


``` r
Expand Down
112 changes: 112 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
#------------------------------------------------------------
# Values for this lesson.
#------------------------------------------------------------

# Which carpentry is this (swc, dc, lc, or cp)?
# swc: Software Carpentry
# dc: Data Carpentry
# lc: Library Carpentry
# cp: Carpentries (to use for instructor training for instance)
# incubator: The Carpentries Incubator
carpentry: 'swc'

# Overall title for pages.
title: 'R for AMR Epidemiology'

# Date the lesson was created (YYYY-MM-DD, this is empty by default)
created: '2015-04-18'

# Comma-separated list of keywords for the lesson
keywords: 'software, data, lesson, The Carpentries'

# Life cycle stage of the lesson
# possible values: pre-alpha, alpha, beta, stable
life_cycle: 'stable'

# License of the lesson materials (recommended CC-BY 4.0)
license: 'CC-BY 4.0'

# Link to the source repository for this lesson
source: 'https://github.com/UCL-ARC/r-amr-epidemiology'

# Default branch of your lesson
branch: 'main'

# Who to contact if there are any issues
contact: '[email protected]'

# Navigation ------------------------------------------------
#
# Use the following menu items to specify the order of
# individual pages in each dropdown section. Leave blank to
# include all pages in the folder.
#
# Example -------------
#
# episodes:
# - introduction.md
# - first-steps.md
#
# learners:
# - setup.md
#
# instructors:
# - instructor-notes.md
#
# profiles:
# - one-learner.md
# - another-learner.md

# Order of episodes in your lesson
episodes:
- 01-rstudio-intro.Rmd
- 02-project-intro.Rmd
- 03-seeking-help.Rmd
- 04-data-structures-part1.Rmd
- 05-data-structures-part2.Rmd
- 06-filedir.md
- 07-basics.md
- 08-setup.md
- 09-create.md
- 10-changes.md
- 11-history.md
- 12-ignore.md
- 13-supplemental-rstudio.md
- 14-data-subsetting.Rmd
# - 07-control-flow.Rmd
- 15-plot-ggplot2.Rmd
# - 09-vectorization.Rmd
# - 10-functions.Rmd
- 16-writing-data.Rmd
- 17-github.md
- 18-collab.md
- 19-conflict.md
- 20-dplyr.Rmd
- 21-tidyr.Rmd
# basic stats
- 22-knitr-markdown.Rmd
- 23-statistics.Rmd
# 23-regression
# 24-logregression
# 25-broom
# 26-r-sql
- 27-wrap-up.Rmd

# Information for Learners
learners:

# Information for Instructors
instructors:

# Learner Profiles
profiles:

# Customisation ---------------------------------------------
#
# This space below is where custom yaml items (e.g. pinning
# sandpaper and varnish versions) should live


url: 'https://UCL-ARC.github.io/R-AMR-Epidemiology'
analytics: carpentries
lang: en
Binary file modified fig/23-statistics-rendered-unnamed-chunk-3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified fig/23-statistics-rendered-unnamed-chunk-3-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion md5sum.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"episodes/20-dplyr.Rmd" "fc20e35f891f0bb624647d69816c3220" "site/built/20-dplyr.md" "2024-08-07"
"episodes/21-tidyr.Rmd" "1c59c3bea4cec5e0c47654a546294f07" "site/built/21-tidyr.md" "2024-08-07"
"episodes/22-knitr-markdown.Rmd" "0c63ce92263a32f19fbec9f7b619b682" "site/built/22-knitr-markdown.md" "2024-08-07"
"episodes/23-statistics.Rmd" "c1979deb2d61baa7368d2c3cd557e854" "site/built/23-statistics.md" "2024-08-07"
"episodes/23-statistics.Rmd" "0681b5824fc6281b7a112de721db7e0d" "site/built/23-statistics.md" "2024-08-08"
"episodes/27-wrap-up.Rmd" "c5ce0d34a37b7a99624ad1d6ac482256" "site/built/27-wrap-up.md" "2024-08-07"
"instructors/instructor-notes.md" "e61e7587564a6c4c11dbb6beea127764" "site/built/instructor-notes.md" "2024-08-07"
"learners/discuss.md" "42ad66ab1907e030914dbb2a94376a47" "site/built/discuss.md" "2024-08-07"
Expand Down
Loading

0 comments on commit c3a6b26

Please sign in to comment.