Map of jobs for economists

Posted in economics, visualization on October 31st, 2009 by Michael Ewens – Be the first to comment

The AEA’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: Screen shot 2009-10-31 at 9.05.55 PM

  1. Select the subset of the data you want (e.g. US academic) and download the XML file.
  2. Fix some validation errors: take out the “<” and “>” within the text of nodes (I use TextMate for this).
  3. Parse the XML file with a custom PHP script that creates a csv file with school, position, location and url to posting. Here is my simple script for the academic XML file.
  4. Save the csv file produced by the script in step 3 as an Excel spreadsheet (Google Docs doesn’t like csv’s).  Add a “Latitude” and “Longitude” column to the spreadsheet.
  5. Upload the Excel file to Google docs.
  6. Follow these directions to populate the latitude and longitude of each position+location.
  7. Publish the Google spreadsheet and save the unique id in the url that Google gives you.
  8. Sign up for a Google Maps API account.
  9. Follow these directions to produce a Google map of your postings.

UPDATE: This service may make this process a bit easier, produce cleaner maps and allow the incorporation of more information.

Maybe the AEA can follow these directions to produce these maps after this year.  Contact me with any suggestions or questions.

VC Returns by Stage

Posted in research, visualization on September 2nd, 2009 by Michael Ewens – 3 Comments

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 on “small” and “large” 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.

[vimeo]http://www.vimeo.com/6393464[/vimeo]

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 “Losers,” “Winners” and “Break Even” as seen in the figure below.

3-regime VC returns

3-regime VC returns

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.

Graphing mysql data with PHP + jQuery

Posted in visualization on March 24th, 2009 by Michael Ewens – 2 Comments

For our paper on apartment rental discrimination, I maintain a database of apartment rents across 30 US cities for 1 bedrooms or studios.  Once it is in mysql (easy), I can access it with PHP and send the data to a javascript file to make simple interactive graphs.

Average 1 Bedroom and Studio Rents in Major Cities (x-axis is week number since Feb 15th)

Here is how it was done:

1. PHP script to look through city names (I assume the database exists)

2. SQL statement:

SELECT WEEKOFYEAR( DATE ) AS woy, AVG( rent ) , COUNT( * ) FROM city_counts WHERE city = CITYNAME GROUP BY woy

3. For each city create a simple javascript-friendly string in PHP that looks like this:

{"LA": { label: "LA", data: [[8,1194.9206349206],[9,1261.7650969529]]},

4. Put it all together with Flot (this example) + jQuery.

I know very little (if any) Javascript, but got this up in 15 minutes.