In today’s assignment, we are going to look at a set of variables describing the economic characteristics of English parliamentary constituencies around 2017-2019 (the dates of the source data vary a bit in terms of year).
You can directly load the data file into R from the course website with the following command:
econ_vars <- read.csv(url("https://raw.githubusercontent.com/lse-me314/lse-me314.github.io/master/data/const-econ-vars.csv"))
This data file has 8 variables
ONSConstID - Office for National Statistics
Parliamentary Constituency IDConstituencyName - Constituency NameHouseWageRatio - Ratio of House Prices to WagesUnempConstRate - Unemployment RateUnempConstRateChange - Unemployment Rate Change since
2010WageMedianConst - Median Wagesocial_mobility_score - Social
Mobility Indexdeprivation_index_score - Social
Deprivation IndexQ1. Use the cor() and pairs() functions to
assess the correlations between the six economic variables in the data
set. Which two economic variables are most highly correlated with one
another at the constituency level? Which variable is least correlated
with the others at the constituency level?
pairs(econ_vars[,3:8])