{"id":354,"date":"2012-03-12T08:55:13","date_gmt":"2012-03-12T08:55:13","guid":{"rendered":"http:\/\/rulesofreason.wordpress.com\/?p=354"},"modified":"2019-01-30T19:20:05","modified_gmt":"2019-01-30T19:20:05","slug":"compiling-government-positions-from-the-manifesto-project-data-with-r","status":"publish","type":"post","link":"http:\/\/re-design.dimiter.eu\/?p=354","title":{"rendered":"Compiling government positions from the Manifesto Project data with R"},"content":{"rendered":"<p><strong>****N.B. I have updated the functions in February 2019 to makes use of the latest Manifesto data. See for details here.***<\/strong><\/p>\n<p><span style=\"font-style: inherit; line-height: 1.625;\">The <\/span><a style=\"font-style: inherit; line-height: 1.625;\" href=\"https:\/\/manifesto-project.wzb.eu\/\" target=\"_blank\" rel=\"noopener\">Manifesto Project<\/a><span style=\"font-style: inherit; line-height: 1.625;\"> (former Manifesto Research Group, Comparative Manifestos Project) has assembled a database of &#8216;quantitative content analyses of parties\u2019 election programs from more than 50 countries covering all free, democratic elections since 1945&#8217; and is freely accessible online. The data, however, is available only at the party, and not at the government (cabinet) level. In order to automate \u00a0the process of extracting government positions from the Manifesto data, I wrote a simple <\/span><a style=\"font-style: inherit; line-height: 1.625;\" href=\"http:\/\/www.r-project.org\/\" target=\"_blank\" rel=\"noopener\">R<\/a><span style=\"font-style: inherit; line-height: 1.625;\"> function which combines the party-level Manifesto data with the data on government compositions from the <\/span><a style=\"font-style: inherit; line-height: 1.625;\" href=\"http:\/\/parlgov.org\/\" target=\"_blank\" rel=\"noopener\">ParlGov<\/a><span style=\"font-style: inherit; line-height: 1.625;\"> database. The function <\/span><code style=\"font-style: inherit;\">manifesto.position()<\/code><span style=\"font-style: inherit; line-height: 1.625;\"> produces a data frame with the country, the time period, the government position of interest, and an index (id) variable. You can get the data either at a monthly or yearly period of aggregation, specify the start and the end dates, and get the data in &#8216;long&#8217; or &#8216;wide&#8217; format.<\/span><\/p>\n<p>Here is how it works: First, you would need <a href=\"http:\/\/www.r-project.org\/\">R<\/a> up and running (with the &#8216;<a href=\"http:\/\/had.co.nz\/ggplot2\/\" target=\"_blank\" rel=\"noopener\">ggplot2<\/a>&#8216; library installed). Second, you need the original <a href=\"https:\/\/manifesto-project.wzb.eu\/users\/new\" target=\"_blank\" rel=\"noopener\">data on party positions<\/a> and on <a href=\"http:\/\/parlgov.org\/stable\/static\/data\/stable-cp1252\/parlgov-short-windows.zip\" target=\"_blank\" rel=\"noopener\">government compositions<\/a>, and this <a href=\"\/\/www.dimiter.eu\/Data_files\/cabinets\/data%20manipulation%20script.R\" target=\"_blank\" rel=\"noopener\">script <\/a>to merge them. Alternatively, you can download (or source) directly the resulting merged dataset <a href=\"http:\/\/dimiter.eu\/Data_files\/cabinets\/cabinets.txt\" target=\"_blank\" rel=\"noopener\">here<\/a>. Third, you need to source the<a href=\"http:\/\/www.dimiter.eu\/Data_files\/cabinets\/government%20position%20extraction%20functions.R\" target=\"_blank\" rel=\"noopener\"> file<\/a> containing the functions.<\/p>\n<p>Here are a few examples of the function in action:<\/p>\n<pre>####\n### 1. Load the data file from the working directory or from the URL (default)\n#cabinets&lt;-read.table ('cabinets.txt', as.is=TRUE)\n<code>cabinets&lt;-read.table ('http:\/\/www.dimiter.eu\/Data_files\/cabinets\/cabinets.txt', as.is=TRUE)<\/code> ### 2. Load the functions from the working directory or from the URL (default) #source('government position extraction functions.R') <code>source('http:\/\/www.dimiter.eu\/Data_files\/cabinets\/government%20position%20extraction%20functions.R')<\/code> ### Use of manifesto.position(x, weighted=TRUE, long=TRUE, period='year', start=1945, end=2010) ### Inputs: ### x [the name of the Manifesto item] ### weighted [weighted mean of the government position or a simple unweighted mean] ### period [year (default) or month - time period for which the position is extracted] ### long [long (default) or wide version of the output data] ### start [starting year for the extraction; 1945 is default] ### end [end year of the extraction; 2010 is default] ### Output: A data frame with four columns - State, Year (Year.month), position [the actual position], id [Year.State(Year.month.State)] ### For details see the sourced file above ### Examples ## 1. Extract the left\/right positions <code>lr&lt;-manifesto.position('rile')<\/code> <code>summary(lr)<\/code> ## 2. Exatract the unweighted International peace position from 1980 until 1999 <code>intp&lt;-manifesto.position('intpeace', weighted=F, start=1980, end=1999)<\/code> <code>hist(intp$position)<\/code> ## 3. Exatract the weighted Welfare position from 1980 until 1999 in a wide, rather than long shape - states are rows and years are colunms <code>welfare&lt;-manifesto.position('welfare', long=F, start=1980, end=1999)<\/code> <code>welfareT&lt;-t(welfare)<\/code> ##this would make the countries columns and the years rows. ## 4. Left\/right on a monthly basis from 1980 till 1990 <code>lrm&lt;-manifesto.position('rile', period='month', start=1980, end=1990)<\/code><\/pre>\n<p>I hope you find the function useful. Feel free to e-mail any suggestions, remarks, reports on bugs, etc. If you use the function and the data, don&#8217;t forget to acknowledge the work of the people who collected the <a href=\"https:\/\/manifesto-project.wzb.eu\/\" target=\"_blank\" rel=\"noopener\">Manifestos<\/a> and who compiled the <a href=\"http:\/\/parlgov.org\/\" target=\"_blank\" rel=\"noopener\">ParlGov<\/a> database.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>****N.B. I have updated the functions in February 2019 to makes use of the latest Manifesto data. See for details here.*** The Manifesto Project (former Manifesto Research Group, Comparative Manifestos Project) has assembled a database of &#8216;quantitative content analyses of parties\u2019 election programs from more than 50 countries covering all free, democratic elections since 1945&#8217; and is freely accessible online. The data, however, is available only at the party, and not at the government (cabinet) level. In order to automate \u00a0the process of extracting government positions from the Manifesto data, I wrote a simple R function which combines the party-level Manifesto data with the data on government compositions from the ParlGov database. The function manifesto.position() produces a data frame with the country, the time period, the government position of interest, and an index (id) variable. You can get the data either at a monthly or yearly period of aggregation, specify the start and the end dates, and get the data in &#8216;long&#8217; or &#8216;wide&#8217; format. Here is how it works: First, you would need R up and running (with the &#8216;ggplot2&#8216; library installed). Second, you need the original data on party positions and on government compositions, and this script to merge them. Alternatively, you can download (or source) directly the resulting merged dataset here. Third, you need to source the file containing the functions. Here are a few examples of the function in action: #### ### 1. Load the data file from the working directory or from the URL (default)&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"http:\/\/re-design.dimiter.eu\/?p=354\">Continue reading<span class=\"screen-reader-text\">Compiling government positions from the Manifesto Project data with R<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[37,39],"tags":[110,143,307,377,394,395,461,465,540],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7g3hj-5I","jetpack-related-posts":[{"id":1028,"url":"http:\/\/re-design.dimiter.eu\/?p=1028","url_meta":{"origin":354,"position":0},"title":"Government positions from party-level Manifesto data (with R)","date":"January 31, 2019","format":false,"excerpt":"In empirical research in political science and public policy, we often need estimates of the political positions of governments (cabinets) and the salience of different issues for different governments (cabinets). Data on policy positions and issue salience is available, but typically at the level of political parties. One prominent source\u2026","rel":"","context":"In &quot;Measurement&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":377,"url":"http:\/\/re-design.dimiter.eu\/?p=377","url_meta":{"origin":354,"position":1},"title":"Visualizing left-right government positions","date":"March 19, 2012","format":false,"excerpt":"How does the political landscape of Europe change over time? One way to approach this question is to map the socio-economic left-right positions of the governments in power. So let's plot the changing ideological \u00a0positions of the governments using data from the Manifesto project! As you will see below, this\u2026","rel":"","context":"In &quot;Data visualization&quot;","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/re-design.dimiter.eu\/wp-content\/uploads\/2012\/03\/rplot2.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":449,"url":"http:\/\/re-design.dimiter.eu\/?p=449","url_meta":{"origin":354,"position":2},"title":"Diffusion of smoking bans in Europe","date":"April 23, 2012","format":false,"excerpt":"My paper on the diffusion of smoking bans in Europe has been accepted in Public Administration. It probably won't be published until next year\u00a0so here is a link to the pre-print and a graph of\u00a0two of the important results of the paper: the probability of\u00a0enactment of a more comprehensive (full)\u2026","rel":"","context":"In &quot;Policy implementation&quot;","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/re-design.dimiter.eu\/wp-content\/uploads\/2012\/04\/smoking-bans.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":123,"url":"http:\/\/re-design.dimiter.eu\/?p=123","url_meta":{"origin":354,"position":3},"title":"Academic fraud reaching new heights","date":"November 1, 2011","format":false,"excerpt":"Academic \u00a0fraud is reaching new heights lows. Dutch social psychologist Diederik Stapel (Tilburg University)\u00a0 is the culprit this time. A commission looking into the issue came up with a report [in Dutch] on Monday saying that \"the extent of fraud is very significant\" (p.5). Stapel fabricated data for at least\u2026","rel":"","context":"In &quot;Academic publishing&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":837,"url":"http:\/\/re-design.dimiter.eu\/?p=837","url_meta":{"origin":354,"position":4},"title":"Immigration from Central and Eastern Europe fuels support for Eurosceptic parties in the UK","date":"May 4, 2015","format":false,"excerpt":"Combining political, demographic and economic data for the local level in the UK, we find that the presence of immigrants from Central and Eastern Europe (CEE) is related to higher voting shares cast for parties with Eurosceptic positions at the 2014 elections for the European Parliament. Evidence across Europe supports\u2026","rel":"","context":"In &quot;EU governance&quot;","img":{"alt_text":"Data source: Standard Eurobarometer (59 to 82).","src":"http:\/\/eurosearch.files.wordpress.com\/2015\/05\/figure-1-importance-of-immigration.png?w=350&h=200&crop=1","width":350,"height":200},"classes":[]},{"id":647,"url":"http:\/\/re-design.dimiter.eu\/?p=647","url_meta":{"origin":354,"position":5},"title":"New data source for political science researchers","date":"December 19, 2012","format":false,"excerpt":"Political Data Yearbook Interactive\u00a0is a new source for data on election results, turnout and government composition for all EU and some non-European countries. It is basically an online version of the yearbooks that ECPR printed as part of the European Journal for Political Research for many years now. The interactive\u2026","rel":"","context":"In &quot;Data visualization&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/re-design.dimiter.eu\/index.php?rest_route=\/wp\/v2\/posts\/354"}],"collection":[{"href":"http:\/\/re-design.dimiter.eu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/re-design.dimiter.eu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/re-design.dimiter.eu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/re-design.dimiter.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=354"}],"version-history":[{"count":1,"href":"http:\/\/re-design.dimiter.eu\/index.php?rest_route=\/wp\/v2\/posts\/354\/revisions"}],"predecessor-version":[{"id":1033,"href":"http:\/\/re-design.dimiter.eu\/index.php?rest_route=\/wp\/v2\/posts\/354\/revisions\/1033"}],"wp:attachment":[{"href":"http:\/\/re-design.dimiter.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=354"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/re-design.dimiter.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=354"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/re-design.dimiter.eu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=354"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}