Skip to content

Commit

Permalink
Labelling updates and bringing derived vars lookups into resources
Browse files Browse the repository at this point in the history
  • Loading branch information
datadm committed Jun 4, 2024
1 parent 7f1e503 commit 4bb8078
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 18 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ options(aow_salt = "xyz")

You can replace "xyz" with any random string.

Unzip the postcode_lsoa_lookup.zip file into the `resources` folder, as the scripts need access to the `PCD_OA_LSOA_MSOA_LAD_NOV22_UK_LU.csv` file.

### `reports`

This is where html reports will go when they are produced by the data release scripts described below.
Expand Down
25 changes: 25 additions & 0 deletions resources/RCADS25_C_lookup_table.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
YearGroup,Sex,depression_int,depression_factor,anxiety_int,anxiety_factor,total_int,total_factor
2,Male,9.9,4.93,15.19,7.09,25.1,11.1
2,Female,9.68,4.97,16.25,8.42,25.93,12.24
3,Male,9.9,4.93,15.19,7.09,25.1,11.1
3,Female,9.68,4.97,16.25,8.42,25.93,12.24
4,Male,9.9,4.93,15.19,7.09,25.1,11.1
4,Female,9.68,4.97,16.25,8.42,25.93,12.24
5,Male,9.9,4.93,15.19,7.09,25.1,11.1
5,Female,9.68,4.97,16.25,8.42,25.93,12.24
6,Male,7.13,4.22,11.63,6.45,18.76,9.38
6,Female,8.03,5,13.49,7.62,21.53,11.73
7,Male,7.13,4.22,11.63,6.45,18.76,9.38
7,Female,8.03,5,13.49,7.62,21.53,11.73
8,Male,7.56,3.75,10.48,5.36,18.04,7.92
8,Female,8.08,4.34,12.74,6.22,20.82,9.46
9,Male,7.56,3.75,10.48,5.36,18.04,7.92
9,Female,8.08,4.34,12.74,6.22,20.82,9.46
10,Male,7.5,4.18,9.7,5.45,17.2,8.53
10,Female,8.14,4.37,11.31,5.33,19.45,8.63
11,Male,7.5,4.18,9.7,5.45,17.2,8.53
11,Female,8.14,4.37,11.31,5.33,19.45,8.63
12,Male,7.64,4.37,9.96,4.32,17.6,7.24
12,Female,8.59,3.67,11.5,5.34,20.09,7.79
13,Male,7.64,4.37,9.96,4.32,17.6,7.24
13,Female,8.59,3.67,11.5,5.34,20.09,7.79
35 changes: 20 additions & 15 deletions resources/README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
# Age of Wonder: Resources
This folder contains any open source data used in the creation of the Age of Wonder data. This currently includes geographic boundary information and IMD data.
This folder contains lookup tables and other resources used in the creation of the Age of Wonder data.

## imd2019_for_aow.csv
IMD data used to create IMD_2019_score and IMD_2019_deciles variables in denominator file.

## imd2019lsoa.csv
Downloaded from: [Open Data Communities](https://opendatacommunities.org/resource?uri=http%3A%2F%2Fopendatacommunities.org%2Fdata%2Fsocietal-wellbeing%2Fimd2019%2Findices)
Download date: 14/02/24.

Includes all IMD indicies for 2019, including IDACI. Data is in long format (one record per LSOA code/IMD value combination).

## write_imd2019_for_aow.R
Processes imd2019lsoa.csv and converts from long to wide format, with one row per LSOA. Extracts data for IMD 2019 score and deciles. This is saved as imd2019_for_aow.csv
## postcode_lsoa_lookup.zip
Contains a compressed version of PCD_OA_LSOA_MSOA_LAD_NOV22_UK_LU.csv, downloaded from [Open Geography Portal](https://geoportal.statistics.gov.uk/datasets/9c5ebee4163d435aa4defdaf348ba3c2/about) on 14/02/2024. File is compressed to enable it to be stored on GitHub.

## imd2019_for_aow.csv
IMD data used to create IMD_2019_score and IMD_2019_deciles variables in denominator file.
This is a lookup table for UK postcodes to OA, LSOA, MSOA and Local authorities, as of November 2022. Uses 2011 census boundaries. This the most recent (and final) lookup for the 2011 census boundaries. Using the lookup for 2011 boundaries as IMD is only produced using 2011 boundaries.

## postcode_lsoa_lookup.zip
Contains a compressed version of PCD_OA_LSOA_MSOA_LAD_NOV22_UK_LU.csv. File is compressed to enable it to be stored on GitHub.
This is not a BiB product, and we are sharing this under the terms of the Open Government License.
Contains OS data ? Crown copyright and database right [2024]
Contains Royal Mail data ? Royal Mail copyright and database right [2024]
Source: Office for National Statistics licensed under the Open Government Licence v.3.0

### PCD_OA_LSOA_MSOA_LAD_NOV22_UK_LU.csv
Downloaded from [Open Geography Portal](https://geoportal.statistics.gov.uk/datasets/9c5ebee4163d435aa4defdaf348ba3c2/about)
Download date: 14/02/2024
## RCADS25_C_lookup_table.csv

Lookup table for UK postcodes to OA, LSOA, MSOA and Local authorities, as of November 2022. Uses 2011 census boundaries. This the most recent (and final) lookup for the 2011 census boundaries. Using the lookup for 2011 boundaries as IMD is only produced using 2011 boundaries.
Lookup table for RCADS25 derived variables.

## SWEMWBS_lookup_table.csv

Lookup table for SWEMWBS derived variables.

## write_imd2019_for_aow.R
Processes imd2019lsoa.csv and converts from long to wide format, with one row per LSOA. Extracts data for IMD 2019 score and deciles. This is saved as imd2019_for_aow.csv

This is not a BiB product, and we are sharing this under the terms of the Open Government License.
Contains OS data © Crown copyright and database right [2024]
Contains Royal Mail data © Royal Mail copyright and database right [2024]
Source: Office for National Statistics licensed under the Open Government Licence v.3.0
30 changes: 30 additions & 0 deletions resources/SWEMWBS_lookup_table.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
wellbeing,swemwbs_total
7,7
8,9.51
9,11.25
10,12.4
11,13.33
12,14.08
13,14.75
14,15.32
15,15.84
16,16.36
17,16.88
18,17.43
19,17.98
20,18.59
21,19.25
22,19.98
23,20.73
24,21.54
25,22.35
26,23.21
27,24.11
28,25.03
29,26.02
30,27.03
31,28.13
32,29.31
33,30.7
34,32.55
35,35
4 changes: 2 additions & 2 deletions survey/module2/aow_module2_derived_vars.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ module <- module %>%
mutate(TMPVAR_awb2_9_seek_hlp_ppl_1_r4 = ifelse(awb2_9_seek_hlp_ppl_1_r4 == 8, 0, awb2_9_seek_hlp_ppl_1_r4))


rcads_lookup <- read_csv("U:\\Born In Bradford - Confidential\\Age Of Wonder\\Questionnaire Response Rates and Distributions\\Markdown Modules\\Module 2\\Scripts\\Lookup\\RCADS25_C_lookup_table.csv")
rcads_lookup <- read_csv("resources/RCADS25_C_lookup_table.csv")

rcads_lookup <- rcads_lookup %>%
rename(year_group = YearGroup) %>%
Expand All @@ -65,7 +65,7 @@ rcads_lookup <- rcads_lookup %>%

rcads_lookup$year_group <- as.character(rcads_lookup$year_group)

swemwbs_lookup <- read_csv("U:\\Born In Bradford - Confidential\\Age Of Wonder\\Questionnaire Response Rates and Distributions\\Markdown Modules\\Module 2\\Scripts\\Lookup\\SWEMWBS_lookup_table.csv")
swemwbs_lookup <- read_csv("resources/SWEMWBS_lookup_table.csv")


#----------------Compute DVs
Expand Down
2 changes: 1 addition & 1 deletion survey/module4/aow_module4_labelling.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ module <- module %>%
awb8_1_morality_3 = "Is it wrong for someone your age to steal something from a shop?",
awb8_1_morality_4 = "Is it wrong for someone your age to download content without paying?",
awb8_3_bully = "How often have you taken part in bullying somebody at school?",
awb8_2_bullied_onlne = "How often have you taken part in bullying online?",
awb8_2_bullied_onlne = "How often have you been bullied online?",
awb8_2_club_1 = "Have you ever been discouraged from joining a club/group?",
awb8_2_club_rsn_1___1 = "Were you discourage from joining a club/group because your ethnicity?",
awb8_2_club_rsn_1___2 = "Were you discourage from joining a club/group because your sex/gender?",
Expand Down

0 comments on commit 4bb8078

Please sign in to comment.