Skip to content

AQR Asset Management datasets in R

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

Reckziegel/aqrr

Repository files navigation

aqrr

R-CMD-check

Get the datasets computed by the AQR research team in R.

Installation

You can install the development version of aqrr from GitHub with:

# install.packages("devtools")
devtools::install_github("Reckziegel/aqqr")

Toy Example

library(dplyr)
library(ggplot2)
library(aqrr)

# Quality Minus Junk Factor
qmj <- aqr_qmj_monthly()
qmj <- na.omit(qmj)
qmj
#> # A tibble: 10,276 x 3
#>    date       name     value
#>    <date>     <chr>    <dbl>
#>  1 1957-07-31 USA    0.0112 
#>  2 1957-08-31 USA    0.00488
#>  3 1957-09-30 USA    0.00701
#>  4 1957-10-31 USA    0.00271
#>  5 1957-11-30 USA   -0.00897
#>  6 1957-12-31 USA   -0.00327
#>  7 1958-01-31 USA   -0.0252 
#>  8 1958-02-28 USA    0.00480
#>  9 1958-03-31 USA    0.0159 
#> 10 1958-04-30 USA    0.00256
#> # i 10,266 more rows
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 page.

References

About

AQR Asset Management datasets in R

Topics

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages