<?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>Michael Ewens</title>
	<atom:link href="http://michaelewens.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://michaelewens.com</link>
	<description>Tepper School of Business, Carnegie Mellon Univ.</description>
	<lastBuildDate>Thu, 22 Jul 2010 00:39:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using Growl with R</title>
		<link>http://michaelewens.com/2010/07/02/using-growl-with-r/</link>
		<comments>http://michaelewens.com/2010/07/02/using-growl-with-r/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 19:46:03 +0000</pubDate>
		<dc:creator>Michael Ewens</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[growl]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[r]]></category>

		<guid isPermaLink="false">http://michaelewens.com/?p=673</guid>
		<description><![CDATA[If you have a long R script and would like to be notified when computation is complete, follow these directions to get Growl notifications: Install Growl and leave the disk image open. Open Terminal. Run &#8220;cd /Volumes/Growl-1.2/Extras/growlnotify&#8221; Run &#8220;./install.sh&#8221; Then follow these directions to get your R script to talk to Growl by adding something [...]]]></description>
			<content:encoded><![CDATA[<p>If you have a long R script and would like to be notified when computation is complete, follow these directions to get Growl notifications:</p>
<ol>
<li><a href="http://growl.info/index.php">Install Growl</a> and leave the disk image open.</li>
<li>Open Terminal.</li>
<li>Run &#8220;cd /Volumes/Growl-1.2/Extras/growlnotify&#8221;</li>
<li>Run &#8220;./install.sh&#8221;</li>
</ol>
<p>Then <a href="http://snippets.dzone.com/posts/show/2638">follow these directions</a> to get your R script to talk to Growl by adding something like:<br />
<code>    system(paste("growlnotify -a R -t \"R is done\" -m", "\"Inserted the data\"", sep=""))<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://michaelewens.com/2010/07/02/using-growl-with-r/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stata, ODBC and date columns</title>
		<link>http://michaelewens.com/2010/05/23/stata-odbc-and-date-columns/</link>
		<comments>http://michaelewens.com/2010/05/23/stata-odbc-and-date-columns/#comments</comments>
		<pubDate>Sun, 23 May 2010 06:32:13 +0000</pubDate>
		<dc:creator>Michael Ewens</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[ado]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[stata]]></category>

		<guid isPermaLink="false">http://michaelewens.com/?p=648</guid>
		<description><![CDATA[Stata has a ton of flexilbility for creating and manipulating dates. However, if you want to save Stata data to an external database (e.g. Accesss, PostgreSQL, MySQL, etc.) the numeric date format in Stata will be difficult to interpret outside the program. My use case involved working with Stata to merge and clean some data [...]]]></description>
			<content:encoded><![CDATA[<p>Stata has a ton of flexilbility for <a href="http://www.stata.com/help.cgi?dates_and_times">creating and manipulating dates</a>.  However, if you want to save Stata data to an external database (e.g. Accesss, PostgreSQL, <a href="http://www.mysql.com/">MySQL</a>, etc.) the numeric date format in Stata will be difficult to interpret outside the program.  My use case involved working with Stata to merge and clean some data that was pushed to a MySQL database with <a href="http://www.stata.com/help.cgi?odbc">odbc</a> and later loaded in <a href="http://www.r-project.org/">R</a> with its <a href="http://cran.r-project.org/web/packages/RODBC/index.html">odbc functionality</a>.  It was in the last step that I learned of Stata&#8217;s dating conventions when writing to external databases.  So <a href="http://www.stata.com/statalist/archive/2010-05/msg01190.html">I asked the Stata list</a>.</p>
<p>A <a href="http://www.stata.com/statalist/archive/2010-05/msg01201.html">very helpful subsciber</a> presented a solution very similar to one that I mocked up.  With some of the code posted on the Statalist and some new additions, I present <a href="http://pastebin.com/8ywbft1S">odbc2create</a>. UPDATE: I fixed an issue when dealing with a database with no dates and had to add a loop.</p>
<p>This modified odbc command does the following:</p>
<ul>
<li>searches all your variables for dates (they must be formatted as such or Stata&#8217;s ability to detect them is impossible)</li>
<li>converts those dates to the YYYY-MM-DD format</li>
<li>inserts the dates into your mysql database as strings</li>
<li>re-types those date columns in the newly created database as DATEs</li>
</ul>
<p>The best part: when you load a table created this way back into Stata, it immediately recognized the DATEs as dates.  I hope they build this functionality into Stata in the future.  One caveat (which may explain why they haven&#8217;t built it internally) is that the ALTER command in the ado file is specific to MySQL.  Someone should generalize the code to recognize the datasource engine and modify the ALTER command accordingly.</p>
]]></content:encoded>
			<wfw:commentRss>http://michaelewens.com/2010/05/23/stata-odbc-and-date-columns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Latex regression and summary tables in Stata</title>
		<link>http://michaelewens.com/2010/04/09/latex-regression-and-summary-tables-in-stata/</link>
		<comments>http://michaelewens.com/2010/04/09/latex-regression-and-summary-tables-in-stata/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 18:17:17 +0000</pubDate>
		<dc:creator>Michael Ewens</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[eststo]]></category>
		<category><![CDATA[latex]]></category>
		<category><![CDATA[regressions]]></category>
		<category><![CDATA[stata]]></category>

		<guid isPermaLink="false">http://michaelewens.com/?p=630</guid>
		<description><![CDATA[A clean, well organized latex table is difficult to build. If you do a lot of analysis in Stata, there are several tools to output latex tables of your regressions or summary statistics. These packages do not always work perfectly with the standard options. Below I present two example code snippets to produce a latex [...]]]></description>
			<content:encoded><![CDATA[<p>A clean, well organized latex table is difficult to build.  If you do a lot of analysis in Stata, there are several tools to output latex tables of your regressions or summary statistics.  These packages do not always work perfectly with the standard options.  Below I present two example code snippets to produce a latex table of a set of regressions that includes a IV estimator and a summary statistics table that compares two groups in a database.  Each uses the <a href="http://repec.org/bocode/e/estout/">eststo package</a>.</p>
<p><strong>Regression Table with Multiple Equations and Stages</strong></p>
<p>Here I run a couple of limited dependent variable models and a two-stage bivariate probit with an IV.  The output isn&#8217;t perfect, but it works for pre-submission distribution.</p>
<p><script src="http://gist.github.com/361415.js"></script></p>
<p>The output looks like this:</p>
<p><a title="View Latex regression output from eststo on Scribd" href="http://www.scribd.com/doc/29669150/Latex-regression-output-from-eststo" style="margin: 12px auto 6px auto; font-family: Helvetica,Arial,Sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; display: block; text-decoration: underline;">Latex regression output from eststo</a> <object id="doc_787590025690274" name="doc_787590025690274" height="500" width="100%" type="application/x-shockwave-flash" data="http://d1.scribdassets.com/ScribdViewer.swf" style="outline:none;" rel="media:document" resource="http://d1.scribdassets.com/ScribdViewer.swf?document_id=29669150&#038;access_key=key-9dxl9jdjk355kd900nw&#038;page=1&#038;viewMode=list" xmlns:media="http://search.yahoo.com/searchmonkey/media/" xmlns:dc="http://purl.org/dc/terms/" ><param name="movie" value="http://d1.scribdassets.com/ScribdViewer.swf"><param name="wmode" value="opaque"><param name="bgcolor" value="#ffffff"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><param name="FlashVars" value="document_id=29669150&#038;access_key=key-9dxl9jdjk355kd900nw&#038;page=1&#038;viewMode=list"><embed id="doc_787590025690274" name="doc_787590025690274" src="http://d1.scribdassets.com/ScribdViewer.swf?document_id=29669150&#038;access_key=key-9dxl9jdjk355kd900nw&#038;page=1&#038;viewMode=list" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="500" width="100%" wmode="opaque" bgcolor="#ffffff"></embed></object>	</p>
<p><strong>Summary statistics with a by variable</strong></p>
<p>Next, consider summarizing the characteristics of two groups in your data.  For example, I want to compare the age, number of boards seats and other features of venture capital spinoff founders to everyone else.  </p>
<p><script src="http://gist.github.com/361423.js"></script></p>
<p>The output will look like this:</p>
<p><a title="View Found on Scribd" href="http://www.scribd.com/doc/29669266/Found" style="margin: 12px auto 6px auto; font-family: Helvetica,Arial,Sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; display: block; text-decoration: underline;">Found</a> <object id="doc_596590822087790" name="doc_596590822087790" height="500" width="100%" type="application/x-shockwave-flash" data="http://d1.scribdassets.com/ScribdViewer.swf" style="outline:none;" rel="media:document" resource="http://d1.scribdassets.com/ScribdViewer.swf?document_id=29669266&#038;access_key=key-2glxu6yf5sg47rimr1of&#038;page=1&#038;viewMode=list" xmlns:media="http://search.yahoo.com/searchmonkey/media/" xmlns:dc="http://purl.org/dc/terms/" ><param name="movie" value="http://d1.scribdassets.com/ScribdViewer.swf"><param name="wmode" value="opaque"><param name="bgcolor" value="#ffffff"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><param name="FlashVars" value="document_id=29669266&#038;access_key=key-2glxu6yf5sg47rimr1of&#038;page=1&#038;viewMode=list"><embed id="doc_596590822087790" name="doc_596590822087790" src="http://d1.scribdassets.com/ScribdViewer.swf?document_id=29669266&#038;access_key=key-2glxu6yf5sg47rimr1of&#038;page=1&#038;viewMode=list" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="500" width="100%" wmode="opaque" bgcolor="#ffffff"></embed></object>	</p>
<p>The full details of the <a href="http://repec.org/bocode/e/estout/hlp_esttab.html">esttab</a>, <a href="http://repec.org/bocode/e/estout/hlp_estpost.html">estpost</a> and <a href="http://repec.org/bocode/e/estout/hlp_eststo.html">eststo</a> have many more options and a lot of <a href="http://repec.org/bocode/e/estout/advanced.html">examples</a>.  </p>
]]></content:encoded>
			<wfw:commentRss>http://michaelewens.com/2010/04/09/latex-regression-and-summary-tables-in-stata/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running sums in Stata</title>
		<link>http://michaelewens.com/2010/02/21/running-sums-in-stata/</link>
		<comments>http://michaelewens.com/2010/02/21/running-sums-in-stata/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 19:36:05 +0000</pubDate>
		<dc:creator>Michael Ewens</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[stata]]></category>

		<guid isPermaLink="false">http://michaelewens.com/?p=610</guid>
		<description><![CDATA[Perhaps it is bad that I didn&#8217;t know this before, but the following code for Stata would have saved a week off of my dissertation work.  Suppose that you have data structured like so: firm_id,date,amount and you want to create a new variable that is the total amount as of each date for each firm. [...]]]></description>
			<content:encoded><![CDATA[<p>Perhaps it is bad that I didn&#8217;t know this before, but the following code for Stata would have saved a week off of my dissertation work.  Suppose that you have data structured like so:</p>
<p><code>firm_id,date,amount</code></p>
<p>and you want to create a new variable that is the total amount as of each date for each firm.  In Stata, you simply type:</p>
<p><code>sort firm_id date</code><br />
<code>bysort firm_id: gen total_t = sum(amount)</code></p>
<p>Note the use of &#8216;<a href="http://www.stata.com/help.cgi?Generate">gen</a>&#8216; rather than &#8216;<em><a href="http://www.stata.com/help.cgi?egen">egen</a></em>.&#8217; The &#8216;sum&#8217; command differs by the type of generate command (i.e. gen or egen), so about 500 lines of loops written in Stata code could be condensed in a few lines.  Stata needs to fix the &#8216;egen&#8217; and &#8216;gen&#8217; distinction or I need to port more of my projects to R.</p>
]]></content:encoded>
			<wfw:commentRss>http://michaelewens.com/2010/02/21/running-sums-in-stata/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Map of jobs for economists</title>
		<link>http://michaelewens.com/2009/10/31/map-of-jobs-for-economists/</link>
		<comments>http://michaelewens.com/2009/10/31/map-of-jobs-for-economists/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 04:16:28 +0000</pubDate>
		<dc:creator>Michael Ewens</dc:creator>
				<category><![CDATA[economics]]></category>
		<category><![CDATA[visualization]]></category>
		<category><![CDATA[jobs]]></category>
		<category><![CDATA[maps]]></category>
		<category><![CDATA[mashups]]></category>

		<guid isPermaLink="false">http://michaelewens.com/?p=576</guid>
		<description><![CDATA[The AEA&#8217;s JOE postings present the near-population of jobs available for newly-minted economic PhDs.  I used the XML data available for download to create a mash-up of job locations on Google Maps.  I break the posting down into US full-time academic, international full-time academic and non-academic.  Here is how I create the maps:  Select the [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.aeaweb.org/joe/listings.php">AEA&#8217;s JOE postings</a> present the near-population of jobs available for newly-minted economic PhDs.  I used the XML data available for download to create a mash-up of job locations on Google Maps.  I break the posting down into <a href="http://michaelewens.com/joe_map.html">US full-time academic</a>, <a href="http://michaelewens.com/non-us-academic.html">international full-time academic</a> and <a href="http://michaelewens.com/non-academic.html">non-academic</a>.  Here is how I create the maps: <a href="http://michaelewens.com/joe_map.html"><img class="alignleft size-medium wp-image-577" title="Screen shot 2009-10-31 at 9.05.55 PM" src="http://michaelewens.com/wp-content/uploads/2009/10/Screen-shot-2009-10-31-at-9.05.55-PM-300x186.png" alt="Screen shot 2009-10-31 at 9.05.55 PM" width="300" height="186" /></a></p>
<ol>
<li>Select the<a href="http://www.aeaweb.org/joe/listings.php"> subset of the data</a> you want (e.g. US academic) and download the XML file.</li>
<li>Fix some validation errors: take out the &#8220;&lt;&#8221; and &#8220;&gt;&#8221; within the text of nodes (I use <a href="http://macromates.com/">TextMate</a> for this).</li>
<li>Parse the XML file with a custom PHP script that creates a csv file with school, position, location and url to posting. <a href="http://michaelewens.com/parse_joe.phps">Here is my simple script</a> for the academic XML file.</li>
<li>Save the csv file produced by the script in step 3 as an Excel spreadsheet (Google Docs doesn&#8217;t like csv&#8217;s).  Add a &#8220;Latitude&#8221; and &#8220;Longitude&#8221; column to the spreadsheet.</li>
<li>Upload the Excel file to Google docs.</li>
<li><a href="http://otherfancystuff.blogspot.com/2008/11/geocoding-with-google-spreadsheets-and.html">Follow these directions</a> to populate the latitude and longitude of each position+location.</li>
<li>Publish the Google spreadsheet and save the unique id in the url that Google gives you.</li>
<li><a href="http://code.google.com/apis/maps/signup.html">Sign up for a Google Maps API account.</a></li>
<li><a href="http://gmaps-samples.googlecode.com/svn/trunk/spreadsheetsmapwizard/makecustommap.htm">Follow these directions</a> to produce a Google map of your postings.</li>
</ol>
<p>UPDATE: <a href="http://www.batchgeocode.com/">This service</a> may make this process a bit easier, produce cleaner maps and allow the incorporation of more information.</p>
<p>Maybe the AEA can follow these directions to produce these maps after this year.  <a href="http://michaelewens.com/contact/">Contact me</a> with any suggestions or questions.</p>
]]></content:encoded>
			<wfw:commentRss>http://michaelewens.com/2009/10/31/map-of-jobs-for-economists/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Publication quality images in Matlab</title>
		<link>http://michaelewens.com/2009/09/15/publication-quality-images-in-matlab/</link>
		<comments>http://michaelewens.com/2009/09/15/publication-quality-images-in-matlab/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 21:59:25 +0000</pubDate>
		<dc:creator>Michael Ewens</dc:creator>
				<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://michaelewens.com/?p=502</guid>
		<description><![CDATA[Matlab has some great plotting tools, but the output of export of  &#8221;Save As&#8221; rarely produces consistent and clean results. Enter export_fig. The best feature is its anti-aliasing that produces clean, crisp fonts. Just download the package and add add_path('export_fig') to your m file and you can use the function. I had the best luck [...]]]></description>
			<content:encoded><![CDATA[<p>Matlab has some great plotting tools, but the output of export of  &#8221;Save As&#8221; rarely produces consistent and clean results.  Enter <a href="http://www.mathworks.com/matlabcentral/fileexchange/23629">export_fig</a>.  The best feature is its anti-aliasing that produces clean, crisp fonts.  Just download the package and add</p>
<p><code>add_path('export_fig')</code></p>
<p>to your m file and you can use the function.  I had the best luck (see example below) with the follow command:</p>
<p style="text-align: center;"><code>export_fig('figures/updates/risk_over_size.png', '-png', '-nocrop');<br />
</code><br />
<a href="http://michaelewens.com/wp-content/uploads/2009/09/selection_to_mixture.png"><img class="aligncenter size-full wp-image-503" title="selection_to_mixture" src="http://michaelewens.com/wp-content/uploads/2009/09/selection_to_mixture.png" alt="selection_to_mixture" width="672" height="411" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://michaelewens.com/2009/09/15/publication-quality-images-in-matlab/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Cell arrays and strings in Matlab</title>
		<link>http://michaelewens.com/2009/09/02/cell-arrays-and-strings-in-matlab/</link>
		<comments>http://michaelewens.com/2009/09/02/cell-arrays-and-strings-in-matlab/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 02:27:10 +0000</pubDate>
		<dc:creator>Michael Ewens</dc:creator>
				<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://michaelewens.com/?p=436</guid>
		<description><![CDATA[Suppose you want to create a dynamic matrix of strings in Matlab.  For example, you might want the legend of your graph to depend on the data (which changes on a daily basis).  Cell arrays are your best bet.  However, be warned on how to access the elements of said arrays.  Suppose I have a [...]]]></description>
			<content:encoded><![CDATA[<p>Suppose you want to create a dynamic matrix of strings in Matlab.  For example, you might want the legend of your graph to depend on the data (which changes on a daily basis).  <a href="http://blogs.mathworks.com/loren/2006/06/21/cell-arrays-and-their-contents/">Cell arrays</a> are your best bet.  However, be warned on how to access the elements of said arrays.  Suppose I have a cell array constructed as follows:</p>
<p><code>names = cell(3,2);<br />
names(high_regime,: ) = [{'Probability of a home run'} {'Home Run'}];<br />
names(low_regime, : ) = [{'Probability of bankruptcy'} {'Bankruptcy'}];<br />
names(middle_regime, : ) = [{'Probability break-even'} {'Break-even'}];</code></p>
<p>If you want to access a particular element of this cell array <em>as a string, </em>you must use the curly brackets like so:</p>
<p><code>set(plot1(1),'LineStyle','-.','DisplayName',names{1,2});</code></p>
<p>If you try the standard <code>names(1,2)</code>, the function set() will not think the result is a string.</p>
]]></content:encoded>
			<wfw:commentRss>http://michaelewens.com/2009/09/02/cell-arrays-and-strings-in-matlab/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Home runs, singles and strike outs in venture capital returns</title>
		<link>http://michaelewens.com/2009/09/02/home-runs-singles-and-strike-outs-in-venture-capital-returns/</link>
		<comments>http://michaelewens.com/2009/09/02/home-runs-singles-and-strike-outs-in-venture-capital-returns/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 02:19:44 +0000</pubDate>
		<dc:creator>Michael Ewens</dc:creator>
				<category><![CDATA[research]]></category>
		<category><![CDATA[graphs]]></category>
		<category><![CDATA[mixture model]]></category>
		<category><![CDATA[returns]]></category>
		<category><![CDATA[Venture Capital]]></category>

		<guid isPermaLink="false">http://michaelewens.com/?p=416</guid>
		<description><![CDATA[Yesterday I posted a graph of the implied distribution of returns as an entrepreneurial firm increases its capital stock.  Today I present one important piece of that picture: the probabilities of return &#8220;regimes.&#8221;  First, the mixture model with mixing probabilities as a function of capital stock results in the following set of returns pdfs. Individual [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Yesterday I posted a <a href="http://michaelewens.com/2009/09/02/vc-returns-by-stage/">graph of the implied distribution of returns as an entrepreneurial firm increases its capital stock</a>.  Today I present one important piece of that picture: the probabilities of return &#8220;regimes.&#8221;  First, the mixture model with mixing probabilities as a function of capital stock results in the following set of returns pdfs.</p>
<div class="mceTemp mceIEcenter" style="text-align: center;">
<dl id="attachment_419" class="wp-caption aligncenter" style="width: 476px;">
<dt class="wp-caption-dt"><a href="http://michaelewens.com/wp-content/uploads/2009/09/full_param_3.png"><img class="size-full wp-image-419  " title="full_param_3" src="http://michaelewens.com/wp-content/uploads/2009/09/full_param_3.png" alt="Individual return regimes and full pdf " width="466" height="281" /></a></dt>
<dd class="wp-caption-dd">Individual return regimes and full pdf </dd>
</dl>
</div>
<p style="text-align: left;">It is clear from the figure that the return regimes separate nicely into the outcomes &#8220;high,&#8221; &#8220;medium&#8221; and &#8220;low.&#8221;  Venture capitalists like to call the outcomes in their portfolios &#8220;home runs,&#8221; &#8220;singles&#8221; or &#8220;strikeouts&#8221; and they typically set goals for proportions of each in their portfolio.  The mean log returns and volatilities for each regime show extreme separation between the two tails.</p>
<p style="text-align: center;"><strong>Distribution of Returns by Regime</strong></p>
<table style="text-align: center;" border="1" width="400px">
<tbody>
<tr>
<th>Regime</th>
<th><img src='http://s.wordpress.com/latex.php?latex=E%5B%5Cln%20R%5D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='E[\ln R]' title='E[\ln R]' class='latex' /></th>
<th><img src='http://s.wordpress.com/latex.php?latex=%5Csigma%28%5Cln%20R%29&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\sigma(\ln R)' title='\sigma(\ln R)' class='latex' /></th>
<th>Probability</th>
</tr>
<tr>
<td>Home run</td>
<td>231%</td>
<td>123%</td>
<td>20%</td>
</tr>
<tr>
<td>Break-even</td>
<td>-1%</td>
<td>80%</td>
<td>60%</td>
</tr>
<tr>
<td>Bankruptcy</td>
<td>-273%</td>
<td>137%</td>
<td>20%</td>
</tr>
<tr>
<td>Full Model</td>
<td>-9%</td>
<td>112%</td>
<td>N/A</td>
</tr>
</tbody>
</table>
<p><em>Includes all returns observations.  Estimated with sample selection and endogeneity corrections.</em></p>
<p>The mixing probabilities are a function of lagged capital stock, so I can plot the probability of each outcome for a range of dollars invested.  Figure 2 below shows that the bankruptcy risk is constant across capital stock while the probability of a home-run is highest for small firms.  Similarly, as firms raise more capital (and thus avoid bankruptcy) the most likely outcome becomes the &#8220;break-even&#8221; state with a 0% return.</p>
<div class="mceTemp mceIEcenter" style="text-align: center;">
<dl id="attachment_418" class="wp-caption aligncenter" style="width: 517px;">
<dt class="wp-caption-dt"><a href="http://michaelewens.com/wp-content/uploads/2009/09/prob_outcomes_size.png"><img class="size-full wp-image-418 " title="prob_outcomes_size" src="http://michaelewens.com/wp-content/uploads/2009/09/prob_outcomes_size.png" alt="The probability of each regime as a function of capital stock" width="507" height="402" /></a></dt>
<dd class="wp-caption-dd">The probability of each regime as a function of capital stock</dd>
</dl>
</div>
<p>Tomorrow I will discuss the motivation &#8212; theoretical and statistical &#8212; for the mixture model and parameterization of the mixing probabilities.</p>
]]></content:encoded>
			<wfw:commentRss>http://michaelewens.com/2009/09/02/home-runs-singles-and-strike-outs-in-venture-capital-returns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VC Returns by Stage</title>
		<link>http://michaelewens.com/2009/09/02/vc-returns-by-stage/</link>
		<comments>http://michaelewens.com/2009/09/02/vc-returns-by-stage/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 06:47:51 +0000</pubDate>
		<dc:creator>Michael Ewens</dc:creator>
				<category><![CDATA[research]]></category>
		<category><![CDATA[visualization]]></category>
		<category><![CDATA[returns]]></category>
		<category><![CDATA[Venture Capital]]></category>

		<guid isPermaLink="false">http://michaelewens.com/?p=404</guid>
		<description><![CDATA[Warning: Preliminary Dissertation Results Below My work on VC risk and return currently focuses on fitting a mixture model to the selection-corrected round-to-round returns data. This model can incorporate non-normality, skewness, kurtosis and outliers. Recently, I introduced lagged capital stock into the mixing probabilities through a multinomial logit model because analysis of the full model [...]]]></description>
			<content:encoded><![CDATA[<p>Warning: Preliminary Dissertation Results Below</p>
<p>My work on VC risk and return currently focuses on fitting a mixture model to the selection-corrected round-to-round returns data.  This model can incorporate non-normality, skewness, kurtosis and outliers.  Recently, I introduced lagged capital stock into the mixing probabilities through a multinomial logit model because analysis of the full model on &#8220;small&#8221; and &#8220;large&#8221; firms illustrated significant differences in results across firm size.  With a continuous variable like capital stock, I can produce the estimated mixture pdf for a wide range of entrepreneurial firm sizes.  The video below shows the progression of the selection and endogeneity-corrected (they are different!) mixture pdf.</p>
<p>[vimeo]http://www.vimeo.com/6393464[/vimeo]</p>
<p>The most dramatic change as firm size increases is in the right tail: larger firms have significantly more mass in the middle of the distribution.   The underlying regimes match a world of &#8220;Losers,&#8221; &#8220;Winners&#8221; and &#8220;Break Even&#8221; as seen in the figure below.</p>
<div id="attachment_407" class="wp-caption aligncenter" style="width: 310px"><a href="http://michaelewens.com/wp-content/uploads/2009/09/full_param.png"><img class="size-medium wp-image-407" title="full_param" src="http://michaelewens.com/wp-content/uploads/2009/09/full_param-300x221.png" alt="3-regime VC returns" width="300" height="221" /></a><p class="wp-caption-text">3-regime VC returns</p></div>
<p>I have discovered that incorporating lagged capital stock into the mixing probability helps to separate the individual regimes.  I will be posting some more information about my results later in the week.</p>
]]></content:encoded>
			<wfw:commentRss>http://michaelewens.com/2009/09/02/vc-returns-by-stage/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Create a dated log file in Matlab</title>
		<link>http://michaelewens.com/2009/07/23/create-a-dated-log-file-in-matlab/</link>
		<comments>http://michaelewens.com/2009/07/23/create-a-dated-log-file-in-matlab/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 16:33:32 +0000</pubDate>
		<dc:creator>Michael Ewens</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[matlab]]></category>

		<guid isPermaLink="false">http://michaelewens.com/2009/07/23/create-a-dated-log-file-in-matlab/</guid>
		<description><![CDATA[If you change your datasets or code a lot in Matlab, it is smart to keep track of the results over time (trust me&#8230;.). The &#8216;diary&#8217; function allows you to record all output of your scripts to a file. Append your main .m file with the following code to create a diary/log file that is [...]]]></description>
			<content:encoded><![CDATA[<p>If you change your datasets or code a lot in Matlab, it is smart to keep track of the results over time (trust me&#8230;.).  The &#8216;diary&#8217; function allows you to record all output of your scripts to a file.  Append your main .m file with the following code to create a diary/log file that is uniquely dated to the time (to the minute) that you ran the script:</p>
<p><code>date_now = clock;</code><br />
<code>date_now = strcat(num2str(date_now(1)),'_',num2str(date_now(2)),'_', num2str(date_now(3)), num2str(date_now(4)), num2str(date_now(5)));</code><br />
<code>diary(strcat('log', date_now,'.log'));</code></p>
]]></content:encoded>
			<wfw:commentRss>http://michaelewens.com/2009/07/23/create-a-dated-log-file-in-matlab/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
