Giter Site home page Giter Site logo

qmj's Introduction

# qmj (Quality Minus Junk)
Authors : Eugene Choe, David Kane, Ryan Kwon, Anthoney Tsou

To install the package:

```{r}
library(devtools)
install_github("anttsou/qmj")
```

##Background
qmj implements the results and methodology of the paper Quality Minus Junk by Clifford Asness, Andrea Frazzini, Lasse Pedersen. They use several measures to calculate scores for the relative profitability, growth, safety, and payouts of a company. Combining those scores generates an overall quality score.

High quality companies are likely outperform the market, while "junk" companies are likely to underperform.

Here we use the equations and methods described in the paper, coupled with data scraped from online sources, in order to produce quality measurements for companies listed in the Russell 3000 Index.

##Getting Started
In order to start you off, qmj comes equipped with several data sets, including company information, financial statements, and daily stock data. To access them, call:

```{r}
library(qmj)
companies <- qmjdata::companies ## Stores company names and tickers from the Russell 3000 index.
financials <- qmjdata::financials ## Stores financial documents for the given list of companies.
prices <- qmjdata::prices ## Stores price returns and closing stock prices for the past two years.
quality <- qmjdata::quality ## Stores the quality scores and the scores of its components.
```

Getting a quality data frame and a holistic summary of all its components can be done by calling

```{r}
market_data(companies, financials, prices)
```

If you're only interested in accessing certain quality factors, such as profitability, as well as what makes it up (such as gross profits over assets (GPOA), or cash flow over assets (CFOA)) call

```{r}
market_profitability(companies, financials)
```

This will return a data frame containing profitability z-scores for the given companies as well as the z-scores for the components creating the profitability scores.

##Updating your Data
Suppose you want to use the qmj package for your a custom set of companies, a dataset we will call "custom_companies". You can generate the most recent financial statements for those companies as follows:

```{r}
## Note that your custom data frame of company names and tickers must have the column name 
## "ticker" for the column of tickers.

## Retrieves raw financial statements from google finance through the quantmod package.

rawdata <- get_info(custom_companies) 

## Renders raw data in a format usable by other functions in this package 
## and also dramatically improves readability.

financials <- tidyinfo(rawdata) 

```

get_info also allows you to resume your downloading if the process is interrupted for any reason.

##Updating Prices
Updating prices is a separate, lengthy process, and for that reason is separated from the other functions that automatically collect financial statements. To update prices, which is necessary for calculating safety measurements, call:

```{r}

## Retrieves stock price data from Google Finance for listed companies for the past two years. 
## Also saves data from the S&P 500, retrieved from Yahoo Finance.

rawprices <- get_prices(custom_companies) 

## Renders the raw data into a form usable by other functions in this package.

prices <- tidy_prices(rawprices) 
```

Similar to the get_info function, The get_prices function is also able to save its progress and resume previous downloads.

##More Information
More information, especially regarding methodology and what measures were used to filter out companies with bad or insufficient data, may be found in our vignette.

qmj's People

Contributors

anttsou avatar davidkane9 avatar echoe95 avatar rynkwn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.