From 4bb807802759f4c80e6821ba84663938ccf1d7fc Mon Sep 17 00:00:00 2001 From: "dan.mason@bthft.nhs.uk" Date: Tue, 4 Jun 2024 16:30:51 +0100 Subject: [PATCH] Labelling updates and bringing derived vars lookups into resources --- README.md | 2 ++ resources/RCADS25_C_lookup_table.csv | 25 ++++++++++++++++ resources/README.md | 35 +++++++++++++---------- resources/SWEMWBS_lookup_table.csv | 30 +++++++++++++++++++ survey/module2/aow_module2_derived_vars.R | 4 +-- survey/module4/aow_module4_labelling.R | 2 +- 6 files changed, 80 insertions(+), 18 deletions(-) create mode 100644 resources/RCADS25_C_lookup_table.csv create mode 100644 resources/SWEMWBS_lookup_table.csv diff --git a/README.md b/README.md index edce6ce..d6fb057 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/resources/RCADS25_C_lookup_table.csv b/resources/RCADS25_C_lookup_table.csv new file mode 100644 index 0000000..78b9097 --- /dev/null +++ b/resources/RCADS25_C_lookup_table.csv @@ -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 diff --git a/resources/README.md b/resources/README.md index e992149..e534d52 100644 --- a/resources/README.md +++ b/resources/README.md @@ -1,5 +1,8 @@ # 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) @@ -7,22 +10,24 @@ 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 \ No newline at end of file diff --git a/resources/SWEMWBS_lookup_table.csv b/resources/SWEMWBS_lookup_table.csv new file mode 100644 index 0000000..49fa503 --- /dev/null +++ b/resources/SWEMWBS_lookup_table.csv @@ -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 diff --git a/survey/module2/aow_module2_derived_vars.R b/survey/module2/aow_module2_derived_vars.R index 4965d3c..db0d86d 100644 --- a/survey/module2/aow_module2_derived_vars.R +++ b/survey/module2/aow_module2_derived_vars.R @@ -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) %>% @@ -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 diff --git a/survey/module4/aow_module4_labelling.R b/survey/module4/aow_module4_labelling.R index 5028ec2..da33cc9 100644 --- a/survey/module4/aow_module4_labelling.R +++ b/survey/module4/aow_module4_labelling.R @@ -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?",