-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
87 lines (62 loc) · 2.85 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# aqrr
<!-- badges: start -->
[![R-CMD-check](https://github.com/Reckziegel/aqqr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/Reckziegel/aqqr/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
Get the [datasets](https://www.aqr.com/Insights/Datasets) computed by the AQR research team in R.
## Installation
You can install the development version of aqrr from [GitHub](https://www.github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("Reckziegel/aqqr")
```
## Toy Example
```{r, warning=FALSE, message=FALSE}
library(dplyr)
library(ggplot2)
library(aqrr)
# Quality Minus Junk Factor
qmj <- aqr_qmj_monthly()
qmj <- na.omit(qmj)
qmj
```
```{r}
regions_to_exclude <- c("Global Ex USA", "North America", "Global", "Europe", "Pacific")
qmj |>
# data manipulation
filter(date >= "2000-01-02", !name %in% regions_to_exclude) |>
group_by(name) |>
na.omit() |>
mutate(performance = cumprod(exp(value))) |> # cumulative performance
ungroup() |>
# plot
ggplot(aes(x = date, y = performance, color = name)) +
geom_line(show.legend = FALSE) +
scale_y_log10() +
facet_wrap(~name, scales = "free_y") +
theme(axis.text.x = element_text(angle = 90)) +
labs(title = "Performance of the Quality Minus Junk Factor",
subtitle = "Monthly Data from 2020-01-02 to 2021-08-31",
caption = "Source: www.aqr.com",
x = NULL,
y = NULL)
```
## Functions
See the all available functions in the [reference](https://reckziegel.github.io/aqrr/reference/index.html) page.
## References
- https://www.aqr.com
- Asness, Cliff S. and Frazzini, Andrea and Pedersen, Lasse Heje, Quality Minus Junk (June 5, 2017). Available at SSRN: https://ssrn.com/abstract=2312432 or http://dx.doi.org/10.2139/ssrn.2312432
- Asness, Cliff S. and Moskowitz, Tobias J. and Moskowitz, Tobias J. and Pedersen, Lasse Heje, Value and Momentum Everywhere (June 1, 2012). Chicago Booth Research Paper No. 12-53, Fama-Miller Working Paper, Available at SSRN: https://ssrn.com/abstract=2174501 or http://dx.doi.org/10.2139/ssrn.2174501
- Frazzini, Andrea and Pedersen, Lasse Heje, Betting Against Beta (October 9, 2011). Swiss Finance Institute Research Paper No. 12-17, Available at SSRN: https://ssrn.com/abstract=2049939 or http://dx.doi.org/10.2139/ssrn.2049939
- Ilmanen, Antti S. and Israel, Ronen and Moskowitz, Tobias J. and Moskowitz, Tobias J. and Thapar, Ashwin K and Lee, Rachel, How Do Factor Premia Vary Over Time? A Century of Evidence (February 18, 2021). Available at SSRN: https://ssrn.com/abstract=3400998 or http://dx.doi.org/10.2139/ssrn.3400998