Skip to content

Instantly share code, notes, and snippets.

View iangow's full-sized avatar
🏠
Working from home

Ian Gow iangow

🏠
Working from home
View GitHub Profile
@iangow
iangow / fix_stata_odbc.do
Created May 21, 2016 14:32
Line that fixes issue with Stata 14 and ODBC
set odbcdriver ansi, permanently
@iangow
iangow / odbc.sas
Last active May 26, 2016 15:52
Code to get data into SAS via ODBC (thanks to Dan Taylor for testing)
proc sql;
connect to odbc as iangow (datasrc=iangow);
create table mydata as
select * from connection to iangow (
SELECT *
FROM filings.ct_orders);
quit;
@iangow
iangow / logout.sh
Created May 27, 2016 16:03
Log yourself out of OS X from command line
launchctl bootout gui/$(id -u igow)
@iangow
iangow / install_r.sh
Last active August 18, 2019 22:28
Install R from the command line
wget https://cran.rstudio.com/bin/macosx/R-3.6.1.pkg
sudo installer -pkg R-3.6.1.pkg -target /
rm R-3.6.1.pkg
@iangow
iangow / column_reorder.sql
Created July 29, 2016 18:05
Change order of columns in PostgreSQL
CREATE TABLE tone_data_temp AS
SELECT file_name, last_update, category, word_count, litigious,
positive, uncertainty, negative, modal_strong, modal_weak
FROM bgt.tone_data;
DROP TABLE bgt.tone_data;
ALTER TABLE tone_data_temp RENAME TO tone_data;
ALTER TABLE tone_data SET SCHEMA bgt;
@iangow
iangow / com.rstudio.launchd.rserver.plist
Created August 3, 2016 08:20
Launch daemon for RStudio on OS X.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.rstudio.launchd.rstudio</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/lib/rstudio-server/bin/rserver</string>
@iangow
iangow / ccmxpf.md
Last active January 18, 2024 10:49
A brief look at CRSP-Compustat merges

More up-to-date material on this topic can be found here.


From WRDS:

The WRDS-created linking dataset (ccmxpf_linktable) has been deprecated. It will continue to be created for a transition period of 1 year. SAS programmers should use the Link History dataset (ccmxpf_lnkhist) from CRSP.

And from here:

@iangow
iangow / mturk_stuff.ipynb
Created March 9, 2017 21:45
Code to get data from PostgreSQL
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iangow
iangow / wrds_test.ipynb
Last active July 10, 2019 21:41
Illustration of WRDS access
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iangow
iangow / wrds_fdw.md
Last active March 27, 2017 01:20
Details on using foreign data wrapping to access WRDS

Issues

Some issues I see with using the WRDS PostgreSQL server include:

  1. Too many schema and tables
  • Added complexity for the user.
  1. No ability to create tables.
  • So there's no way to store results of long-running queries.
  • No ability to use compute() with dplyr.
  1. Difficult to combine WRDS data with large datasets.