Prof. Luke Stein
GitHub requires that files be less than 100MB (50MB recommended). Note that by default GitHub does not turn csv
files into downloads, so you may have to choose Save As…
in your web browser.
Caution:
sp500d.csv
)Source: CRSP via WRDS
wrds_username = "YOUR_USERNAME"
db = wrds.Connection(wrds_username = wrds_username)
sp500d = db.get_table("crsp", "dsp500", columns=['caldt', 'spindx', 'sprtrn', 'vwretd', 'vwretx'], date_cols=['caldt'], index_col=['caldt'])
db.close()
sp500d.to_csv(r'sp500d.csv')
sp500m.csv
)Source: CRSP via WRDS
wrds_username = "YOUR_USERNAME"
db = wrds.Connection(wrds_username = wrds_username)
sp500m = db.get_table("crsp", "msp500", columns=['caldt', 'spindx', 'sprtrn', 'vwretd', 'vwretx'], date_cols=['caldt'], index_col=['caldt'])
db.close()
sp500m.to_csv(r'sp500m.csv')
monthly-tech.csv
)Source: Cameron Pfiffer
compustat_firms_2020.csv
)Source: Compustat via WRDS
See WRDS for variable documentation; note
indfmt
: Firms report differently as financial services firms or industrials (or both!)popsrc
: The data includes both domestic (US and Canada) and International populationsexchg
: Primary stock exchangestko
: Stock ownership type—not all are easily purchasableSales Prices of Houses in the City of Windsor
Source: R Ecdat Data Sets for Econometrics
import statsmodels.api as sm
import statsmodels.formula.api as smf
houses = sm.datasets.get_rdataset("Housing", "Ecdat").data