This repository contains data and code for the analysis of Canadian Politicians' popularity. In particular, using data collected from the Wikidata and Wikipedia projects - via the Wikidata Query Service and MediaWiki APIs - this paper describes and models the characteristics of Canadian Politicians which determine their popularity, measured in Wikipedia page views, in the year of the 2021 Canadian Federal Election. Such characteristics include Year of Birth, Political Position(s) Held, and Party Affiliation(s). Wikipedia page views are found to be somewhat greater for politicians in more popular parties, and for Party Leaders, Ministers, and Prime Ministers in particular. Further, the share of page views recieved by Liberal, Conservative, and New Democratic politicians appears strongly related to the share of votes and House of Commons seats recieved by these parties in the 2021 election.
The outputs
folder includes the files needed to reproduce this paper and a pdf copy of the paper itself. The inputs
folder includes the data
folder, containing the raw and cleaned data used for this analysis. The scripts
folder contains 00_simulate_data.R
used to simulate the data used in this paper, 01_import_wikidata.R
and 02_clean_wikidata.R
used to import and clean the Wikidata needed for this paper, as well as 03_import_pagedata.R
and 04_clean_pagedata.R
used to import and clean the Wikipedia page data needed for this paper. Finally, the shiny
folder contains the code neccisary to deploy a web application which supplements the paper. This app can be accessed here https://7wouif-ethan-sansom.shinyapps.io/shiny/.