<?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; listtex</title> <atom:link href="http://www.kai-arzheimer.com/blog/tag/listtex/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>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> </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 713/776 objects using disk: basic

Served from: www.kai-arzheimer.com @ 2012-02-07 10:43:41 -->
