Monthly Archives: August 2011

New feature of PL/R: WINDOW functions

PL/R is module that allows PostgreSQL to access R functionality. Here is an illustration of a feature recently added to PL/R. This is meant to represent a “panel” of ten-year time series for 100 firms numbered 1 through 100. I … Continue reading

Posted in Uncategorized | Tagged | Leave a comment

Getting SEC filing header files

This post provides some code for downloading header (*.sgml) files associated with SEC filings by firms. The first piece of code is a function that takes the path to the text filing, which is found on the SEC index files, … Continue reading

Posted in Uncategorized | 11 Comments

Getting SEC filing index files

Here is some R code to download SEC index files and put them into a database. This is an alternative to Perl code provided by Andrew Leone here. First, a function to download the zipped index file from the SEC … Continue reading

Posted in PostgreSQL, R | Tagged , , , | 26 Comments

10-K filings by day of the month

Here’s a cute picture. I was looking to sample 10-K filings and wondered whether I could assume they were well distributed over days of the month. This picture required surprisingly little code to produce:

Posted in Uncategorized | Tagged , , , | Leave a comment

Follow up to a MySQL to SAS comparison

The document here compares MySQL with SAS for some basic data tasks and gives the impression that MySQL is slower than SAS, but can be close enough in terms of performance to be worthy of consideration. I did a fairly … Continue reading

Posted in Uncategorized | Leave a comment

R code to fetch Fama-French factor data

Ugly, but it works.

Posted in R | Tagged , , | 1 Comment

Event returns, R, and PostgreSQL

Here is another nice illustration of the performance of R+PostgreSQL. The routine at the bottom of this post calculates event returns (raw, size-adjusted, and relative to value-weighted CRSP, and allowing for delisting) from a list of events (PERMNOs and dates). … Continue reading

Posted in Uncategorized | Tagged , , | Leave a comment