Tag Archives: R

Installing R on Mac OS from the command line

I just updated R remotely. I wanted to avoid the hassle of logging in via VNC (“Screen Sharing”), so I did this: Now, to get RStudio from the command-line: Advertisements

Posted in Mac, R | Tagged , | Leave a comment

Get “tone” from corporate disclosures: PostgreSQL, Python, and R.

The paper by Loughran and McDonald (2011) develops lists of words that are intended to reflect “tone” in financial text. The following code retrieves these lists and applies them to a large body of text (over a billion words) from … Continue reading

Posted in Uncategorized | Tagged , , , , , , , | 4 Comments

Code for 5.2.5 Extended Example: A Salary Study from “The Art of R Programming”

Here is code for 5.2.5 Extended Example: A Salary Study from “The Art of R Programming“. The primary addition to the code in the book is the addition of code to get the data from the Department of Labor’s website.

Posted in R | Tagged , | Leave a comment

IV regression and two-way cluster-robust standard errors

As a follow-up to an earlier post, I was pleasantly surprised to discover that the code to handle two-way cluster-robust standard errors in R that I blogged about earlier worked out of the box with the IV regression routine available … Continue reading

Posted in Uncategorized | Tagged , , , | 8 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

R code to fetch Fama-French factor data

Ugly, but it works.

Posted in R | Tagged , , | 1 Comment