swedishpolls

A repository containing data for swedish opinion polls.

https://github.com/mansmeg/swedishpolls

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.9%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

A repository containing data for swedish opinion polls.

Basic Info
  • Host: GitHub
  • Owner: MansMeg
  • Language: R
  • Default Branch: master
  • Size: 1.62 MB
Statistics
  • Stars: 46
  • Watchers: 5
  • Forks: 17
  • Open Issues: 10
  • Releases: 0
Created over 11 years ago · Last pushed 6 months ago
Metadata Files
Readme Citation

README.md

R-CMD-check Codecov test coverage License: MIT License: CC0-1.0 <!-- badges: end -->

Swedish polls

This README is a short description of the file Polls.csv and the RPackage to handle these polls. The file Polls.csv contains all polls conducted in Sweden regarding political sympathies. The file originated from Novus in 2013 but has been updated, and variables has been added since then.

Data description

The file contains the following variables.

Variable | Description ------------- | ------------- PublYearMonth | Month and year of publication Company | Company name at publication M - Fi | Poll results for the different parties Uncertain | Uncertain voters n | The number of observations (see below) PublDate | Date of publication collectPeriodFrom | Start date of data collection collectPeriodTo | End date of data collection approxPeriod | Indicator if the period is known or if it is an approximation of the period house | The latest company name (if the name has been changed)

The value NA follows the R standard and means missing value.

Definitions of the number of observations

Some polling institutes report the total sample size and the number of respondents. Here we use the number of actual respondents in the poll as the sample size.

Quality of the data

In the earlier data, the quality of the data is of less good quality (more NA:s in sample size and collection period). Before 2000 only Sifo is currently added. Data from 2008 are of better quality (i.e. less NA).

Issue with Ipsos

The house Ipsos round their numbers from the mid-2010s. Sometimes these numbers sum up to 101. In these situations, the numbers have been normalized by multiplying the values by 100/101. To get the original values, round up the Ipsos values to the closest integer.

Issue with Sentio

Sentio usually reports two numbers, total respondents and party preferences. Here we use the number of party preferences, but other definitions might have been used in older data.

If you spot any faults or want to contribute...

Just fork the repository and feel free to send me a merge request with your suggested corrections and/or additions. You can also drop an issue in the repository.

Thanks to

Simon Sigurdhsson for collecting polls.

Hampus Joakim Nilsson for collecting polls.

Henrik Ekegren Oscarsson and the Swedish National Election Studies for contributing historical Sifo polls.

Leonora Uddhammar at Statistics Sweden for contributing historical information on Statistics Swedens poll (Partisympatiundersökningen).

Pelle Ahlin at Demoskop for contributing historical information on historical poll from Demoskop.

License

The data in the repository is released under CC0 (public domain) and code is released under MIT.

Sources

We are now starting to build up sources to the polls data since we sometimes need to go back to individual polls to double check them. URL and sources can be found in the Sources folder.

To use the data

If you want to download the raw CSV file, you can find the file here. To download it, click "Raw".

Below there are codes to read the data directly into different statistical software.

Using R

To download this file directly to R use the RPackage SwedishPolls with the function get_polls():

r remotes::install_github("MansMeg/SwedishPolls", subdir = "RPackage") polls <- SwedishPolls::get_polls()

Using R, it is also simple to get data for the last elections in the same format as the polls.

r data("elections", package = "SwedishPolls")

We can handle tracking polls (polls with overlapping collection periods, usually close to elections) with the following R function. This function returns the latest, non-overlapping tracking polls.

r new_polls <- handle_tracking_polls(polls)

In 2019, Inizio and Demoskop merged, and from this point, the polls of Inizio were used by Demoskop. The following function creates a new house variable for Inizio and Demoskop based on the actual method used.

r new_polls <- handle_demoskop_inizio_polls(polls)

Owner

  • Name: Måns Magnusson
  • Login: MansMeg
  • Kind: user
  • Location: Stockholm / Uppsala
  • Company: Uppsala Universitet

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use SwedishPolls in an academic publication, please cite it as below. Also include the git hash for the version you used for full reproducibility. "
authors:
  - family-names: Magnusson
    given-names: Måns
  - family-names: Finnäs
    given-names: Jens
title: "SwedishPolls: Swedish opinion polls from 2002 until today [git hash]"
date-released: 2023-01-07

GitHub Events

Total
  • Issues event: 1
  • Watch event: 3
  • Delete event: 27
  • Issue comment event: 3
  • Push event: 33
  • Pull request event: 65
  • Fork event: 1
  • Create event: 30
Last Year
  • Issues event: 1
  • Watch event: 3
  • Delete event: 27
  • Issue comment event: 3
  • Push event: 33
  • Pull request event: 65
  • Fork event: 1
  • Create event: 30

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 13
  • Total pull requests: 213
  • Average time to close issues: 11 months
  • Average time to close pull requests: 3 days
  • Total issue authors: 5
  • Total pull request authors: 11
  • Average comments per issue: 4.15
  • Average comments per pull request: 0.59
  • Merged pull requests: 195
  • Bot issues: 0
  • Bot pull requests: 7
Past Year
  • Issues: 1
  • Pull requests: 32
  • Average time to close issues: N/A
  • Average time to close pull requests: 22 minutes
  • Issue authors: 1
  • Pull request authors: 4
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.06
  • Merged pull requests: 25
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • MansMeg (9)
  • hampusborgos (1)
  • StaffanBetner (1)
  • PierreMesure (1)
  • tommiehansen (1)
  • jensfinnas (1)
Pull Request Authors
  • jensfinnas (135)
  • urdh (54)
  • MansMeg (23)
  • hampusborgos (18)
  • StaffanBetner (17)
  • dependabot[bot] (9)
  • DanielWalther (3)
  • tommiehansen (3)
  • PierreMesure (1)
  • frozzare (1)
  • stephenkirk (1)
Top Labels
Issue Labels
Pull Request Labels
dependencies (9)

Dependencies

RPackage/DESCRIPTION cran
  • R >= 3.2.0 depends
  • checkmate * imports
  • dplyr * imports
  • httr * imports
  • lubridate * imports
  • testthat * imports
package-lock.json npm
  • 441 dependencies
package.json npm
  • jest ^26.1.0
  • jest-expect-message ^1.0.2
  • papaparse ^5.2.0
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite