<?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; stata</title> <atom:link href="http://www.kai-arzheimer.com/blog/tag/stata/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>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 January through September 2010</title><link>http://www.kai-arzheimer.com/blog/statistics-and-data-links-roundup-for-january-through-september-2010/</link> <comments>http://www.kai-arzheimer.com/blog/statistics-and-data-links-roundup-for-january-through-september-2010/#comments</comments> <pubDate>Tue, 07 Sep 2010 20:42:45 +0000</pubDate> <dc:creator>kai</dc:creator> <category><![CDATA[Data and Methods]]></category> <category><![CDATA[Political Science]]></category> <category><![CDATA[data]]></category> <category><![CDATA[geo]]></category> <category><![CDATA[language]]></category> <category><![CDATA[stata]]></category> <category><![CDATA[statistics]]></category><guid isPermaLink="false">http://www.kai-arzheimer.com/blog/?p=363</guid> <description><![CDATA[Image via Wikipedia Statistics and Data links roundup for January through September 2010 Making Working and Publication Tables in Stata &#8211; Review of various commands for making tables in Stata OS OpenData Supply &#8211; Download or order Ordnance Survey OpenData &#8211; open data * Outline of Great Britain&#60;br /&#62; * Overview of Great Britain&#60;br /&#62; [...]]]></description> <content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;"><div><dl class="wp-caption alignright" style="width: 245px;"><dt class="wp-caption-dt"><a href="http://commons.wikipedia.org/wiki/File:National_Grid_for_Great_Britain.png"><img title="National Grid for Great Britain. Recolored for..." src="http://upload.wikimedia.org/wikipedia/commons/7/7d/National_Grid_for_Great_Britain.png" alt="National Grid for Great Britain Statistics and Data links roundup for January through September 2010" width="235" height="434" /></a></dt><dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://commons.wikipedia.org/wiki/File:National_Grid_for_Great_Britain.png">Wikipedia</a></dd></dl></div></div><p>Statistics and Data links roundup for January through September 2010<br /> <span id="more-363"></span></p><ul><li><a href="http://www2.fiu.edu/~tardanic/public.pdf">Making Working and Publication Tables in Stata</a> &#8211; Review of various commands for making tables in Stata</li><li><a href="https://www.ordnancesurvey.co.uk/opendatadownload/products.html">OS OpenData Supply &#8211; Download or order Ordnance Survey OpenData</a> &#8211; open data     *  Outline of Great Britain&lt;br /&gt;<br /> * Overview of Great Britain&lt;br /&gt;<br /> * MiniScale ®&lt;br /&gt;<br /> * 1:250 000 Scale Colour Raster&lt;br /&gt;<br /> * OS Street View ®&lt;br /&gt;<br /> * Boundary-Line ™&lt;br /&gt;<br /> * OS VectorMap ™ District &#8211; New</li><li><a href="http://enapt.org/">European Network for the Analysis of Political Text</a> &#8211; The European Network for the Analysis of Political Texts (ENAPT) is a newly established network of PhD students and early career researchers who share an interest in the qualitative and quantitative analysis of party manifestos and other political text.&lt;br /&gt;<br /> &lt;br /&gt;<br /> The objectives of ENAPT include:&lt;br /&gt;<br /> &lt;br /&gt;<br /> * To collect and analyse political text in a systematic fashion using a combination of qualitative and quantitative methodologies,&lt;br /&gt;<br /> * To organise meetings and workshops (primarily aimed at PhD students and early career researchers) regarding the coding of political text,&lt;br /&gt;<br /> * To facilitate the dissemination of the findings of its members through conferences, workshops and the world-wide-web.&lt;br /&gt;<br /> &lt;br /&gt;<br /> ENAPT operates a mailing list at the National Academic Mailing List Service. To join the network and the mailing list, email Kostas Gemenis</li></ul><h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta</h6><ul class="zemanta-article-ul"><li class="zemanta-article-ul-li"><a href="http://r.zemanta.com/?u=http%3A//www.guardian.co.uk/technology/blog/2010/sep/03/tfl-timetables-boris-johnson&amp;a=23757440&amp;rid=65275b60-5348-47c7-9c6a-dad7e785d179&amp;e=c8bc866138717059d6e5377a22f3b530">Another data win: TfL opens up bus and tube timetables for developers</a> (guardian.co.uk)</li></ul><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="border: medium none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=65275b60-5348-47c7-9c6a-dad7e785d179" alt=" Statistics and Data links roundup for January through September 2010"  title="Statistics and Data links roundup for January through September 2010 photo" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div><div class="su-linkbox" id="post-363-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-january-through-september-2010/&quot;&gt;Statistics and Data links roundup for January through September 2010&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-january-through-september-2010/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Which of my students are most likely to gang up against me?</title><link>http://www.kai-arzheimer.com/blog/which-of-my-students-are-most-likely-to-gang-up-against-me/</link> <comments>http://www.kai-arzheimer.com/blog/which-of-my-students-are-most-likely-to-gang-up-against-me/#comments</comments> <pubDate>Wed, 19 May 2010 20:30:53 +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[limesurvey]]></category> <category><![CDATA[networkx]]></category> <category><![CDATA[pajek]]></category> <category><![CDATA[political sociology]]></category> <category><![CDATA[python]]></category> <category><![CDATA[sna]]></category> <category><![CDATA[social capital]]></category> <category><![CDATA[social network analysis]]></category> <category><![CDATA[social networks]]></category> <category><![CDATA[stata]]></category> <category><![CDATA[survey data]]></category><guid isPermaLink="false">http://www.kai-arzheimer.com/blog/?p=405</guid> <description><![CDATA[I&#8217;m teaching a lecture course on Political Sociology at the moment, and because everyone is so excited about social capital and social network analysis these days, I decided to run a little online experiment with and on my students. The audience is large (at the beginning of this term, about 220 students had registered for [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;m teaching a lecture course on Political Sociology at the moment, and because everyone is so excited about social capital and social network analysis these days, I decided to run a little online experiment with and on my students. The audience is large (at the beginning of this term, about 220 students had registered for this lecture series) and quite diverse, with some students still in their first year, others in their second, third or fourth and even a bunch of veterans who have spent most of their adult lives in university education.</p><div id="attachment_406" class="wp-caption alignright" style="width: 160px"><a href="http://www.kai-arzheimer.com/blog/wp-content/uploads/2010/05/glorreiche-10.jpg"><img class="size-thumbnail wp-image-406  " title="All ties in a group of students, well-connected students in yellow" src="http://www.kai-arzheimer.com/blog/wp-content/uploads/2010/05/glorreiche-10-150x150.jpg" alt="glorreiche 10 150x150 Which of my students are most likely to gang up against me?" width="150" height="150" /></a><p class="wp-caption-text">Who knows whom in a large group of learners?</p></div><p><span id="more-405"></span></p><p>Fortunately, I had a list of full names plus email addresses for everyone who had signalled interest in the lecture before the beginning of term, so I created a short questionnaire in <a href="http://www.limesurvey.org/" target="_blank">limesurvey</a> and asked them a very simple question: whom do you know in this group? Given the significant overcoverage of my list &#8211; in reality, there are probably not more than 120 students who regularly turn up for the lecture &#8211; the response rate was somewhere in the high 70s. If you want to collect network data with limesurvey, the &#8220;array with flexible labels&#8221; question type is your friend, but keying in 220 names plus unique ids would have been a major pain. Thankfully, one can program the question with a single placeholder name, then export it as a <a class="zem_slink" title="Comma-separated values" rel="wikipedia" href="http://en.wikipedia.org/wiki/Comma-separated_values">CSV</a> file. Next, simply load the file into Emacs and  insert the complete list, then re-import it in limesurvey.</p><p><a href="http://www.kai-arzheimer.com/blog/2010/01/10/how-to-get-from-stata-to-pajek/" target="_blank">Getting  a data matrix from Stata into Pajek is not necessarily a fun exercise,</a> so I decided to give the <a href="http://networkx.lanl.gov/" target="_blank">networkx</a> module for Python a go, which is simply superb. Networkx has data types for representing social networks, so you can read in a rectangular data matrix (again as CSV),  construct the network in Python and export the whole lot to Pajek with a few lines of code:</p><p><code><br /> #Some boring stuff omitted<br /> #create network<br /> Lecture=nx.DiGraph()<br /> #Initialise<br /> for i in range(1,221):<br /> Lecture.add_node(i, stdg="0")<br /> for line in netreader:<br /> sender = int(line[-1])<br /> #Sender-ID at the very  end<br /> edges=line[6:216]<br /> #Degree-scheme<br /> Lecture.node[sender]['stdg']=line[-8]<br /> #Edges<br /> for index in range(len(edges)):<br /> if edges[index] == '2':<br /> Lecture.add_edge(sender,int(filter(str.isdigit,repr(knoten[index]))),weight=2)<br /> elif edges[index] == '3':<br /> Lecture.add_edge(sender,int(filter(str.isdigit,repr(knoten[index]))),weight=3)<br /> nx.write_pajek(Lecture,'file.net')<br /> </code></p><p>As it turns out, a lecture hall rebellion seems not very likely. About one third of all relationships are not reciprocated, and about a quarter of my students do not know a single other person in the room (at least not by name), so levels of social capital are pretty low.  There is, however, a small group of 10 mostly older students who are form a tightly-knit core, and who know many of the suckers in the periphery. I need to keep an eye on these guys.</p><div id="attachment_407" class="wp-caption alignright" style="width: 160px"><a href="http://www.kai-arzheimer.com/blog/wp-content/uploads/2010/05/nur-reziprok.jpg"><img class="size-thumbnail wp-image-407 " title="Reciprocated ties in a group of students, information on degree scheme overlaid" src="http://www.kai-arzheimer.com/blog/wp-content/uploads/2010/05/nur-reziprok-150x150.jpg" alt="nur reziprok 150x150 Which of my students are most likely to gang up against me?" width="150" height="150" /></a><p class="wp-caption-text">260 reciprocated ties within the same group</p></div><p>Finally, the second graph also shows that those relatively few students who are enrolled in our new BA programs (red, dark blue) are pretty much isolated within the larger group, which is still dominated by students enrolled in the old five year programs (MA yellow, State Examination green) that are phased out. Divide et impera.</p><div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/5065f66c-8fcc-401f-afbc-f04a7abf490e/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=5065f66c-8fcc-401f-afbc-f04a7abf490e" alt=" Which of my students are most likely to gang up against me?"  title="Which of my students are most likely to gang up against me? photo" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div><div class="su-linkbox" id="post-405-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/which-of-my-students-are-most-likely-to-gang-up-against-me/&quot;&gt;Which of my students are most likely to gang up against me?&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div>]]></content:encoded> <wfw:commentRss>http://www.kai-arzheimer.com/blog/which-of-my-students-are-most-likely-to-gang-up-against-me/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How to get from Stata to Pajek</title><link>http://www.kai-arzheimer.com/blog/how-to-get-from-stata-to-pajek/</link> <comments>http://www.kai-arzheimer.com/blog/how-to-get-from-stata-to-pajek/#comments</comments> <pubDate>Sun, 10 Jan 2010 21:02:08 +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[ascii]]></category> <category><![CDATA[listtex]]></category> <category><![CDATA[pajek]]></category> <category><![CDATA[reshape]]></category> <category><![CDATA[sna]]></category> <category><![CDATA[stata]]></category><guid isPermaLink="false">http://www.kai-arzheimer.com/blog/?p=362</guid> <description><![CDATA[I&#8217;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 [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;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 <a class="zem_slink" title="Stata" rel="homepage" href="http://www.stata.com/" target="_blank">Stata</a> via <a class="zem_slink" title="Comma-separated values" rel="wikipedia" href="http://en.wikipedia.org/wiki/Comma-separated_values" target="_blank">CSV</a> was easy enough. <a title="Social Network Analysis class data set" href="http://kai-arzheimer.com/stata/sna-course.dta">Here is the data set</a>. But how does one get the data from Stata to Pajek for analysis? Actually, it&#8217;s quite easy.</p><p>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&#8217;s &#8220;wide&#8221; form. Stata&#8217;s <code>reshape</code> command will happily re-arrange the data to the &#8220;long&#8221; form, with one record for each arc. This is what Pajek requires.</p><p><span id="more-362"></span></p><p>Second, we need to save the data as an <a class="zem_slink" title="ASCII" rel="wikipedia" href="http://en.wikipedia.org/wiki/ASCII" target="_blank">ASCII</a> file that can be read into Pajek. This is most easily done using Roger Newson&#8217;s listtex, which can be tweaked to write the main chunks of a Pajek file. <a href="http://kai-arzheimer.com/stata/stata-pajek.do" target="_blank">Here is the code</a>, which should be readily adapted to your own problems.</p><p>If you are interested, you can get the whole package from within Stata: <code>net from http://www.kai-arzheimer.com/stata/ </code></p><div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/c6ade56e-8511-4c02-9576-d2fdf7a600d1/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=c6ade56e-8511-4c02-9576-d2fdf7a600d1" alt=" How to get from Stata to Pajek"  title="How to get from Stata to Pajek photo" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div><div class="su-linkbox" id="post-362-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/how-to-get-from-stata-to-pajek/&quot;&gt;How to get from Stata to Pajek&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div>]]></content:encoded> <wfw:commentRss>http://www.kai-arzheimer.com/blog/how-to-get-from-stata-to-pajek/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Software for Social Network Analysis: Pajek and Friends</title><link>http://www.kai-arzheimer.com/blog/software-for-social-network-analysis-pajek-and-friends/</link> <comments>http://www.kai-arzheimer.com/blog/software-for-social-network-analysis-pajek-and-friends/#comments</comments> <pubDate>Tue, 08 Jul 2008 21:27:06 +0000</pubDate> <dc:creator>kai</dc:creator> <category><![CDATA[Data and Methods]]></category> <category><![CDATA[Political Science]]></category> <category><![CDATA[analysis]]></category> <category><![CDATA[bibliometrics]]></category> <category><![CDATA[citation]]></category> <category><![CDATA[network]]></category> <category><![CDATA[networks]]></category> <category><![CDATA[perl]]></category> <category><![CDATA[R]]></category> <category><![CDATA[science]]></category> <category><![CDATA[sna]]></category> <category><![CDATA[social]]></category> <category><![CDATA[social networks]]></category> <category><![CDATA[software]]></category> <category><![CDATA[stata]]></category><guid isPermaLink="false">http://polsci.wordpress.com/2008/07/08/software-for-social-network-analysis-pajek-and-friends/</guid> <description><![CDATA[After trying a lot of other programs, we have chosen Pajek for doing the analyses and producing those intriguing graphs of cliques and inner circles in Political Science. Pajek is free for non-commercial use and runs on Windows or (via wine) Linux. It is very fast, can (unlike many other programs) easily handle very large networks, produces decent graphs and does many standard analyses.]]></description> <content:encoded><![CDATA[<p>Our project on <a href="http://www.kai-arzheimer.com/social-networks-in-political-science.html" target="_blank">social (citation and collaboration) networks</a> in <a href="http://polsci.wordpress.com/2008/06/30/social-networks-in-british-political-science/" target="_blank">British</a> and <a href="http://polsci.wordpress.com/2008/06/26/social-networks-in-political-science/" target="_blank">German political science</a> involves networks with <a href="http://www.kai-arzheimer.com/networkpics/ukcoauthorbigger.png" target="_blank">hundreds and thousands of nodes</a> (scientists and articles). At the moment, our data come from the <a class="zem_slink" title="Social Sciences Citation Index" rel="wikipedia" href="http://en.wikipedia.org/wiki/Social_Sciences_Citation_Index">Social Science Citation Index</a> (part of the <a class="zem_slink" title="ISI Web of Knowledge" rel="wikipedia" href="http://en.wikipedia.org/wiki/ISI_Web_of_Knowledge">ISI web of knowledge</a>), and we use a bundle of rather eclectic (erratic?) scripts written in Perl to convert the ISI records into something that programs like Pajek or Stata can read. Some canned solutions (<a href="http://vlado.fmf.uni-lj.si/pub/networks/pajek/WoS2Pajek/">Wos2pajek</a>, <a href="http://nwb.slis.indiana.edu/index.html" target="_blank">network workbench</a>, <a href="http://www.umu.se/inforsk/Bibexcel/" target="_blank">bibexcel</a>) are available for free, but I was not aware of them when I started this project, did not manage to install them properly, or was not happy with the results. Perl is the Swiss Army Chainsaw (TM) for data pre-processing, incredibly powerful (my scripts are typically less than 50 lines, and I am not an efficient programmer), and every time I want to do something in a slightly different way (i.e. I spot a bug), all I have to do is to change a few lines in the scripts.<br /> After trying a lot of other programs available on the internet, we have chosen Pajek for doing the analyses and producing those intriguing graphs of <a href="http://www.kai-arzheimer.com/networkpics/pvscoauthors.png" target="_blank">cliques and inner circles in Political Science</a>. <a href="http://pajek.imfm.si/doku.php" target="_blank">Pajek</a> is closed source but free for non-commercial use and runs on Windows or (via wine) Linux. It is very fast, can (unlike many other programs) easily handle very large networks, produces decent graphs and does many standard analyses. Its user interface may be slightly less than straightforward but I got used to it rather quickly, and it even has basic scripting capacities.</p><div id="attachment_39" class="wp-caption alignleft" style="width: 190px"><a href="http://www.amazon.com/gp/product/0521602629?ie=UTF8&amp;tag=polscipolblo-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=047206"><img class="size-medium wp-image-39" src="http://polsci.files.wordpress.com/2008/07/pajek1.jpg?w=180" alt=" Software for Social Network Analysis: Pajek and Friends" width="180" height="254" title="Software for Social Network Analysis: Pajek and Friends photo" /></a><p class="wp-caption-text">The Missing Manual</p></div><p><span id="more-37"></span></p><p>The only thing that is missing is a proper manual, but even this is not really a problem since Pajek&#8217;s creators have written a very accessible introduction to social network analysis that doubles up as documentation for the program (order from<a href="http://www.amazon.co.uk/gp/product/0521602629?ie=UTF8&amp;tag=polscipolblo-21&amp;linkCode=as2&amp;camp=1634&amp;creative=6738&amp;creativeASIN=0472069691" target="_blank"> amazon.co.uk</a>, <a href="http://www.amazon.com/gp/product/0521602629?ie=UTF8&amp;tag=polscipolblo-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=047206" target="_blank">amazon.com</a>, <a href="http://www.amazon.de/exec/obidos/ASIN/0521602629/diridisarzhei-21" target="_blank">amazon.de</a>. However, Pajek has been under constant development since the 1990s (!) and has acquired a lot of new features since the book was published. Some of them are documented in an <a href="http://vlado.fmf.uni-lj.si/pub/networks/book/appendix4.pdf" target="_blank">appendix</a>, others are simply listed in the very short document that is the official <a href="http://vlado.fmf.uni-lj.si/pub/networks/pajek/doc/pajekman.pdf" target="_blank">manual for Pajek</a>. You will want to go through the many presentations which are available via the Pajek wiki.</p><p>Of course, there is much more software available, often at no cost. If you do program Java or Python (I don&#8217;t), there are several libraries available that look very promising. Amongst the stand-alone programs, <a href="http://visone.info/" target="_blank">visone</a> stands out because it can easily produce very attractive-looking graphs of small networks. Even more software has been developed in the context of other sciences that have an interest in networks (chemistry, biology, engineering etc.)<br /> Here is a rather messy collection of <a href="http://del.icio.us/kai17/sna+software" target="_blank">links to sna software</a>. Generally, you will want something that is more systematic and informative. Ines Mergel has recently launched a <a href="http://inesmergel.wordpress.com/2008/02/24/tapping-on-the-wisdom-of-the-crowd-social-network-analysis-software-tools-on-wikipedia/" target="_blank">bid for creating a comprehensive software list</a> on wikipedia. The resulting <a href="http://en.wikipedia.org/wiki/Social_network_analysis_software" target="_blank">page on social network analysis software</a> is obviously work in progress but provides very valuable guidance.</p><p>Technorati-Tags: <a class="performancingtags" rel="tag" href="http://technorati.com/tag/sna">sna</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/software">software</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/political%20science">political science</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/network">network</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/analysis">analysis</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/perl">perl</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/citation">citation</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/bibliometrics">bibliometrics</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/networks">networks</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/social">social</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/social%20networks">social networks</a></p><div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Zemified by Zemanta" href="http://reblog.zemanta.com/zemified/a3986ca0-45a1-4839-9f0d-d468fa4350c7/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=a3986ca0-45a1-4839-9f0d-d468fa4350c7" alt=" Software for Social Network Analysis: Pajek and Friends"  title="Software for Social Network Analysis: Pajek and Friends photo" /></a><span class="zem-script more-related"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div><div class="su-linkbox" id="post-37-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/software-for-social-network-analysis-pajek-and-friends/&quot;&gt;Software for Social Network Analysis: Pajek and Friends&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div>]]></content:encoded> <wfw:commentRss>http://www.kai-arzheimer.com/blog/software-for-social-network-analysis-pajek-and-friends/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Makefile helps with latex, too</title><link>http://www.kai-arzheimer.com/blog/makefile-helps-with-latex-too/</link> <comments>http://www.kai-arzheimer.com/blog/makefile-helps-with-latex-too/#comments</comments> <pubDate>Thu, 10 Apr 2008 10:25:54 +0000</pubDate> <dc:creator>kai</dc:creator> <category><![CDATA[Data and Methods]]></category> <category><![CDATA[My Stuff]]></category> <category><![CDATA[beamer]]></category> <category><![CDATA[eps]]></category> <category><![CDATA[latex]]></category> <category><![CDATA[make]]></category> <category><![CDATA[Makefile]]></category> <category><![CDATA[meta post]]></category> <category><![CDATA[pdf]]></category> <category><![CDATA[pdflatex]]></category> <category><![CDATA[postscript]]></category> <category><![CDATA[pstoedit]]></category> <category><![CDATA[stata]]></category><guid isPermaLink="false">http://polsci.wordpress.com/2008/04/10/makefile-helps-with-latex-too/</guid> <description><![CDATA[A couple of weeks ago, I posted an article on how make and Makefiles can help you to organise your Stata projects. If you are working in a unix environnment, you&#8217;ll already have make installed. If you work under Windows, install GNU make &#8211; it&#8217;s free, and it can make your Stata day. Rather unsurprisingly, [...]]]></description> <content:encoded><![CDATA[<p>A couple of weeks ago, I posted an article on how <em><a href="http://en.wikipedia.org/wiki/Make_%28software%29" target="_blank">make</a></em> and Makefiles can help you to organise your Stata projects. If you are working in a unix environnment, you&#8217;ll already have make installed. If you work under Windows, install GNU make &#8211; it&#8217;s free, and <a href="http://polsci.wordpress.com/2008/03/20/how-stata-and-a-makefile-can-make-your-day/" target="_blank">it can make your Stata day</a>. Rather unsurprisingly, <em>make</em> is also extremely useful if you have large or medium-sized latex project (or if you want to include tables and/or graphs produced by Stata) in a latex document. For instance, this comes handy if you have eps-Figures and use pdflatex. pdflatex produces pdf files instead of dvi files. If you produces slides with, this can save you a lot of time because you don&#8217;t have to go through the latex &#8211; dvips &#8211; ps2pdf cycle. However, pdflatex cannot read eps files: you have to convert your eps files with pstoedit to the meta post format, then use meta post to convert them to mps (which can be read by pdflatex). With this Makefile snippet, everything happens automagically:</p><p><code><br /> #New implicit rules for conversion of eps-&gt;mp-&gt;mps<br /> #Change path if you have installed pstoedit in some other place<br /> %.mp : %.eps<br /> c:\pstoedit/pstoedit.exe -f mpost  $*.eps $*.mp</code></p><p><span id="more-21"></span></p><p>%.mps: %.mp<br /> mpost $*.mp<br /> mv $*.1 $*.mps<br /> rm $*.mp</p><p>#Now specify a target</p><p>presentation.pdf: presentation.tex mytab1.tex myfig.mps</p><p>#Optional: if you want to create dataset x.eps, run x.do<br /> #Stata must be in your path<br /> %.eps : %.do<br /> \tab wstata -e do $&lt;</p><p>Now type make presentation.pdf, and make will call Stata, pstoedit, metapost and pdflatex as required. If you need more figures, just write the do-file and add a dependency.</p><div align="center">Social Bookmarks:<br /><a href="http://del.icio.us/post?url=http://polsci.wordpress.com/2008/04/11/makefile-helps-with-latex-toomakefile-helps-with-latex-too//"><img src="http://archaeoastronomy.files.wordpress.com/2007/01/delicious.png" border="0" title="Makefile helps with latex, too photo" alt="delicious Makefile helps with latex, too" /></a><a href="http://bluedot.us/Authoring.aspx?u=http://polsci.wordpress.com/2008/04/11/makefile-helps-with-latex-toomakefile-helps-with-latex-too//"><img src="http://archaeoastronomy.files.wordpress.com/2007/01/bluedot.png" border="0" title="Makefile helps with latex, too photo" alt="bluedot Makefile helps with latex, too" /></a><a href="http://www.connotea.org/add?continue=return&amp;uri=http://polsci.wordpress.com/2008/04/11/makefile-helps-with-latex-toomakefile-helps-with-latex-too//"><img src="http://archaeoastronomy.files.wordpress.com/2007/01/connotea.png" border="0" title="Makefile helps with latex, too photo" alt="connotea Makefile helps with latex, too" /></a><a href="http://digg.com/submit?phase=2&amp;url=http://polsci.wordpress.com/2008/04/11/makefile-helps-with-latex-toomakefile-helps-with-latex-too//"><img src="http://archaeoastronomy.files.wordpress.com/2007/01/digg.png" border="0" title="Makefile helps with latex, too photo" alt="digg Makefile helps with latex, too" /></a><a href="http://www.furl.net/storeIt.jsp?u=http://polsci.wordpress.com/2008/04/11/makefile-helps-with-latex-toomakefile-helps-with-latex-too//"><img src="http://archaeoastronomy.files.wordpress.com/2007/01/furl.png" border="0" title="Makefile helps with latex, too photo" alt="furl Makefile helps with latex, too" /></a><a href="http://ma.gnolia.com/beta/bookmarklet/add?url=http://polsci.wordpress.com/2008/04/11/makefile-helps-with-latex-toomakefile-helps-with-latex-too//"><img src="http://archaeoastronomy.files.wordpress.com/2007/01/magnolia.png" border="0" title="Makefile helps with latex, too photo" alt="magnolia Makefile helps with latex, too" /></a><a href="http://www.newsvine.com/_tools/seed&amp;save?u=http://polsci.wordpress.com/2008/04/11/makefile-helps-with-latex-toomakefile-helps-with-latex-too//"><img src="http://archaeoastronomy.files.wordpress.com/2007/01/newsvine.png" border="0" title="Makefile helps with latex, too photo" alt="newsvine Makefile helps with latex, too" /></a><a href="http://reddit.com/submit?url=http://polsci.wordpress.com/2008/04/11/makefile-helps-with-latex-toomakefile-helps-with-latex-too//"><img src="http://archaeoastronomy.files.wordpress.com/2007/01/reddit.png" border="0" title="Makefile helps with latex, too photo" alt="reddit Makefile helps with latex, too" /></a><a href="http://www.spurl.net/spurl.php?url=http://polsci.wordpress.com/2008/04/11/makefile-helps-with-latex-toomakefile-helps-with-latex-too//"><img src="http://archaeoastronomy.files.wordpress.com/2007/01/spurl.png" border="0" title="Makefile helps with latex, too photo" alt="spurl Makefile helps with latex, too" /></a><a href="http://www.stumbleupon.com/submit?url=http://polsci.wordpress.com/2008/04/11/makefile-helps-with-latex-toomakefile-helps-with-latex-too//"><img src="http://archaeoastronomy.files.wordpress.com/2007/02/stumbleit.gif" border="0" title="Makefile helps with latex, too photo" alt="stumbleit Makefile helps with latex, too" /></a><a href="http://www.technorati.com/cosmos/search.html?url=http://polsci.wordpress.com/2008/04/11/makefile-helps-with-latex-toomakefile-helps-with-latex-too//"><img src="http://archaeoastronomy.files.wordpress.com/2007/01/technorati.png" border="0" title="Makefile helps with latex, too photo" alt="technorati Makefile helps with latex, too" /></a><a href="http://archaeoastronomy.wordpress.com/social-linking/"><img src="http://archaeoastronomy.files.wordpress.com/2007/01/que.png" border="0" title="Makefile helps with latex, too photo" alt="que Makefile helps with latex, too" /></a></div><p>Technorati Tags: <a class="performancingtags" rel="tag" href="http://technorati.com/tag/make">make</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/latex">latex</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/Makefile">Makefile</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/Stata">Stata</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/political science">political science</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/political">political</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/science">science</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/meta post">meta post</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/pstoedit">pstoedit</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/postscript">postscript</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/eps">eps</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/pdf">pdf</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/pdflatex">pdflatex</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/beamer">beamer</a></p><div class="su-linkbox" id="post-21-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/makefile-helps-with-latex-too/&quot;&gt;Makefile helps with latex, too&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div>]]></content:encoded> <wfw:commentRss>http://www.kai-arzheimer.com/blog/makefile-helps-with-latex-too/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 3057/3275 objects using disk: basic

Served from: www.kai-arzheimer.com @ 2012-02-07 10:16:52 -->
