Monthly Archives: November 2013

Ordinary Least Squares is dead to me

November 28, 2013
By

Most books that discuss regression modeling start out and often finish with Ordinary Least Squares (OLS) as the technique to use; Generalized Least Squares (GLS) sometimes get a mention near the back. This is all well and good if the readers’ data has the characteristics required for OLS to be an applicable technique. A lot

Read more »

Happy Thanksgiving from Revolution Analytics

November 28, 2013
By

> require(devtools) > install_github("cowsay","SChamberlain") > require(cowsay) > say("Happy Thanksgiving!",by="chicken") ----- Happy Thanksgiving! ------ \ \ _ _/ } `>' \ `| \ | /'-. .-. \' ';`--' .' \'. `'-./ '.`-..-;` `;-..' _| _| /` /` (With thanks for Scott Chamberlain for the cowsay package.) For those in the US and everyone who celebrates, Happy Thanksgiving from the team...

Read more »

Computing and visualizing PCA in R

November 28, 2013
By
Computing and visualizing PCA in R

Following my introduction to PCA, I will demonstrate how to apply and visualize PCA in R. There are many packages and functions that can apply PCA in R. In this post I will use the function prcomp from the stats package. I will also show how to visualize PCA in R using Base R graphics.

Read more »

The ‘Deutsche Bahn’ (German Railway Corp.) is always late!!!! Or is it? And if, why?

November 28, 2013
By
The ‘Deutsche Bahn’ (German Railway Corp.) is always late!!!! Or is it? And if, why?

The biggest German railway company, the 'Deutsche Bahn', is subject of frequent emotional discussions about being late all the time. A big German newspaper, the Süddeutsche Zeitung built the so-called 'train monitor' (Zugmonitor). The data is (or was) made available in cooperation with OpenDataCity: http://www.opendatacity.de/zugmonitor-api/This API provided information about trains up until September, 29th 2013. After that, no...

Read more »

Fast Threshold Clustering Algorithm (FTCA) test

November 27, 2013
By
Fast Threshold Clustering Algorithm (FTCA) test

Today I want to share the test and implementation for the Fast Threshold Clustering Algorithm (FTCA) created by David Varadi. This implementation was developed and contributed by Pierre Chretien, I only made minor updates. Let’s first replicate the results from the Fast Threshold Clustering Algorithm (FTCA) post: The clusters are stable and match David’s results

Read more »

Errors-in-variables models in stan

November 27, 2013
By
Errors-in-variables models in stan

In a previous post, I gave a cursory overview of how prior information about covariate measurement error can reduce bias in linear regression. In the comments, Rasmus Bååth asked about estimation in the absence of strong priors. Here, I’ll describe a Bayesian approach for estimation and correction for covariate measurement error using a latent-variable based errors-in-variables...

Read more »

Mapping Power Outages in Maine Dynamically with Shiny/R

November 27, 2013
By

I decided to forego the D3 map mentioned in the previous post in favor of a Shiny one since I had 90% of the mapping code written. I binned the ranges into three groups, changed the color over to something more pleasant (with RColorBrewer), added an interactive table for the counties with outage and have

Read more »

Web Application Development with R Using Shiny – Book review

November 27, 2013
By
Web Application Development with R Using Shiny – Book review

As may already know (As I have said this a thousand times) I love R -:) And of course...I love Shiny -;)Today I had the opportunity to read a nice little book called Web Application Development with R using Shiny.This book starts of course with a small...

Read more »

devtools 1.4 now available

November 27, 2013
By
devtools 1.4 now available

We’re very pleased to announce the release of devtools 1.4. This version brings many improvements to package installation, including automated vignette building, and a better way of referring to repos on github, install_github("hadley/devtools"). There are also many other bug fixes and minor improvements; to see them all, please read the release notes file on github.

Read more »

Something to Think About Before Black Friday | rChart + dygraphs

November 27, 2013
By
Something to Think About Before Black Friday | rChart + dygraphs

US Retail stocks have been killing it.  Since the holiday season starting with Black Friday is so important to retail, let’s look at the US Retail industry price and Sharpe ratio using R rCharts and Performance analytics +  javascript dygraphs.  Thanks Kenneth French once again for the dataset.

Read more »