You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repository contains an R package that collects helper functions for
developers and researchers familiar with Tidy Finance with
R. The functions provide
shortcuts to selected issues that the book discusses in detail.
Installation
You can install the released version of tidyfinancefrom
CRAN via:
install.packages("tidyfinance")
You can install the development version of tidyfinance from
GitHub via:
The main functionality of the tidyfinance package centers around data
download. You can download most of the data that we used in Tidy
Finance with R using the
download_data() function or its children. For instance, both functions
give the same result:
You can also download data directly from
WRDS (if
you have set your credentials via
Sys.setenv(WRDS_USER = "your_username", WRDS_PASSWORD = "your_password")),
e.g.,
If you want to fetch additional columns that are not included in our
default selection, then pass them as additional arguments in the
corresponding child function:
There are also some simple helpers for regression analyses:
winsorize()
trim()
create_summary_statistics()
We also include (experimental) functions that can be used for different
applications, but note that they might heavily change in future package
versions as we try to make them more general:
# For portfolio sorts
?assign_portfolio()
# For model estimation
?estimate_model()
# For beta estimation
?estimate_betas()
# For beta estimation
?estimate_fama_macbeth()
About
R package with helper functions for developers and researchers familiar with Tidy Finance