Choosing colors visually with ‘getcolors’

January 18, 2013
By
Choosing colors visually with ‘getcolors’

When plotting, I am constantly defaulting to the "main" colors in R - In other words, the colors that one can quickly call by number (1="black", 2="red", 3="green", 4="blue", ... etc.) . In my opinion, these colors do not lend themselves well to compelling graphics. I imagine this is the reason for the inclusion...

Read more »

Dynamically annotate graphs with Shiny

January 18, 2013
By
Dynamically annotate graphs with Shiny

Below I present a simple way to automatically annotate plots through Shiny It occurred to me that labeling plots should be really easy to do with R-studio's swanky 'Shiny' add on. To test this I gathered some time series data from Wikipedia, added opt...

Read more »

Using the GSL to compute eigenvalues

January 18, 2013
By
Using the GSL to compute eigenvalues

Two posts showed how to compute eigenvalues using Armadillo and using Eigen. As we also looked at using theGNU GSL, this post will show how to conpute eigenvalues using GSL. As mentioned in the previous GSL post, we instantiate C language pointers suitable for GSL (here the matrix M). Those must be freed manually, as shown...

Read more »

Using the GSL to compute eigenvalues

January 18, 2013
By
Using the GSL to compute eigenvalues

Two posts showed how to compute eigenvalues using Armadillo and using Eigen. As we also looked at using theGNU GSL, this post will show how to conpute eigenvalues using GSL. As mentioned in the previous GSL post, we instantiate C language pointers suitable for GSL (here the matrix M). Those must be freed manually, as shown...

Read more »

Power Calculations – relationship between test power, effect size and sample size

January 17, 2013
By
Power Calculations – relationship between test power, effect size and sample size

I was interested in modeling the relationship between the power and sample size, while holding the significance level constant (p = 0.05) , for the common two-sample t-Test. Luckily R has great support for power analysis and I found the function I was looking for in the package pwr. To calculate the power for the two-sample T-test

Read more »

In case you missed it: December 2012 Roundup

January 17, 2013
By

In case you missed them, here are some articles from December of particular interest to R users. The blog is.R ran an excellent series of R tips and applications in December, with posts including working with Stata files, working with graphs and networks, and text analysis. Kohske Takahashi provides R scripts to create a collection of optical illusions. Highlights...

Read more »

SHODAN API in R (With Examples)

January 17, 2013
By
SHODAN API in R (With Examples)

Folks may debate the merits of the SHODAN tool, but in my opinion it’s a valuable resource, especially if used for “good”. What is SHODAN? I think ThreatPost summed it up nicely: “Shodan is a Web based search engine that discovers Internet facing computers, including desktops, servers and routers. The engine, created by programmer John

Read more »

R Gauge Plots

January 17, 2013
By
R Gauge Plots

Gaston Sanchez’s post on R-Bloggers inspired me to waste a bit of time. He wanted to replicate the Google Charts widget to make gauges. I modified his code (below) in some minor ways and made a function out of it so you can alter the look and feel of your gauge. Feel free to pilfer

Read more »

Calculating a Gini Coefficients for a Number of Locales at Once in R

January 17, 2013
By
Calculating a Gini Coefficients for a Number of Locales at Once in R

The Gini coefficient is a measure of the inequality of a distribution, most commonly used to compare inequality in income or wealth among countries.Let's first generate some random data to analyze. You can download my random data or use the code below ...

Read more »

Maize trade Part I: Generate the network diagram

January 17, 2013
By
Maize trade Part I: Generate the network diagram

It has been several month since my last post, partially due to the fact that my laptop was lost and several deadlines was approaching. Fortunately I will be returning to Taiwan and get a new laptop within a week, and will be updating regularly...

Read more »

If SPSS can factor analyze MaxDiff scores, why can’t R?

January 17, 2013
By
If SPSS can factor analyze MaxDiff scores, why can’t R?

Answer:  The variance-covariance matrix containing all the MaxDiff scores is not invertible.  R tells you that, either with an error message or a warning.  SPSS, at least earlier versions still in use, runs the factor analysis witho...

Read more »

Steve Culman on the `plyr` Package

January 17, 2013
By

At Davis R Users’ Group yesteray, Steve Culman gave us an introduction to the plyr package and how to use it to manipulate data. Here’s his presentation, and the accompanying demonstration script: Steve’s talk is based on this paper by Hadley Wickham in the Journal of Statistical Software. A lot of useful related...

Read more »

Plotting Odds Ratios (aka a forrestplot) with ggplot2 –

January 17, 2013
By
Plotting Odds Ratios (aka a forrestplot) with ggplot2 –

Hi, if you like me work in medical research, you have to plot the results of multiple logistic regressions every once in a while. As I have not yet found a great solution to make these plots I have put together the following short skript. Do not expect too much, it’s more of a reminder

Read more »

Two free online courses starting soon: Data Analysis (with R) and Social Network Analysis

January 17, 2013
By
Two free online courses starting soon: Data Analysis (with R) and Social Network Analysis

There are two online courses starting soon on Coursera, which are free to register. 1. Data Analysis (with R) It is a 8-week online course starting on Jan 22nd 2013 <https://www.coursera.org/course/dataanalysis>. This course is an applied statistics course focusing on … Continue reading →

Read more »

Creating xts objects from source

January 17, 2013
By
Creating xts objects from source

A recent post showed how to access the attributes of an xts object. We used an xts object as these are powerful and popular—but any R object using attributed could be used to illustrate the point. In this short post, we show how one can also do the inverse in order to create an xts object at the C++...

Read more »

Creating xts objects from source

January 17, 2013
By
Creating xts objects from source

A recent post showed how to access the attributes of an xts object. We used an xts object as these are powerful and popular—but any R object using attributed could be used to illustrate the point. In this short post, we show how one can also do the inverse in order to create an xts object at the C++...

Read more »

Project Euler — problem 25

January 16, 2013
By
Project Euler — problem 25

Finally, the fog lasting for days went away this morning and the sun comes out. It’s a lovely winter day. After taking a walk after lunch, I feel like doing some math. So, here comes the 25th Euler problem. The … Continue reading →

Read more »

Optimal number of clusters

January 16, 2013
By
Optimal number of clusters

In the last post, Examples of Current Major Market Clusters, we looked at clustering Major Markets into 4 groups based on their correlations in 2012. Today, I want to continue with clustering theme and discuss methods of selecting number of clusters. I will look at the following methods of selecting optimal number of clusters: Minimum

Read more »

Slightly Different Measure of Valuation

January 16, 2013
By
Slightly Different Measure of Valuation

I grow tired of the tried and true standard measures of valuation, and from time to time I try to think of alternate methods.  One thought was to analyze Ken French’s Market(ME) to Book(BE) Breakpoints by percentile.  We can see by year at ...

Read more »

Podcast: Revolution Analytics, R and the changing technology landscape

January 16, 2013
By

In a recent interview with DataInformed's Ian Murphy, I discussed the history of the open-source R project and how Revolution Analytics is building on R to compete with legacy statistical software such as SAS and SPSS. Other topics we touched on during the 20-minute discussion included: R's growth in academia, the impact of cloud computing on analytics, and how...

Read more »

Wikipedia page views

January 16, 2013
By
Wikipedia page views

Here I present an application that quantifies Wikipedia page views. It can visualise any topic in any language. It is (shamelessly) based on an application by the blogger Andrew Clark (pssguy), whose code is available here.I have added:multi ...

Read more »

Using R to visually compare the volume of different information sources

January 16, 2013
By
Using R to visually compare the volume of different information sources

A couple of weeks ago Bob wrote about a post about a research note that was recently accepted to the iConference. In it we outline the beginnings of a research project where we look at the interaction of different media platforms (Twitter and Blogs) with more traditional sources. In this post I go through the

Read more »

Review of R Graphics Cookbook by Winston Chang

January 16, 2013
By

I just got a copy of Winston Chang's book R Graphics Cookbook, published by O'Reilly Media. This book follows now a series of O'Reilly books on R, including an R Cookbook. Winston Chang is a graduate student at Northwestern University but … Continue reading →

Read more »

R package meme

January 16, 2013
By
R package meme

I just got this from a former student who is working on a project with me: Awesome.    

Read more »

Simulated Maximum Likelihood with R

January 16, 2013
By

First update on my research, details here.

Read more »

Timing normal RNGs

January 16, 2013
By
Timing normal RNGs

In previous articles, we have seen that Rcpp can be particularly useful for simulations as it executes code at C++ speed. A very useful feature the API provided by R is the access to the R RNGs so that simulations at the C++ level can get precisely the same stream of random numbers as an R application would. But sometimes...

Read more »

Timing normal RNGs

January 16, 2013
By
Timing normal RNGs

In previous articles, we have seen that Rcpp can be particularly useful for simulations as it executes code at C++ speed. A very useful feature the API provided by R is the access to the R RNGs so that simulations at the C++ level can get precisely the same stream of random numbers as an R application would. But sometimes...

Read more »

The Basics of Betting as a Way of Keeping Score…

January 15, 2013
By
The Basics of Betting as a Way of Keeping Score…

Another preparatory step before I start learning about stats in the context of Formula One… There are a couple of things I’m hoping to achieve when I actually start the journey: 1) finding ways of using stats to help to pull out patterns and events that are interesting from a storytelling or news perspective; 2)

Read more »

Examples combining C++ and R: The Rcpp Gallery

January 15, 2013
By

We've written before about how you can use the Rcpp package to speed up R, by converting performance-critical snippets of R code to C++. (Rcpp makes it easy -- you don't even have to be a C++ expert.) If you haven't tried it out yet, you might want to browse the Rcpp Gallery: an collection of simple but illustrative...

Read more »

Sponsors