Archive for Category 'Data and Methods'

All singing, all dancing 3d function plots with beamer, pgfplots and animate.sty

latent 1 150x150 All singing, all dancing 3d function plots with beamer, pgfplots and animate.sty

Source: Long/Freese, Regression Models for Categorical Dependent Variables Using Stata

I use emacs/ All singing, all dancing 3d function plots with beamer, pgfplots and animate.sty for all my textprocessing needs, and for the last four or five years, I have created all my slides with Till Tantaus excellent “beamer” class. At the moment, I’m teaching a 2nd year stats course (imagine doing this with PowerPoint – the horror! the horror!), so I sometimes use graphs from the assigned text like this one from Long&Freese that illustrates the latent variable/threshold interpretation of the binary logit model. The message should be fairly clear:  All singing, all dancing 3d function plots with beamer, pgfplots and animate.sty depends on  All singing, all dancing 3d function plots with beamer, pgfplots and animate.sty andfollows a standard logistic distribution around its conditional mean.

Continue reading “All singing, all dancing 3d function plots with beamer, pgfplots and animate.sty” »

How to get from Stata to Pajek

I’m teaching an introductory SNA class this year. Following a time-honoured tradition, I conducted a small network survey at the beginning of the class using Limesurvey. Getting the data from Limesurvey to Stata via CSV was easy enough. Here is the data set. But how does one get the data from Stata to Pajek for analysis? Actually, it’s quite easy.

First, we need to change the layout of the data. In the data set, there is one record for each of the 13 respondent. Each record has 13 variables, one for each (potential) arc connecting the respondent to other students in the class. This is equivalent to Stata’s “wide” form. Stata’s reshape command will happily re-arrange the data to the “long” form, with one record for each arc. This is what Pajek requires.

Continue reading “How to get from Stata to Pajek” »

Statistics and Data links roundup for November 23rd through December 29th

Statistics and Data links roundup for November 23rd through December 29th:

  • The Data and Story Library – DASL (pronounced “dazzle”) is an online library of datafiles and stories that illustrate the use of basic statistics methods. We hope to provide data from a wide variety of topics so that statistics teachers can find real-world examples that will be interesting to their students. Use DASL’s powerful search engine to locate the story or datafile of interest.
  • Drawing graphs using tikz/pgf & gnuplot | politicaldata.org -

Statistics and Data links roundup for November 14th through November 23rd

Statistics and Data links roundup for November 14th through November 23rd:

It’s surprisingly difficult to find suitable datasets for a sna workshop that are relevant for political scientists.

Statistics and Data links roundup

300px The Normal Distribution.svg Statistics and Data links roundup
Image via Wikipedia

Continue reading “Statistics and Data links roundup” »

Data on Knowledge Networks in Political Science Published

Replication data for our recent article on knowledge networks in Political Science are available from my dataverse

Article on Networks in Political Science Published

Harald’s and my article on citation and collaboration networks in German and British Political Science has finally appeared in print and online, which is obviously great. Here is the abstract:

Citations and co-publications are one important indicator of scientific communication and collaboration. By studying patterns of citation and co-publication in four major European Political Science journals (BJPS, PS, PVS and ÖZP), we demonstrate that compared to the conduits of communication in the natural sciences, these networks are rather sparse. British Political Science, however, is clearly less fragmented than its German speaking counterpart.

Continue reading “Article on Networks in Political Science Published” »

Weighting Survey Data: Not Necessarily a Brilliant Idea

Should one weight their survey data? Is it worth the effort? The short answer must be ‘maybe’ or ‘it depends’. A slightly longer and much more useful answer was given by Leslie Kish in his enormously helpful paper ‘Weighting: Why, when and how’. Today (well, actually I submitted the final manuscript 2.5 years ago – that’s scientific progress for you!), I have added my own two cent with a short chapter that looks at the effects and non-effects of common weighting procedures (in German). The bottom line is that if you employ the usual weighting variables (age, gender, education and maybe class or region) as controls in your regression, weighting will make next to no difference but might mess with your standard errors.
Continue reading “Weighting Survey Data: Not Necessarily a Brilliant Idea” »

Is salience a cause or a consequence of radical right electoral support?

In my pet model, the salience of issues such as immigration or national identiy in the manifestos of established parties

support salience 300x217 Is salience a cause or a consequence of radical right electoral support?

Random shock to salience - support cannot be bothered to react

makes a vote for the extreme right/radical right much more likely. There is, however, a potential problem with this argument: if radical right support is stable in the medium term, and if other parties react to past successes for the radical right by modifying their manifestos, this relationship might be spurious. In my paper for the ECPR conference at Potsdam, I use a time-series model  to address this problem: I estimate a Vector Auto Regression (VAR) of radical right support and issue salience in France (while controlling for immigration and unemployment). As it turns out, salience is independent of previous radical right success. This finding provides some support for my original argument, though the analysis  preliminary and restricted to France (at the moment). Continue reading “Is salience a cause or a consequence of radical right electoral support?” »

Web-scraping made easy: outwit

195px EAN 13 ISBN 13.svg Web scraping made easy: outwit

Image via Wikipedia

These days, a bonanza of political information is freely available on the internet.  Sometimes this information comes in the guise of excel sheets, comma separated data or other formats which are more or less readily machine readable. But more often than not, information is presented as tables designed to be read by humans. This is where the gentle art of screen scraping, web scraping or spidering comes in. In the past, I have used kludgy Perl scripts to get electoral results at the district level off sites maintained by the French ministry of the interior or by universities (very interesting if you do not really speak/read French). A slightly more elegant approach might be to use R’s builtin Perl-like capabilities for doing the job, as demonstrated by Simon Jackman. Finally, Python is gaining ground in the political science community,  which has some very decent libraries for screen/web scraping – see this elaborate post on Drew Conway’s Zero Intelligence Agents blog. But, let’s face it: I am lazy. I want to spend time analysing the data, not scraping them. And so I was very pleased when I came across outwit, a massive plugin for the firefox browser (Linux, Mac and Windows versions available) that acts as a point-and-click scraper.

Continue reading “Web-scraping made easy: outwit” »