Home > Data Management > Importing WRDS data into Stata

Importing WRDS data into Stata

Wharton Research Data Services (WRDS) is a leading research platform and business intelligence tool for 400+ corporate, academic, and government researchers. If your institution subscribes to WRDS, you can now easily access WRDS data remotely via Stata’s odbc command. For questions or subscription information click here.

To set up a WRDS ODBC connection, you will need to download the correct
PostgreSQL ODBC driver and follow the instructions Using Stata at WRDS provided by WRDS.

Once the the ODBC driver has been installed and configured, you can type

        odbc load, table("table_name") dsn("dsn_name") noquote

to load data. For example, to load the Dow Jones daily data from WRDS, type

. odbc load, table(djdaily) dsn(wrds-pgdata-64) noquote

. describe

Contains data
  obs:        28,073
 vars:             9
 size:     2,021,256
-------------------------------------------------------------------------------
              storage   display    value
variable name   type    format     label      variable label
-------------------------------------------------------------------------------
date            double  %td
djc             double  %10.0g
djct            double  %10.0g
dji             double  %10.0g
djit            double  %10.0g
djt             double  %10.0g
djtt            double  %10.0g
dju             double  %10.0g
djut            double  %10.0g
-------------------------------------------------------------------------------
Sorted by:
     Note: Dataset has changed since last saved.

You can use odbc query “dsn_name“, schema to query the table names, but the command will return all tables in the WRDS system (over 22,000), not just the tables you have access to. You can use the WRDS website to view the data/table name you have access to.