New data visualization features in ggplot2 update

March 2, 2012
By
New data visualization features in ggplot2 update

Hadley Wickham has just released an update to the ggplot2 graphics package for R. Version 0.9.0 significantly speeds up the process of rendering graphics, and the documentation is much improved (including the addition of many new examples). This update also adds a bunch of new features, which are documented in this 40-page "changes and additions" guide. Here's a sampling...

Read more »

What is R-index

March 2, 2012
By
What is R-index

R index is developed in interpreting signal detection data for human perception. In sensory research it is used to interpret ranking data. The value one gets out of an R-index calculation is interpreted as a confusion between samples tested. It has bee...

Read more »

How to square numbers in your head

March 2, 2012
By
How to square numbers in your head

MENTALLY MULTIPLY NUMBERS BY THEMSELVES Assume you know your multiplication tables up to 10x10. Here's how to compute the squares of numbers from 11 to 100.

Read more »

When Venn diagrams are not enough – Visualizing overlapping data with Social Network Analysis in R

March 2, 2012
By
When Venn diagrams are not enough – Visualizing overlapping data with Social Network Analysis in R

I recently thought about ways to visualize medications and their co-occurences in a group of children. As long as you want to visualize up to  4 different medications you can simply use Venn diagrams. There is a very nice R-package to generate these kind of graphics for you (for a  description see: Chen and Boutros, 2011). But

Read more »

A terrible 2000 words

March 2, 2012
By
A terrible 2000 words

I've only just started looking at the homicide data made available by the Philadelphia Inquirer in my free time (which is hard to come by lately). I've been thinking about what sorts of statistics I could do, or what kinds of additional data sets I cou...

Read more »

ABC in Roma [R lab #2]

March 2, 2012
By
ABC in Roma [R lab #2]

Here are the R codes of the second R lab organised by Serena Arima in supplement of my lectures (now completed!). This morning I covered ABC model choice and the following example is the benchmark used in the course (and in the paper) about the impact of summary statistics. (Warning! It takes a while to

Read more »

Modeling Trick: the Signed Pseudo Logarithm

March 1, 2012
By
Modeling Trick: the Signed Pseudo Logarithm

Much of the data that the analyst uses exhibits extraordinary range. For example: incomes, company sizes, popularity of books and any “winner takes all process”; (see: Living in A Lognormal World). Tukey recommended the logarithm as an important “stabilizing transform” (a transform that brings data into a more usable form prior to generating exploratory statistics, Related posts:

Read more »

Download and Parse NAREIT Data

March 1, 2012
By
Download and Parse NAREIT Data

This is the first post of a series that describes how to download and parse specific data sets into R. These kinds of scripts can be functionalized further, but I doubt that these will ever find their way into a formal package. They are intended to be helpful to those facing similar tasks, but as

Read more »

NIT: Fatty acids study in R – Part 001

March 1, 2012
By
NIT: Fatty acids study in R – Part 001

This time I´m going to use my own data to develop a model to predict some fatty acid in the solid fat (pork).Samples had been analyzed in a NIT (Near Infrared Transmittance) instrument. The range of the wavelengths is from 850 to 1048 nm (100 data poi...

Read more »

Poisson approximation of binomial probabilities

March 1, 2012
By
Poisson approximation of binomial probabilities

This is yet another experiment to see how good is the approximation of binomial probability when we use Poisson and normal distributions for scenarios with large $n$, and $p$ close to zero or one. Consider a problem where the random variable $X$ follows a binomial distribution with a known probability of success $p$, and number of trials $n$. If $n$...

Read more »

R code for Chapter 1 of Non-Life Insurance Pricing with GLM

March 1, 2012
By
R code for Chapter 1 of Non-Life Insurance Pricing with GLM

Insurance pricing is backwards and primitive, harking back to an era before computers. One standard (and good) textbook on the topic is Non-Life Insurance Pricing with Generalized Linear Models by Esbjorn Ohlsson and Born Johansson. We have been doing some work in this area recently. Needing a robust internal training course...

Read more »

R code for Chapter 1 of Non-Life Insurance Pricing with GLM

March 1, 2012
By
R code for Chapter 1 of Non-Life Insurance Pricing with GLM

Insurance pricing is backwards and primitive, harking back to an era before computers. One standard (and good) textbook on the topic is Non-Life Insurance Pricing with Generalized Linear Models by Esbjorn Ohlsson and Born Johansson. We have been doing some work in this area recently. Needing a robust internal training course and documented methodology, we have...

Read more »

Parallelizing Voting simulation

March 1, 2012
By
Parallelizing Voting simulation

Last week I have compared synchronous and asynchronous implementation of NetLogo Voting model. An interesting afterthought is that synchronous model implementation can be easily made much faster using vectorization.The two versions of the Voting synchr...

Read more »

I see high frequency data

March 1, 2012
By
I see high frequency data

In the previous post I shared an example how to get high frequency data from IB broker (well, it is retail version of HFD – it has only best bid/ask and the trades). Now, once you saved some data – what should you do next? Next logical step would be data sanity check and visualization.

Read more »

Bad Science at Strata 2012

March 1, 2012
By

Ben Goldacre, the physician and biostatistician behind the always-excellent Bad Science column in the Guardian, gave a barnburner of a talk at Strata 2012 yesterday, "The Information Architecture of Medicine is Broken". For anyone not aware of the problems caused by publication bias in clinical trials (for example, ineffective drugs with a wide variety of side-effects coming to market),...

Read more »

First Milano R net meeting

March 1, 2012
By
First Milano R net meeting

May 8, 2012 - 18:00 - 21:00 Fiori Oscuri Bistrot & Bar Via Fiori Oscuri, 3 - Milano (Zona Brera) Continue reading →

Read more »

Example 9.22: shading plots and inequalities

March 1, 2012
By
Example 9.22: shading plots and inequalities

A colleague teaching college algebra wrote in the R-sig-teaching list asking for assistance in plotting the solutions to the inequality x^2 - 3 > 0. This type of display is handy in providing a graphical solution to accompany an analytic one. RThe plot...

Read more »

First Milano R net meeting details

March 1, 2012
By

First Milano R net meeting. When: May 8, 2012, from 18.00 to 21.00 Where: Fiori Oscuri Bar & Bistrot, Via Fiori Oscuri 3, Milano. Further details

Read more »

R Tutorial Series: Centering Variables and Generating Z-Scores with the Scale() Function

March 1, 2012
By
R Tutorial Series: Centering Variables and Generating Z-Scores with the Scale() Function

Centering variables and creating z-scores are two common data analysis activities. While they are relatively simple to calculate by hand, R makes these operations extremely easy thanks to the scale() function. Tutorial FilesBefore we begin, you may wan...

Read more »

doSMP pulled

March 1, 2012
By
doSMP pulled

They have finally pulled that buggy unreliable piece of code that was doSMP from the CRAN mirrors while (I hear) Revolutions are re-writing it. To use all your cores for analysis on the Windows platform, you can try doSNOW instead; my code is something like the fragment...

Read more »

doSMP pulled

March 1, 2012
By
doSMP pulled

They have finally pulled that buggy unreliable piece of code that was doSMP from the CRAN mirrors while (I hear) Revolutions are re-writing it. To use all your cores for analysis on the Windows platform, you can try doSNOW instead; my code is something like the fragment below. Neither option is as attractive...

Read more »

Kölner R User Meeting 30 March 2012

March 1, 2012
By
Kölner R User Meeting 30 March 2012

Am 30. März 2012 möchte ich gerne das erste Kölner R Benutzer Treffen organisieren. Ich habe an den Treffen in London in den vergangen Jahren teilgenommen und hoffe auch in Köln Gleichgesinnte zu finden, die sich gerne bei einem Kölsch über R and...

Read more »

Generation of correlated random numbers: recommended article

February 29, 2012
By
Generation of correlated random numbers: recommended article

This quick blog entry to share an excellent article of Thijs van den Berg entitled Generating Correlated Random Numbers. This author describes in a nicely way how to generate sequences of correlated random numbers using the Cholesky decomposition, and a Eigenvector … Continue reading →

Read more »

R turns 12; R 2.14.2 is out

February 29, 2012
By

As promised by the R Core Group, R 2.14.2 is out. This is the final patchlevel of the R 2.14.x series (R 2.15.0 is due on March 30), and so R 2.14.2 will be the R engine for the next release of Revolution R Enterprise in a couple of months. Today also marks the 12th anniversary since R 1.0.0...

Read more »

Massive Increase in Ethanol Production

February 29, 2012
By
Massive Increase in Ethanol Production

Description: Yearly production of Ethanol in the United States since 1980. Data: http://www.ethanolrfa.org/ Analysis: When it comes to fuel - especially for transportation - oil is king. In 2010, the United States imported 180.8 billion gallons ...

Read more »

ROracle 1.1-1 Delivers Performance Improvements

February 29, 2012
By

The Oracle R Advanced Analytics team is happy to announce the release of the ROracle 1.1-1 package on the Comprehensive R Archive Network (CRAN).  We’ve rebuilt ROracle from the ground up, working hard to fix bugs and add optimizations. The new version introduces key improvements for interfacing with Oracle Database from open-source R. Specific improvements in ROracle 1.1-1 include:...

Read more »

A Direct Marketing In-flight Forecasting System

February 29, 2012
By
A Direct Marketing In-flight Forecasting System

This is an edited version of A Direct Marketing In-flight Forecasting System. The original article was written by Shannon Terry and Ben Ogorekm, Nationwide Insurrance, in order to enter the “Applications of R in Business” contest organised by Revolution Analytics. This is the winning entry of the contest. I added some notes in the third

Read more »

Programatically rename files (or do other stuff to them) in R

February 29, 2012
By

In order to do something to a bunch of files at once, we first need a vector which contains the file paths of just the files we are interested in. startingDir<-"/myDirectory"filez<-list.files(startingDir,pattern="searchPattern")head(filez) "/m...

Read more »

Functional ANOVA using INLA – update

February 29, 2012
By
Functional ANOVA using INLA – update

INLA author Håvard Rue wrote me to point out a problem in the Functional ANOVA code given in this post. I made a mistake in setting the precision of the fixed effects (I used “default” instead of “prec”). I’ve put Håvard’s corrected version of the code below.  

Read more »