Author Archives: iangow

WRDS now has a PostgreSQL database

See here for an illustration using Python to access the data. Advertisements

Posted in Uncategorized | Leave a comment

Incorporating SQL in Stata code

Here is a snippet of code showing how one can include SQL in Stata code (I assume that the ODBC connection has been set up). #delimit ; local sql ” SELECT * FROM director_bio.directorship_results WHERE non_match AND start_date < date_filed … Continue reading

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

Playing with times in Python

from datetime import datetime from pytz import timezone, utc pacific = timezone(‘US/Pacific’) gemma_bd = datetime(2007, 8, 27, 7, 45) gemma_bd = pacific.localize(gemma_bd, is_dst=True) print(utc.localize(datetime.utcnow()) – gemma_bd)

Posted in Uncategorized | Leave a comment

Installing PostgreSQL 9.6 using MacPorts

In another post, I describe how to install PostgreSQL with PL/R. The purpose of this post is to provide a streamlined version without PL/R. 1. Install PostgreSQL using MacPorts.. Of course, I assume you’ve got MacPorts up and running on … Continue reading

Posted in Uncategorized | 2 Comments

Executing SQL in a file against an ODBC source from Stata

I recently discovered that Stata has good support for OBDC. While the built-in functionality includes odbc sqlfile, a “batch job alternative to odbc exec,” there seems to be no equivalent alternative for odbc load (even though odbc load is surely … Continue reading

Posted in Mac, PostgreSQL, Stata | Leave a comment

Another way to access PostgreSQL from Stata

In an earlier post, I discussed a way of accessing PostgreSQL from Stata. One downside is that this approach would not work for Windows users without significant modification. I asked a question on StackOverflow to see if anyone could identify … Continue reading

Posted in Uncategorized | Leave a comment

GitHub code repository

For anyone reading this blog, I also have a repository on GitHub dedicated to code for compiling data from standard sources (e.g., WRDS). I’m still in the process of documenting this, but the documentation for some parts (e.g., Perl scripts … Continue reading

Posted in Uncategorized | Tagged , | Leave a comment