A simple Approximate Bayesian Computation MCMC (ABC-MCMC) in R

July 15, 2012
By
A simple Approximate Bayesian Computation MCMC (ABC-MCMC) in R

Approximate Bayesian Computing and similar techniques, which are based on calculating approximate likelihood values based on samples from a stochastic simulation model, have attracted a lot of attention in the last years, owing to their promise to provide a general statistical technique for stochastic processes of any complexity, without the limitations that apply to “traditional”…

Read more »

Sourcing an R Script from Dropbox

July 14, 2012
By

Working on my R bootcamp materials and I thought it would be handy to get the bootcamp computers setup by sourcing an R script that will install all necessary non-core packages in it. The problem? How to deploy this script efficiently. A quick method w...

Read more »

Trends in AL run scoring (using R)

July 14, 2012
By

I have started to explore the functionality of R, the statistical and graphics programming language. And with what better data to play than that of Major League Baseball?There have already been some good examples of using R to analyze baseball data. The most comprehensive is the on-going series at The Prince of Slides (Brian Mills, aka...

Read more »

Visualization of a Twitter retweet network: art or useful data visualization?

July 14, 2012
By
Visualization of a Twitter retweet network: art or useful data visualization?

This is a Twitter retweet network. When people tweet, they may get retweeted by other people, repeating the message for their followers to view. Each retweet is a one-way flow of information that links the first person to each person who retweeted them (forwarded the original tweet into their own network). So, in this visualization

Read more »

Expected Shortfall Portfolio Optimization in R using nloptr

July 14, 2012
By
Expected Shortfall Portfolio Optimization in R using nloptr

I have previously done examples of QP optimization in for financial portfolios.  I am not a huge fan of variance optimization in finance.  Return distributions are not normal, are often skewed, and are usually leptokurtic.  In plain spea...

Read more »

Using R for classification in small-N studies

July 14, 2012
By
Using R for classification in small-N studies

Rick Davies just wrote an interesting post which combined thoughts on QCA (and multi-valued QCA or mvQCA) and classification trees with thoughts on INUS causation and classification trees. The question was something like: how can we look at a small-to-medium set of cases (like a dozen or a hundred countries or development programs) and tease

Read more »

Using R for classification in small-N studies

July 14, 2012
By

Rick Davies just wrote an interesting post which combined thoughts on QCA (and multi-valued QCA or mvQCA) and classification trees with thoughts on INUS causation and classification trees. The question was something like: how can we look at...

Read more »

Linear programming in R: an lpSolveAPI example

July 14, 2012
By
Linear programming in R: an lpSolveAPI example

First of all, a shout out to R-bloggers for adding my feed to their website! Linear programming is a valuable instrument when it comes to decision making. This post shows how R in conjunction with the lpSolveAPI package, can be used to build a linear programming model and to analyse  Read more »

Linear programming in R: an lpSolveAPI example

July 14, 2012
By
Linear programming in R: an lpSolveAPI example

First of all, a shout out to R-bloggers for adding my feed to their website! Linear programming is a valuable instrument when it comes to decision making. This post shows how R in conjunction with the lpSolveAPI package, can be used to build a linear programming model and to analyse its results. The lpSolveAPI package provides a complete implementation of the lp_solve...

Read more »

Smartphone operating system share mosaic plot

July 13, 2012
By
Smartphone operating system share mosaic plot

(This article was first published on Actuarially (Matt Malin), and kindly contributed to R-bloggers) Smartphone operating system share mosaic plot Author: Matt Malin The increasing dominance of smartphones across the market is a very common topic in technology and news sites, with analysis of operating system share and phone types often shown in the media. Stumbling across this article...

Read more »

Processing Public Data with R

July 13, 2012
By
Processing Public Data with R

I use R aplenty in analysis and thought it might be worthwhile for some to see the typical process a relative newcomer goes through in extracting and analyzing public datasets In this instance I happen to be looking at Canadian air pollution statistics. The data I am interested in is available on the Ontario Ministry

Read more »

Applications of R at Google

July 13, 2012
By

At a talk I saw at the useR!2012 conference last month, Googler Karl Millar estimated that there are at least 200 active R users at Google, plus another 300+ occasional users participating in Google's internal R support list. But what are all these Google employees doing with R? A post from the Google Research team published on Google+ yesterday...

Read more »

influence.ME updated to version 0.9

July 13, 2012
By

Influence.ME is an R extension package for R that provides tools for detecting influential data in multilevel regression models. It is developed by Rense Nieuwenhuis (that’s me), Manfred te Grotenhuis, and Ben Pelzer. Recently, a new version (0.9) was uploaded ...

Read more »

Analysing time course microarray data using Bioconductor: a case study using yeast2 Affymetrix arrays

July 13, 2012
By
Analysing time course microarray data using Bioconductor: a case study using yeast2 Affymetrix arrays

A few years ago I was involved in analysing some time-course microarray data. Our biological collaborators were interested in how we analysed their data, so this lead to a creation of tutorial, which in turn lead to a paper. When we submitted the paper, one the referees “suggested” that we write the paper using Sweave;

Read more »

Dynamical systems: Mapping chaos with R

July 13, 2012
By
Dynamical systems: Mapping chaos with R

Chaos. Hectic, seemingly unpredictable, complex dynamics. In a word: fun. I usually stick to the warm and fuzzy world of stochasticity and probability distributions, but this post will be (almost) entirely devoid of randomness. While chaotic dynamics are entirely deterministic, their sensitivity to initial conditions can trick the observer into seeing iid. In ecology, chaotic

Read more »

Examples and resources on association rule mining with R

July 13, 2012
By
Examples and resources on association rule mining with R

by Yanchang Zhao, RDataMining.com The technique of association rules is widely used for retail basket analysis, as well as in other applications to find assocations between itemsets and between sets of attribute-value pairs. It can also be used for classification … Continue reading →

Read more »

R for Ecologists: Making MATLAB-like Graphs in R

July 13, 2012
By
R for Ecologists: Making MATLAB-like Graphs in R

I’ve decided that my blog should become a brain dump for my experience/troubles/solutions to programming in R. I’ve met many people who want to learn but don’t have the time or patience to sit down and figure it out from … Continue reading →

Read more »

1-Month Reversal Strategy

July 12, 2012
By
1-Month Reversal Strategy

Today I want to show a simple example of the 1-Month Reversal Strategy. Each month we will buy 20% of loosers and short sell 20% of winners from the S&P 500 index. The loosers and winners are measured by prior 1-Month returns. I will use this post to set the stage for my next post

Read more »

RcppArmadillo 0.3.2.4

July 12, 2012
By

Conrad released version 3.2.4 of Armadillo yesterday. It contains a workaround for g++ 4.7.0 and 4.7.1 which have a regression triggered by the Armadillo codebase for small fixed-sized matrices. The corresponding RcppArmadillo package 0.3.2.4 arrived ...

Read more »

Napa Valley wine tasting map: interactive version

July 12, 2012
By
Napa Valley wine tasting map: interactive version

Got some great reactions to the Napa Valley wine tasting map made with the ggmap package I posted on Monday. A couple of people asked if similar maps could be made for other wine regions (like Australia's Hunter Valley, or the Walla Walla region in Washington): provided you have a list of winery addresses, tweaks to the same R...

Read more »

Using discrete-event simulation to simulate hospital processes

July 12, 2012
By
Using discrete-event simulation to simulate hospital processes

Discrete-event simulation is a very useful tool when it comes to simulating alternative scenario’s for current of future business operations. Let’s take the following case; Patients of an outpatient diabetes clinic are complaining about long waiting times, this seems to have an adverse effect on patient satisfaction and patient retention.  Read more »

GenABEL: an annoying error after the import of PLINK data format

July 12, 2012
By

In the previous post we saw how much convenient could be GenABEL in the management of genotypic/phenotypic data. We introduced the import of genotypic data from an Illumina format file: > convert.snp.illumina(inf = "gen.illu", out = "gen.raw", strand = "file") … Continue reading →

Read more »

Creating Williams designs with even number of products

July 12, 2012
By
Creating Williams designs with even number of products

A Williams design is a special Latin square with the additional property of first order carry over (each product is followed equally often by each other product). In R the package crossdes can be used to create them. > williams(4)    &nbsp...

Read more »

R scripts for downloading iButton Thermochron dataloggers

July 11, 2012
By

Last time, I posted some R code to help quickly launch many iButton Thermochron temperature dataloggers with the same mission parameters. The R code makes use of a publicly-available command line utility released by the iButton’s manufacturer, Maxim.  Of course, Maxim also has a command line utility for downloading the data from those iButtons that

Read more »

A primer on R2OpenBUGS using the simple linear regression example.

July 11, 2012
By
A primer on R2OpenBUGS using the simple linear regression example.

I make using OpenBUGS fun (and easier)! I've been a BUGS, WinBUGS and OpenBUGS user for some time now (20 years and counting!). The combination of R and OpenBUGS using the R2OpenBUGS package allows the user to bring together data preparation...

Read more »

Rcpp is smoking fast for agent-based models in data frames

July 11, 2012
By

In a previous post, I discussed different approaches to speeding up some loops in data frames. In particular, R data frames provide a simple framework for representing large cohorts of agents in stochastic epidemiological models, such as those representing disease … Continue reading →

Read more »

Bridget Riley exhibition in London

July 11, 2012
By
Bridget Riley exhibition in London

The other day I saw a fantastic exhibition of work by Bridget Riley. Karsten Schubert, who is Riley's main agent, has a some of her most famous and influential artwork from 1960 - 1966 on display, including the seminal Moving Squares from 1961.Photo of...

Read more »

Health Care Costs – Part 2, "Unhealthy Things Not Related to the Problem"

July 11, 2012
By
Health Care Costs – Part 2, "Unhealthy Things Not Related to the Problem"

Lighting Up Way back in the day, folks believed that smoking was not only cool but also completely safe. As Marcel Danesi states in his book Of Cigarettes, High Heels, and Other Interesting Things, Second Edition: An Introduction to Semiotics ...

Read more »

In case you missed it: June 2012 Roundup

July 11, 2012
By

In case you missed them, here are some articles from June of particular interest to R users. The FDA goes on the record that it's OK to use R for drug trials. A review of talks at the useR! 2012 conference. Using the negative binomial distribution to convert monthly fecundity into the chances of having a baby in a...

Read more »