londonmayor | R Documentation |
A dataset containing individual post-election responses from the British Election Study, auxiliary vote shares from 2012 mayoral election, and aggregate counts from the 2016 election.
londonmayor
A data frame with 1924 rows and 35 variables:
Geographic identifier from the Office for National Statistics
Name of the borough
Respondent age group
Respondent's highest level of educational qualifications
Respondent ethnicity
Respondent gender
Respondent recalled vote, including non-voters
Fieldwork date minus date of election
Boris Johnson vote share in borough in 2012, together with global mean and SD, and scaled version
Ken Livingstone vote share in borough in 2012...
Brian Paddick vote share in borough in 2012...
Jenny Jones vote share in borough in 2012...
Combined share of Siobhan Benita (Ind), Lawrence Webb (UKIP) and Carlos Cortiglia (BNP) vote share in borough in 2012...
Borough count of votes won by Zac Goldsmith
Borough count of votes won by Sadiq Khan
Borough count of votes won by Sian Berry
Borough count of votes won by Caroline Pidgeon
Borough count of votes won by Peter Whittle
Borough count of votes won by seven other candidates
Borough population over 16 less total votes cast
Individual data from the British Election Study. Results from 2012 and 2016 elections from https://data.london.gov.uk/
data("londonmayor")
data("londonps")
f <- vi ~ ageGroup + education + ethnicity + gender | LabPct_sc + LDemPct_sc + GreenPct_sc + OtherPct_sc
aux <- unique(londonmayor[,c("ONSCode", "LabPct_sc", "LDemPct_sc", "GreenPct_sc",
"OtherPct_sc")])
res <- unique(londonmayor[,c("ONSCode", "Con_counts_2016", "Lab_counts_2016", "Green_counts_2016",
"LDem_counts_2016", "UKIP_counts_2016", "Other_counts_2016", "DNV_counts_2016")])
## Make sure column names of results data frame match unique values of vi
names(res) <- c("ONSCode", "Con", "Lab", "Green",
"LDem", "UKIP", "Other", "DNV")
#' ## Computationally intensive bit
## Not run:
mod <- hrr(f, data = londonmayor, ps = londonps, aux = aux,
res = res, areavar = "ONSCode", weightvar = "count",
testing = FALSE, adjust = FALSE, overdispersed = TRUE,
iter = 320, chains = 4, cores = 4)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.