Causal Impact of a TV documentary on the demand of KeepCup

A few months ago ABC aired a documentary about how much waste we produce called War on Waste. The episode revealed that Australians use about 28 disposable takeaway coffee cups per second, triggering a lot of viewers to consider alternatives such as reusable cups.

The story did not mention any specific brand of reusable cup, but it did cause a significant impact on Google searches for the most popular brand: KeepCup. Looking at historic data from Google Trends it is clear that after the episode, searches for reusable coffee cups skyrocketed, as well as specific searches for KeepCup.

Continue reading

A Single-Index Model Shiny App for ETFs

In the quantitative finance world the Single-Index Model (SIM) is commonly used to price assets by measuring both volatility and return of a stock. According to this model, the return of any stock can be decomposed into expected excess returns (the returns above those from a market index, for example ASX200) due to firm-specific factors and macroeconomic factors.

Luckily R has many useful applications for quantitative finance in libraries stockPortfolio and PerformanceAnalytics which I have been using for the last 2 years to balance a portfolio of Exchange-Traded Funds (ETFs).

EDIT: I was forced to re-write the app using tidyquant to get returns as the function stockPortfolio::getReturns stopped working with Yahoo Finance data.

Continue reading

Success index of NBA teams using PLS Path Modelling

There are a few ways to access how good a team is. In this post I use Partial Least Squares Path Modelling to construct a team success index for NBA teams during the 2015-16 Playoffs.

PLS-PM can be described as a tool to analyse the relationship between blocks of variables, taking into account some previous knowledge about the phenomenon observed. In most competitive team sports like basketball success depends on a large number of variables. However, most of these variables can be grouped under two major blocks: offense and defense.

Continue reading

Visualising the 2015 NBA Draft in R



Continue reading

What AFL stadiums pull the biggest crowds?


So I decided to plot the attendance using ggplot2 boxplots.

Continue reading

Visualising NBA shot charts in Tableau

