<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" ><channel><title>Kai Arzheimer &#187; Data and Methods</title> <atom:link href="http://www.kai-arzheimer.com/blog/category/data-and-methods/feed/" rel="self" type="application/rss+xml" /><link>http://www.kai-arzheimer.com/blog</link> <description>A political science blog</description> <lastBuildDate>Sat, 21 Jan 2012 19:06:37 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>Running MLwiN from within Stata</title><link>http://www.kai-arzheimer.com/blog/running-mlwin-stata/</link> <comments>http://www.kai-arzheimer.com/blog/running-mlwin-stata/#comments</comments> <pubDate>Sat, 21 Jan 2012 16:43:43 +0000</pubDate> <dc:creator>kai</dc:creator> <category><![CDATA[Data and Methods]]></category> <category><![CDATA[Political Science]]></category> <category><![CDATA[bayes]]></category> <category><![CDATA[Bristol]]></category> <category><![CDATA[mlwin]]></category> <category><![CDATA[multi-level modelling]]></category> <category><![CDATA[pdf]]></category> <category><![CDATA[software]]></category> <category><![CDATA[stata]]></category><guid isPermaLink="false">http://www.kai-arzheimer.com/blog/?p=1021</guid> <description><![CDATA[runmlwin is an ado that claims to make the functionality of MLwiN available as a Stata command, postestimation analysis and all. Too good to be true?]]></description> <content:encoded><![CDATA[<p>In the past, I did a lot of multi-level modelling with <a class="zem_slink" title="MLwiN" href="http://en.wikipedia.org/wiki/MLwiN" rel="wikipedia">MLwiN</a> 2.02, which I quickly learned to loath. Back in the late 1990s, MLwiN was perhaps the first ML software that had a somewhat intuitive interface, i.e. it allowed one to build a model by pointing and clicking. Moreover, it printed updated estimates on the screen while cycling merrily through the parameter space. That was sort of cool, as it could take minutes to reach convergence, and without the updating, one would never have been sure that the program had not crashed yet. Which it did quite often, even for simple models.</p><p>Worse than the bugs was the lack of proper scriptability. Pointing and clicking  loses its appeal when you need to run the same model on 12 different datasets, or when you are looking at three variants of the same model and 10 recodes of the same variable. Throw in the desire semi-automatically re-compile the findings from these exercises into two nice tables for inclusion in <img src='http://s0.wp.com/latex.php?latex=%5CLaTeX&#038;bg=ffffff&#038;fg=000&#038;s=0' alt=" Running MLwiN from within Stata" title='&#92;LaTeX' class='latex' /> again and again after finding yet another problem with a model, and you will agree that any  piece of software that is not scriptable is pretty useless for scientists.</p><p><span id="more-1021"></span></p><p>MLwiN&#8217;s command language was unreliable and woefully underdocumented, and everything was a pain. So I embraced xtmixed when it came along with Stata 9/10, which solved all of these problems.</p><div id="attachment_1025" class="wp-caption alignright" style="width: 310px"><a href="http://www.kai-arzheimer.com/blog/wp-content/uploads/2012/01/london-0.png" target="_blank"><img class="size-medium wp-image-1025" title="runmlwin presentation (pdf)" src="http://www.kai-arzheimer.com/blog/wp-content/uploads/2012/01/london-0-300x225.png" alt="london 0 300x225 Running MLwiN from within Stata" width="300" height="225" /></a><p class="wp-caption-text">runmlwin presentation (pdf)</p></div><p>But xtmixed is slow with large datsets/complex models. It relies on quadrature, which is exact but computationally intensive. MLwiN works with approximations of the likelihood function (quick and dirty) or MCMC (strictly speaking a Bayesian approach, but people don&#8217;t ask to many questions because it tends to be faster than quadrature). Moreover, MLwiN can run a lot of fancy models that xtmixed cannot, because it is a highly specialised program that has been around for a very long time.</p><p>Enter the good people over at the <a href="http://www.bristol.ac.uk/cmm/" target="_blank">Centre for Multilevel Modelling</a> at <a class="zem_slink" title="Bristol" href="http://maps.google.com/maps?ll=51.45,-2.58333333333&amp;spn=0.1,0.1&amp;q=51.45,-2.58333333333%20%28Bristol%29&amp;t=h" rel="geolocation">Bristol</a>, who have come up with runmlwin, an ado that essentially makes the functionality of MLwiN available as a Stata command, postestimation analysis and all. Can&#8217;t wait to see if this works with Linux, wine and my ancient binaries, too.</p><div class="su-linkbox" id="post-1021-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://www.kai-arzheimer.com/blog/running-mlwin-stata/&quot;&gt;Running MLwiN from within Stata&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div>]]></content:encoded> <wfw:commentRss>http://www.kai-arzheimer.com/blog/running-mlwin-stata/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Robust Regression of Aggregate Data in Stata</title><link>http://www.kai-arzheimer.com/blog/robust-regression-aggregate-data-stata/</link> <comments>http://www.kai-arzheimer.com/blog/robust-regression-aggregate-data-stata/#comments</comments> <pubDate>Sat, 14 Jan 2012 20:45:00 +0000</pubDate> <dc:creator>kai</dc:creator> <category><![CDATA[Data and Methods]]></category> <category><![CDATA[My Stuff]]></category> <category><![CDATA[Political Science]]></category> <category><![CDATA[aggregate data]]></category> <category><![CDATA[ecological fallacy]]></category> <category><![CDATA[Greens]]></category> <category><![CDATA[MM]]></category> <category><![CDATA[municipalities]]></category> <category><![CDATA[regression]]></category> <category><![CDATA[rhineland-palatinate]]></category> <category><![CDATA[robreg]]></category> <category><![CDATA[robust]]></category> <category><![CDATA[stata]]></category> <category><![CDATA[voters]]></category><guid isPermaLink="false">http://www.kai-arzheimer.com/blog/?p=1006</guid> <description><![CDATA[I&#8217;m currently working on an analysis of the latest state election in Rhineland-Palatinate using aggregate data alone, i.e. electoral returns and structural information, which is available at the level of the state&#8217;s roughly 2300 municipalities. The state&#8217;s Green party (historically very weak) has roughly tripled their share of the vote since the last election in [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;m currently working on an analysis of the latest state election in <a class="zem_slink" title="Rhineland-Palatinate" href="http://en.wikipedia.org/wiki/Rhineland-Palatinate" rel="wikipedia">Rhineland-Palatinate</a> using aggregate data alone, i.e. electoral returns and structural information, which is available at the level of the state&#8217;s roughly 2300 municipalities. The state&#8217;s Green party (historically very weak) has roughly tripled their share of the vote since the last election in 2006, and I want to know were all these additional votes come from. And yes, I&#8217;m treading very careful around the very large potential ecological fallacy that lurks at the centre of my analysis, regressing Green gains on factors such as tax receipts and distance from next university town, but never claiming that the rich or the students or both turned to the Greens.</p><p>One common problem with this type of analysis is that not all municipalities are created equal. There is a surprisingly large number of flyspeck villages with only a few dozen voters on, whereas the state&#8217;s capital boasts more than 140,000 registered voters. Most places are somewhere in between. Having many small municipalities in the regression feels wrong for at least two reasons. First, small-scale changes of political preferences in tiny electorates will result in relatively large percentage changes. Second, the behaviour of a relatively large number of voters who happen to live in a small number of relatively large municipalities will be grossly underrepresented, i.e. the countryside will drive the results.</p><p><span id="more-1006"></span></p><p>My PhD supervisor, who did a lot of this stuff in his time, used to weigh municipalities by the size of their electorates to deal with these problems. But this would lead to pretty extreme weights in my case. Moreover, while voters bring about electoral results, I really don&#8217;t want to introduce claims about individual behaviour through the back door.</p><p>My next idea was to weigh municipalities by the square root of the size their electorates. Why? In a sense, the observed behaviour is like a sample from the underlying distribution of preferences, and the reliability of this estimate is proportional to the square root of the number of people in a given community. But even taking the square root left me with weights that were quite extreme, and the concern regarding the level of analysis still applied.</p><p>Then I realised that instead of weighing by size, I could simply <a title="Weighting Survey Data: Not Necessarily a Brilliant Idea" href="http://www.kai-arzheimer.com/blog/weighting-survey-data-not-necessarily-a-brilliant-idea/" target="_blank">include the size of the electorate as an additional independent variable to correct for potential bias</a>. But this still left me exposed to the danger of extreme outliers (think small, poor, rural communities where the number of Green voters goes up from one to four, a whopping 300 per cent increase) playing havoc with my analysis. So I began reading up on robust regression and its various implementations in Stata.<img class="alignright" src="http://upload.wikimedia.org/wikipedia/commons/b/b9/Line_with_outliers.svg" alt="Line with outliers Robust Regression of Aggregate Data in Stata" width="431" height="431" title="Robust Regression of Aggregate Data in Stata photo" /></p><p>The basic idea of robust regression is that real data are more likely than not a mixture of (at least) two mechanisms: the &#8220;true model&#8221; whose coefficients we want to estimate one the one hand, and some other process(es) that contaminate the data on the other. If these contaminating data points are far away from the multivariate mean of the x-Variables (outliers) and deviate substantially from the true regression line, they will bias the estimates.</p><p><a class="zem_slink" title="Robust regression" href="http://en.wikipedia.org/wiki/Robust_regression" rel="wikipedia" target="_blank">Robust regression</a> estimators are able to deal with a high degree of contamination, i.e. they can recover the true parameters even if there are many outliers amongst the data points. The downside is that the older generation of robust estimators also have a low efficiency (the estimates are unbiased but have a much higher variance than regular OLS-estimates).</p><p>A number of newer (post-1980) estimators, however, are less affected by this problem. One particular promising approach is the MM estimator, that has been implemented in Stata ados by <a href="http://ideas.repec.org/e/pve73.html" target="_blank">Veradi</a>/Croux (<a href="ideas.repec.org/c/boc/bocode/s457057.html" target="_blank">MMregress</a>) and by Ben <a href="http://ideas.repec.org/e/pja61.html" target="_blank">Jann</a> (<a href="ideas.repec.org/c/boc/bocode/s457114.html" target="_blank">robreg mm</a>). Jann&#8217;s ado seems to be faster and plays nicely with his esttab/estout package, so I went with that.</p><p>The MM estimator works basically by identifying outliers and weighing them down, so it amounts to a particularly sophisticated case of weighted least squares. Using the defaults, MM claims to have 85 per cent of the efficiency of OLS while being able to deal with up to 50 per cent contamination. As you can see in the table, the MM estimates deviate somewhat from their OLS counterparts. The difference is most pronounced for the effect of tax receipts (hekst).</p><p>robreg mm has an option to store the optimal weights. I ran OLS again using these weights (column 3), thereby recovering the MM estimates and demonstrating that MM is really just weighted least squares (standard errors (which are not very relevant here) differ, because robreg uses the robust variance estimator). This is fascinating stuff, and I&#8217;m looking forward to a forthcoming book by Jann and Veradi on robust regression in Stata (to be published by Stata Press in 2012).</p><pre>                     OLS              MM            WLS  

greenpct2006        0.193***        0.329***        0.329***
                 (0.0349)        (0.0592)        (0.0278)   

hekst               0.311***        0.634***        0.634***
                 (0.0894)         (0.124)        (0.0688)   

senioren          -0.0744***       -0.100***       -0.100***
                 (0.0131)        (0.0149)       (0.00994)   

kregvoters11      -0.0125        -0.00844        -0.00844
                 (0.0146)       (0.00669)       (0.00982)   

kbevdichte         -0.433        -0.00750        -0.00750
                  (0.464)         (0.330)         (0.326)   

uni                 1.258           0.816           0.816
                  (1.695)         (0.765)         (1.137)   

lnunidist          -0.418**        -0.372**        -0.372***
                  (0.127)         (0.113)        (0.0918)   

_cons               8.232***        7.078***        7.078***
                  (0.627)         (0.663)         (0.461)</pre><div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=0cbcd4ef-3dc6-4b9b-8610-afb3a9085e9e" alt=" Robust Regression of Aggregate Data in Stata"  title="Robust Regression of Aggregate Data in Stata photo" /></a></div><div class="su-linkbox" id="post-1006-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://www.kai-arzheimer.com/blog/robust-regression-aggregate-data-stata/&quot;&gt;Robust Regression of Aggregate Data in Stata&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div>]]></content:encoded> <wfw:commentRss>http://www.kai-arzheimer.com/blog/robust-regression-aggregate-data-stata/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Are Germans More Afraid of Neo-Nazis Than of Islamists?</title><link>http://www.kai-arzheimer.com/blog/germans-afraid-neo-nazis-islamists/</link> <comments>http://www.kai-arzheimer.com/blog/germans-afraid-neo-nazis-islamists/#comments</comments> <pubDate>Fri, 02 Dec 2011 20:20:00 +0000</pubDate> <dc:creator>kai</dc:creator> <category><![CDATA[Data and Methods]]></category> <category><![CDATA[My Stuff]]></category> <category><![CDATA[Politics]]></category> <category><![CDATA[access panel]]></category> <category><![CDATA[binomial]]></category> <category><![CDATA[distribution]]></category> <category><![CDATA[exact confidence intervals]]></category> <category><![CDATA[extremism]]></category> <category><![CDATA[germany]]></category> <category><![CDATA[Islam]]></category> <category><![CDATA[multinomial]]></category> <category><![CDATA[neo nazi]]></category> <category><![CDATA[proportions]]></category> <category><![CDATA[right wingers]]></category> <category><![CDATA[stata]]></category> <category><![CDATA[terrorism]]></category> <category><![CDATA[yougov poll]]></category><guid isPermaLink="false">http://www.kai-arzheimer.com/blog/?p=991</guid> <description><![CDATA[Whose afraid of whom? The liberal German weekly Zeit has commissioned a YouGov poll which demonstrates that Germans are more afraid of right-wing terrorists than of Islamist terrorists. The question read &#8220;What is, in your opinion, the biggest terrorist threat in Germany?&#8221; On offer were right-wingers (41 per cent), Islamists (36.6 per cent), left-wingers (5.6 [...]]]></description> <content:encoded><![CDATA[<div id="outline-container-1" class="outline-2"><h2 id="sec-1">Whose afraid of whom?</h2><div id="text-1" class="outline-text-2"><p>The liberal German weekly Zeit has commissioned a YouGov poll which demonstrates that <a href="http://www.zeit.de/politik/deutschland/2011-12/rechtsextremismus-umfrage-yougov" target="_blank">Germans are more afraid of right-wing terrorists than of Islamist terrorists</a>. The question read &#8220;What is, in your opinion, the biggest terrorist threat in Germany?&#8221; On offer were right-wingers (41 per cent), Islamists (36.6 per cent), left-wingers (5.6 per cent), other groups (3.8 per cent), or (my favourite) &#8220;no threat&#8221; (13 per cent). This is a pretty daft question anyway. Given the news coverage of the Neo-Nazi gang that has killed at least ten people more or less under the eyes of the authorities, and given that the authorities have so far managed to stop would-be terrorists in their tracks, the result is hardly surprising.</p><p><span id="more-991"></span></p><p>Nonetheless, the difference of just under five percentage points made the headlines, because there is a subtext for Zeit readers: Germans are worried about right-wing terrorism (a few weeks ago many people would have denied that there are right-wing terrorists operating in Germany), which must be a good thing, and they are less concerned about Islamist terrorists, which is possibly a progressive thing. Or something along those lines.</p><p>But is the five-point difference real?</p><p>YouGov has interviewed 1043 members of its online access panel. If we assume (and this is a heroic assumption) that these respondents can be treated like a simple random sample, what are the confidence intervals?</p></div></div><div id="outline-container-2" class="outline-2"><h2 id="sec-2">Binomial Confidence Intervals</h2><div id="text-2" class="outline-text-2"><p>First, we could treat the two categories as if they were distributed as binomial and ask Stata for exact confidence intervals.</p><pre>cii 1043 round(1043*.41)
cii 1043 round(1043*.366)</pre><p>The confidence intervals overlap, so we&#8217;re lead to think that the proportions in the population are not necessarily different. But the two categories are not independent, because the &#8220;not right-wingers&#8221; answers include the &#8220;Islamists&#8221; answers and vice versa, so the multinomial is a better choice.</p></div></div><div id="outline-container-3" class="outline-2"><h2 id="sec-3">Multinomial Model</h2><div id="text-3" class="outline-text-2"><p>It is easy to re-create the univariate distribution of answers in Stata:</p><pre>set obs 5
gen threat = _n
lab def threat 1 "right-wingers" 2 "islamists" 3 "left-wingers" 4 "other" 5 "no threat"
lab val threat threat

gen number = round(1043* 0.41) in 1
replace number = round(1043* 0.366) in 2
replace number = round(1043* 0.056) in 3
replace number = round(1043* 0.038) in 4
replace number = round(1043* 0.13) in 5
expand number</pre><p>Next, run an empty multinomial logit model</p><pre>mlogit threat,base(5)</pre><p>The parameters of the model reproduce the observed distribution exactly and are therefore not very interesting, but the estimates of their standard errors are available for testing hypotheses:</p><pre>test [right_wingers]_cons = [islamists]_cons</pre><p>At the conventional level of 0.05, we cannot reject the null hypothesis that both proportions are equal in the population, i.e. we cannot tell if Germans are really more worried about one of the two groups.</p></div></div><div id="outline-container-4" class="outline-2"><h2 id="sec-4">Simulation</h2><div id="text-4" class="outline-text-2"><p>Just for the fun of it, we can carry out one additional test and ask a rather specific question: If both proportions are 0.388 in the population and the other three are identical to their values in the sample, what is the probability of observing a difference of at least 4.4 points in favour of right-wingers?</p><p>The idea is to sample repeatedly from a multinomial with known probabilities. This could be done more elegantly by defining a program and using Stata&#8217;s simulate command, but if your machine has enough memory, it is just as easy and possibly faster to use two loops to generate/analyse the required number of variables (one per simulation) and to fill them all in one go with three lines of mata code. Depending on the number of trials, you may have to adjust maxvars</p><pre>local trials = 10000
foreach v of newlist s1-s`trials' {
qui gen `v' = .
}

mata:
probs =(.388,.388,.056,.038,.13)
st_view(X.,.,"s1-s`trials'",)
X[.,.] = rdiscrete(1043,`trials',probs)
end

local excess = 0

forvalues sample = 1/`trials' {
qui tab s`sample' if s`sample' == 1
local rw = r(N)
qui tab s`sample' if s`sample' == 2
local isl = r(N)
if (`rw' / 1043 * 100) - (`isl' / 1043 * 100) &gt;=4.4 local excess = `excess' +1
}

display "Difference &gt;=4.4 in `excess' of `trials' samples"</pre><p>Seems the chance of a 4.4 point difference is between 5 and 6 per cent. This probability is somewhat smaller than the one from the multinomial model because the null hypothesis is more specific, but still not statistically significant. And the Zeit does not even have a proper random sample, so there is no scientific evidence for the claim that Germans are more afraid of right-wing extremists than of Islamists, what ever that would have been worth. Bummer.</p></div></div><div class="su-linkbox" id="post-991-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://www.kai-arzheimer.com/blog/germans-afraid-neo-nazis-islamists/&quot;&gt;Are Germans More Afraid of Neo-Nazis Than of Islamists?&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div>]]></content:encoded> <wfw:commentRss>http://www.kai-arzheimer.com/blog/germans-afraid-neo-nazis-islamists/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Quick and Fancy Conference Posters with beamer/beamerposter</title><link>http://www.kai-arzheimer.com/blog/quick-and-fancy-conference-posters-latex/</link> <comments>http://www.kai-arzheimer.com/blog/quick-and-fancy-conference-posters-latex/#comments</comments> <pubDate>Sun, 06 Nov 2011 21:24:00 +0000</pubDate> <dc:creator>kai</dc:creator> <category><![CDATA[Data and Methods]]></category> <category><![CDATA[My Stuff]]></category> <category><![CDATA[beamer]]></category> <category><![CDATA[beamerposter]]></category> <category><![CDATA[conference]]></category> <category><![CDATA[emacs]]></category> <category><![CDATA[latex]]></category> <category><![CDATA[poster]]></category> <category><![CDATA[presentation]]></category><guid isPermaLink="false">http://www.kai-arzheimer.com/blog/?p=983</guid> <description><![CDATA[My default for writing anything that is longer than a page is LaTeX  (possibly via org-mode, if it is short and simple). In fact, the bond that ties me to the LaTeX/Emacs combo is so strong that I want to use it even for texts that are exactly one page long, i.e. conference posters. CTAN [...]]]></description> <content:encoded><![CDATA[<p>My default for writing anything that is longer than a page is LaTeX  (possibly via <a href="http://orgmode.org/">org-mode</a>, if it is short and simple). In fact, the bond that ties me to the LaTeX/Emacs combo is so strong that I want to use it even for texts that are <em>exactly</em> one page long, i.e. conference posters.</p><p><a href="http://texcatalogue.sarovar.org/bytopic.html#posterpackages">CTAN lists a lot of packages and frameworks for posters</a>, but I found most of them too heavy/compl</p><p><span id="more-983"></span></p><div class="wp-caption alignright" style="width: 369px"><a href="http://www.kai-arzheimer.com/political-geography-ab.pdf"><img title="Political Geography Poster" src="http://www.kai-arzheimer.com/images/political-geography-ab.jpg" alt="political geography ab Quick and Fancy Conference Posters with beamer/beamerposter " width="359" height="506" /></a><p class="wp-caption-text">Political Geography Conference Poster</p></div><p>ex. I don&#8217;t create a lot of conference posters and did not want to spend ages putting a few words and graphs on a sheet of glossy paper. At the end of the day, I decided to give <a href="http://www.ctan.org/tex-archive/macros/latex/contrib/beamerposter">beamerp</a></p><p><a href="http://www.ctan.org/tex-archive/macros/latex/contrib/beamerposter">oster</a> a spin. Beamerposter is an add-on that transforms <a title="LaTeX Beamer" href="http://en.wikipedia.org/wiki/Beamer//en.wikipedia.org/wiki/Beamer_%28LaTeX%29528LaTeX%2529" target="_blank">my favourite presentation package</a> into a poster printing machine. I did not really like the default themes, but <a href="http://robjhyndman.com/researchtips/beamer-poster/">Rob Hyndman has created a very alternative nice template</a> that I adapted slightly.</p><p>I rather like the result and will go back to the package for the next poster.</p><div class="su-linkbox" id="post-983-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://www.kai-arzheimer.com/blog/quick-and-fancy-conference-posters-latex/&quot;&gt;Quick and Fancy Conference Posters with beamer/beamerposter&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div>]]></content:encoded> <wfw:commentRss>http://www.kai-arzheimer.com/blog/quick-and-fancy-conference-posters-latex/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Extreme Right Bibliography Updated</title><link>http://www.kai-arzheimer.com/blog/extreme-bibliography-updated/</link> <comments>http://www.kai-arzheimer.com/blog/extreme-bibliography-updated/#comments</comments> <pubDate>Wed, 10 Aug 2011 11:12:40 +0000</pubDate> <dc:creator>kai</dc:creator> <category><![CDATA[Data and Methods]]></category> <category><![CDATA[My Stuff]]></category> <category><![CDATA[Political Science]]></category> <category><![CDATA[bibliography]]></category> <category><![CDATA[bibtex]]></category> <category><![CDATA[extreme right]]></category> <category><![CDATA[make]]></category> <category><![CDATA[online]]></category> <category><![CDATA[western europe]]></category><guid isPermaLink="false">http://www.kai-arzheimer.com/blog/?p=893</guid> <description><![CDATA[After a lengthy hiatus, I&#8217;ve found the time to update my online bibliography on the Extreme (or Radical/Populist/Anti-Immigrant) Right in Western Europe. According to my latest count, it lists now 400 articles, books, chapters, and working papers, complete with doi- and/or http-links where available. Enjoy! Link to this post!]]></description> <content:encoded><![CDATA[<p>After a lengthy hiatus, I&#8217;ve found the time to update my o<a title="Bibliography on the Extreme Right in Western Europe" href="http://www.kai-arzheimer.com/extreme-right-western-europe-bibliography.html" target="_blank">nline bibliography on the Extreme (or Radical/Populist/Anti-Immigrant) Right in Western Europe</a>. According to my latest count, it lists now 400 articles, books, chapters, and working papers, complete with doi- and/or http-links where available. Enjoy!</p><div class="su-linkbox" id="post-893-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://www.kai-arzheimer.com/blog/extreme-bibliography-updated/&quot;&gt;Extreme Right Bibliography Updated&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div>]]></content:encoded> <wfw:commentRss>http://www.kai-arzheimer.com/blog/extreme-bibliography-updated/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Online Survey on Democratic Attitudes</title><link>http://www.kai-arzheimer.com/blog/online-survey-democratic-attitudes/</link> <comments>http://www.kai-arzheimer.com/blog/online-survey-democratic-attitudes/#comments</comments> <pubDate>Thu, 07 Jul 2011 20:08:56 +0000</pubDate> <dc:creator>kai</dc:creator> <category><![CDATA[Data and Methods]]></category> <category><![CDATA[My Stuff]]></category> <category><![CDATA[Political Science]]></category> <category><![CDATA[attitudes]]></category> <category><![CDATA[democracy]]></category> <category><![CDATA[democratic attitudes]]></category> <category><![CDATA[online]]></category> <category><![CDATA[survey]]></category><guid isPermaLink="false">http://www.kai-arzheimer.com/blog/?p=841</guid> <description><![CDATA[A group of my students has programmed a short online questionnaire on democratic attitudes. Please do feel free to help them with their work by participating and sharing the link. The survey is short, fun and completely anonymous: http://www.politik.uni-mainz.de/survey/index.php?sid=95262&#38;lang=en Link to this post!]]></description> <content:encoded><![CDATA[<p>A group of my students has programmed a short online questionnaire on democratic attitudes. Please do feel free to help them with their work by participating and sharing the link. The survey is short, fun and completely anonymous: <a href="http://www.politik.uni-mainz.de/survey/index.php?sid=95262&amp;lang=en" target="_blank">http://www.politik.uni-mainz.de/survey/index.php?sid=95262&amp;lang=en</a></p><div class="su-linkbox" id="post-841-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://www.kai-arzheimer.com/blog/online-survey-democratic-attitudes/&quot;&gt;Online Survey on Democratic Attitudes&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div>]]></content:encoded> <wfw:commentRss>http://www.kai-arzheimer.com/blog/online-survey-democratic-attitudes/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Party ID in Germany: Dead Men Walking &#8230;. (Almost) Tall!</title><link>http://www.kai-arzheimer.com/blog/party-id-germany-dead-men-walking-almost-tall/</link> <comments>http://www.kai-arzheimer.com/blog/party-id-germany-dead-men-walking-almost-tall/#comments</comments> <pubDate>Tue, 07 Jun 2011 19:27:11 +0000</pubDate> <dc:creator>kai</dc:creator> <category><![CDATA[Data and Methods]]></category> <category><![CDATA[My Stuff]]></category> <category><![CDATA[Political Science]]></category> <category><![CDATA[germany]]></category> <category><![CDATA[naugthies]]></category> <category><![CDATA[party-identification]]></category> <category><![CDATA[Politbarometer]]></category> <category><![CDATA[rate]]></category> <category><![CDATA[surveys]]></category><guid isPermaLink="false">http://www.kai-arzheimer.com/blog/?p=835</guid> <description><![CDATA[ Recently, I re-ran my scripts on a new data set that extends the old series all through the naughties. As you can see, party ID in Germany is not exactly alive and kicking, but the rate of decline has fallen considerably over the last decade.]]></description> <content:encoded><![CDATA[<p>Five years ago, I published a<a title="Dead Men Walking" href="http://www.kai-arzheimer.com/Party-Identification-Germany/Party-Identification-Germany-Abstract.html" target="_blank"> paper on the apparently inevitable decline of party identifications in Germany.</a> The somewhat cutesy title of the piece is Dead Men Walking. It is based on the &#8216;Politbarometer&#8217; series of monthly polls going back all the way to the late 1970s, and in my humble opinion, it is a rather neat application of the &#8220;<a href="http://www.amazon.com/Analyzing-Repeated-Quantitative-Applications-Sciences/dp/0803973985" target="_blank">analysing repeated surveys</a>&#8221; approach. One of my main findings is that on average, the share of party identifiers declines at a rate of about 0.7 percentage points per year. Recently, I re-ran my scripts on a new data set that extends the old series all through the naughties. As you can see, party ID in Germany is not exactly alive and kicking, but the rate of decline has fallen considerably over the last decade. As one wise man once observed, the core problem with predictions is that they are about the future.</p><div id="attachment_836" class="wp-caption alignright" style="width: 406px"><a href="http://www.kai-arzheimer.com/blog/wp-content/uploads/2011/06/pid-germany-series.png"><img class="size-full wp-image-836" title="pid-germany-series" src="http://www.kai-arzheimer.com/blog/wp-content/uploads/2011/06/pid-germany-series.png" alt="pid germany series Party ID in Germany: Dead Men Walking .... (Almost) Tall!" width="396" height="288" /></a><p class="wp-caption-text">Party Identification in Germany (% identifiers)</p></div><div class="su-linkbox" id="post-835-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://www.kai-arzheimer.com/blog/party-id-germany-dead-men-walking-almost-tall/&quot;&gt;Party ID in Germany: Dead Men Walking &#8230;. (Almost) Tall!&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div>]]></content:encoded> <wfw:commentRss>http://www.kai-arzheimer.com/blog/party-id-germany-dead-men-walking-almost-tall/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Sampling from a Multinomial Distribution in Stata</title><link>http://www.kai-arzheimer.com/blog/sampling-from-a-multinomial-distribution-in-stata/</link> <comments>http://www.kai-arzheimer.com/blog/sampling-from-a-multinomial-distribution-in-stata/#comments</comments> <pubDate>Sat, 09 Apr 2011 22:02:23 +0000</pubDate> <dc:creator>kai</dc:creator> <category><![CDATA[Data and Methods]]></category> <category><![CDATA[My Stuff]]></category> <category><![CDATA[categorical variable]]></category> <category><![CDATA[distribution]]></category> <category><![CDATA[multinomial]]></category> <category><![CDATA[R]]></category> <category><![CDATA[random process]]></category> <category><![CDATA[stata]]></category><guid isPermaLink="false">http://www.kai-arzheimer.com/blog/?p=806</guid> <description><![CDATA[Sometimes, a man&#8217;s gotta do what a man&#8217;s gotta do. Which, in my case, might be a little simulation of a random process involving an unordered categorical variable. In R, sampling from a multinomial distribution is trivial. rmultinom(1,1000,c(.1,.7,.2,.1)) gives me a vector of random numbers from a multinomial distribution with outcomes 1, 2, 3, and [...]]]></description> <content:encoded><![CDATA[<p>Sometimes, a man&#8217;s gotta do what a man&#8217;s gotta do. Which, in my case, might be a little simulation of a random process involving an unordered categorical variable. In R, sampling from a multinomial distribution is trivial.</p><p><code>rmultinom(1,1000,c(.1,.7,.2,.1))</code></p><p><span id="more-806"></span></p><p>gives me a vector of random numbers from a multinomial distribution with outcomes 1, 2, 3, and 4, where the probability of observing a &#8217;1&#8242; is 10 percent, the probability of observing a &#8217;2&#8242; is 70 per cent, and so on. But I could not find an equivalent function in Stata. Generating artificial data in R is not very elegant, so I kept digging and found a solution in section M-5 of the Mata handbook. Hidden in the entry on <tt>runiform</tt> is a reference to <code>rdiscrete(r,c,p)</code>, a Mata function which generates a <tt>r*c</tt> matrix of draws from a multinomial distribution defined by a vector <tt>p</tt> of probabilities.</p><p>That leaves but one question: Is wrapping a handful of lines around a Mata call to replace a non-existent Stata function more elegant than calling an external program?</p><div class="su-linkbox" id="post-806-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://www.kai-arzheimer.com/blog/sampling-from-a-multinomial-distribution-in-stata/&quot;&gt;Sampling from a Multinomial Distribution in Stata&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div>]]></content:encoded> <wfw:commentRss>http://www.kai-arzheimer.com/blog/sampling-from-a-multinomial-distribution-in-stata/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Me at the Margins: Average Marginal Effects, Marginal Effects at the Mean, and Stata&#8217;s margins command</title><link>http://www.kai-arzheimer.com/blog/me-at-the-margins-average-marginal-effects-marginal-effects-at-the-mean-and-statas-margins-command/</link> <comments>http://www.kai-arzheimer.com/blog/me-at-the-margins-average-marginal-effects-marginal-effects-at-the-mean-and-statas-margins-command/#comments</comments> <pubDate>Mon, 28 Mar 2011 20:37:38 +0000</pubDate> <dc:creator>kai</dc:creator> <category><![CDATA[Data and Methods]]></category> <category><![CDATA[Political Science]]></category> <category><![CDATA[average marginal effects]]></category> <category><![CDATA[calculating confidence intervals]]></category> <category><![CDATA[logit models]]></category> <category><![CDATA[Marginal Effects at the Mean]]></category> <category><![CDATA[margins]]></category> <category><![CDATA[nonlinear]]></category> <category><![CDATA[normal approximation]]></category> <category><![CDATA[norman mitchell]]></category> <category><![CDATA[postestimation]]></category> <category><![CDATA[roger newson]]></category> <category><![CDATA[stata]]></category> <category><![CDATA[statalist]]></category><guid isPermaLink="false">http://www.kai-arzheimer.com/blog/?p=793</guid> <description><![CDATA[Seems that I am not the only one who is startled by Stata 11&#8242;s margins command, which does all sorts of amazing things. At a mere 50 pages (not counting the remarks on margins postestimation), the documentation is a little overwhelming, and there are just too many options. There are two separate issue that seem [...]]]></description> <content:encoded><![CDATA[<p>Seems that I am not the only one who is startled by Stata 11&#8242;s margins command, which does all sorts of amazing things. At a mere 50 pages (not counting the remarks on margins postestimation), the documentation is a little overwhelming, and there are just too many options. There are two separate issue that seem to confuse a lot of people (<a href="http://www.stata.com/statalist/archive/2010-07/msg01588.html" target="_blank">see this discussion on statalist on the then new margins command</a>).</p><h6>Marginal Effects at the Mean vs Average Marginal Effects</h6><p><span id="more-793"></span></p><p>The first is that in the past when studying the implications from nonlinear (i.e. logit) models, many people including me used to analyse &#8220;marginal effects at the margin&#8221;. In short, this boils down to holding most  independent vars constant at their grand means/modes while plugging a range of hopefully relevant values for one or two focal variables into the equation.  This approach, which is known as analysing marginal effects at the mean, is easier to understand than to explain but can result in highly unrealistic scenarios if your independent variables are highly correlated (think of holding age constant while varying pensioner/non-pensioner status).</p><p>Therefore, looking at average marginal effects might make more sense. These are calculated by varying the focal variable while holding everything else at their variables. This is was the margins command does by default. Michael Norman Mitchell has a post that clearly illustrates the <a href="http://www.michaelnormanmitchell.com/stow/marginal-effect-at-mean-vs-average-marginal-effect.html" target="_blank">differences between the two approaches to the estimation of margins</a>.   Moreover, there is an <a href="http://www.stata-journal.com/sjpdf.html?articlenum=st0086" target="_blank">older article by Tamás Bartus on his margeff command</a> that is also quite instructive.</p><h6>Dubious Confidence Intervals</h6><p>But one problem remains: margins uses a normal approximation for calculating confidence intervals. As a result, after estimating a model for categorical dependent variables, you might end up with a CI for your margins that includes zero, which obviously does not make much sense. <a href="http://www.stata.com/statalist/archive/2010-04/msg01741.html" target="_blank">Roger Newson seems to know how to get around this issue</a>, but I haven&#8217;t tested this approach yet.</p><div class="su-linkbox" id="post-793-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://www.kai-arzheimer.com/blog/me-at-the-margins-average-marginal-effects-marginal-effects-at-the-mean-and-statas-margins-command/&quot;&gt;Me at the Margins: Average Marginal Effects, Marginal Effects at the Mean, and Stata&#8217;s margins command&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div>]]></content:encoded> <wfw:commentRss>http://www.kai-arzheimer.com/blog/me-at-the-margins-average-marginal-effects-marginal-effects-at-the-mean-and-statas-margins-command/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Statistics and Data links roundup for December 2010 through March 2011</title><link>http://www.kai-arzheimer.com/blog/statistics-and-data-links-roundup-for-december-2010-through-march-2011/</link> <comments>http://www.kai-arzheimer.com/blog/statistics-and-data-links-roundup-for-december-2010-through-march-2011/#comments</comments> <pubDate>Fri, 18 Mar 2011 22:29:56 +0000</pubDate> <dc:creator>kai</dc:creator> <category><![CDATA[Data and Methods]]></category> <category><![CDATA[Political Science]]></category> <category><![CDATA[books]]></category> <category><![CDATA[choice]]></category> <category><![CDATA[data]]></category> <category><![CDATA[germany]]></category> <category><![CDATA[gis]]></category> <category><![CDATA[logit]]></category> <category><![CDATA[regional]]></category> <category><![CDATA[statistics]]></category><guid isPermaLink="false">http://www.kai-arzheimer.com/blog/?p=635</guid> <description><![CDATA[Statistics and Data links roundup for December 2010 through March 2011: Discrete Choice Methods with Simulation, by Kenneth Train, Cambridge University Press, 2002 &#8211; Discrete Choice Geodatenzentrum &#8211; Hier erhalten Sie vielfältige Informationen über die Geobasisdaten der Bundesländer und des Bundes. Nutzen Sie unsere Dienste und interaktiven Karten für Bestellung, Download, Suche oder Verarbeitung von Geoinformationen. [...]]]></description> <content:encoded><![CDATA[<p>Statistics and Data links roundup for December 2010 through March 2011:</p><ul><li><a href="http://elsa.berkeley.edu/books/choice2.html">Discrete Choice Methods with Simulation, by Kenneth Train, Cambridge University Press, 2002</a> &#8211; Discrete Choice <a href="http://www.geodatenzentrum.de/geodaten/gdz_rahmen.gdz_div">Geodatenzentrum</a> &#8211; Hier erhalten Sie vielfältige Informationen über die Geobasisdaten der Bundesländer und des Bundes. Nutzen Sie unsere Dienste und interaktiven Karten für Bestellung, Download, Suche oder Verarbeitung von Geoinformationen.</li><li><a href="http://www.destatis.de/jetspeed/portal/cms/Sites/destatis/Internet/DE/Navigation/Publikationen/Querschnittsveroeffentlichungen/StatistikLokal,templateId=renderPrint.psml__nnn=true">Statistisches Bundesamt Deutschland &#8211; Statistik lokal</a> &#8211; Statistik lokal 2010 ist eine von den Statistischen Ämtern des Bundes und der Länder gemeinsam herausgegebene Datenbank auf DVD, die Gemeindedaten für ganz Deutschland enthält. Mit Statistik lokal 2010 können Sie über 12 000 Städte und Gemeinden in ganz Deutschland anhand ausgewählter Ergebnisse aus allen wichtigen Bereichen der amtlichen Statistik mit derzeit rund 330 Merkmalsausprägungen analysieren und vergleichen. Die DVD enthält auch die Ergebnisse für alle Kreise (kreisfreie Städte und Landkreise), Regierungsbezirke/Statistische Regionen, Bundesländer und Deutschland.</li></ul><div class="su-linkbox" id="post-635-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://www.kai-arzheimer.com/blog/statistics-and-data-links-roundup-for-december-2010-through-march-2011/&quot;&gt;Statistics and Data links roundup for December 2010 through March 2011&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div>]]></content:encoded> <wfw:commentRss>http://www.kai-arzheimer.com/blog/statistics-and-data-links-roundup-for-december-2010-through-march-2011/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching using disk: basic
Object Caching 2484/2696 objects using disk: basic

Served from: www.kai-arzheimer.com @ 2012-02-07 15:01:24 -->
