Skip to contents

Version française

qesR loads the Quebec Election Studies, with the panels and polls that accompanied them, into R: seven provincial elections from 1998 to 2022, each study by its code, from its original file. Their codebooks, question wording and a search across all studies ship with the package and work offline, in English and French. qesR also harmonizes 11 of the studies into one data frame, so that a question about 25 years of Quebec elections can be answered within each study and then compared.

In 2007 the youngest francophones were the cohort most likely to vote Yes; in 2022 they were the least likely
Dot charts in six panels, one per Quebec Election Study from 2007 to 2022, of the share of francophones who would vote Yes in each birth cohort. In 2007 the youngest cohort is the most likely to vote Yes; in 2022 it is the least likely. Details on the sovereignty page.Dot charts in six panels, one per Quebec Election Study from 2007 to 2022, of the share of francophones who would vote Yes in each birth cohort. In 2007 the youngest cohort is the most likely to vote Yes; in 2022 it is the least likely. Details on the sovereignty page.
Party choice is far less tied to the referendum vote than in 2012, and left-right has not taken its place
Line charts in two panels, all voters and francophone voters, 2012 to 2022, of how much of the variation in the referendum vote and in left-right placement lies between the parties' electorates: the referendum vote is far less tied to party choice in 2022 than in 2012, and left-right placement did not rise. Details on the dimensions page.Line charts in two panels, all voters and francophone voters, 2012 to 2022, of how much of the variation in the referendum vote and in left-right placement lies between the parties' electorates: the referendum vote is far less tied to party choice in 2022 than in 2012, and left-right placement did not rise. Details on the dimensions page.

Each estimate is made within one study, with that study’s weight where it has a validated one and a 95% confidence interval; nothing is pooled across studies. Get started goes from a study code to a weighted estimate, offline, on a small synthetic study that ships with qesR.

Examples

Each page takes a common belief about Quebec elections and sets it against the studies.

Installation

# install.packages("remotes")
remotes::install_github("ThomasGareau/qesR")

Once qesR is accepted on CRAN, install.packages("qesR") will do the same. A first session (the lines marked “downloads” fetch studies from their deposits the first time; options(qesR.cache = "disk") keeps them):

library(qesR)
qes_studies()                         # the studies, offline
qes2018 <- get_qes("qes2018")         # downloads: one study, from its original file
qes_search("souverain|sovereign")     # a question, in every study, offline
h <- qes_harmonize(targets = "vote_choice")  # downloads: the vote, in six studies
d <- qes_decon()                      # downloads: every study in one flat file, relaxed

The harmonization rules are experimental and may change from one version of qesR to the next. Keep qes_provenance(h, level = "spec") with your results and pin the version of qesR you used.

Citing qesR

Work that uses qesR should cite the package and each study it draws on. qes_cite() writes both, with each dataset’s DOI:

qes_cite("qes2018")                   # qesR and the 2018 study
qes_cite("qes2018", style = "bibtex")

Citing qesR and the studies gives the citation of every study.

Licence

The code of qesR is under the MIT licence. The data are not part of the package: qesR downloads each study from its deposit on Borealis or the Harvard Dataverse. Most studies are released under CC0; the 2022 study, and the metadata qesR ships from it, are under CC BY-NC 4.0 (attribution, no commercial use). Details and the required attribution.