R Tutorial Series: Two-Way Omnibus ANOVA

January 17, 2011
By
R Tutorial Series: Two-Way Omnibus ANOVA

As with the one-way case, testing the omnibus hypothesis via two-way ANOVA is simple process in R. This tutorial will explore how R can be used to perform a two-way ANOVA to test the difference between two (or more) group means. Tutorial FilesBefore we...

Read more »

Introducing Monte Carlo Methods with R [precision]

January 17, 2011
By
Introducing Monte Carlo Methods with R [precision]

Doug Rivers, professor of Political Sciences in Stanford, kindly sent me this email yesterday night: The 2nd displayed equation in section 2.1.2 on p. 44 is garbled (it might be interpreted as saying that U and X have the same distribution). I think you intended: And indeed we should have stated the implicit convention that

Read more »

Normal market accidents

January 17, 2011
By
Normal market accidents

We think of accidents as abnormal events, but there is “normal accident” theory.  We don’t think of accidents happening in markets, but they do.  That’s why it’s called a market crash. For normal accidents to come into play, two conditions need to hold: the system is complex the system is tightly coupled Certainly the financial … Continue reading...

Read more »

Méthodes de Monte-Carlo avec R [out]

January 17, 2011
By
Méthodes de Monte-Carlo avec R [out]

The translation of the book Introducing Monte Carlo Methods with R is now published and out! I have received five copies in the mail yesterday, although it was not produced in time for my R class students to get it before the exam today. The book is still indicated on amazon.com as appearing in February,

Read more »

Dial-a-statistic! Featuring R and Estonia

January 16, 2011
By
Dial-a-statistic! Featuring R and Estonia

Did you wake up this morning hoping that you would be able to listen to telephone beeps inspired by Estonian web site metrics? I knew you did! First things first: I came up with the slightly crazy idea of using the bleepy sounds that telephones make, called “dual-tone multifrequency” (DTMF) tones, as a tool in

Read more »

Climate Charts, Data and RClimate Scripts

January 16, 2011
By
Climate Charts, Data and RClimate Scripts

While there are many online climate data resources, the source data files are in numerous data formats, presenting a challenge to climate citizen scientists who want to retrieve and analyze several climate indicators at the same time. I have been &#823...

Read more »

Plotting overbought / oversold regions in R

January 16, 2011
By
Plotting overbought / oversold regions in R

The good folks at Bespoke Investment Group frequently show charts of so-called overbought or oversold levels; see e.g. here for the most recent global markets snapshot. Classifying markets as overbought or oversold is a popular heuristic. It starts...

Read more »

When 1 * x != x

January 16, 2011
By
When 1 * x != x

Trying to dimly recall things from my maths degree, it seems that in most contexts the whole point of the number one is that it is a multiplicative identity. That is, for any x in your set, 1 * x is equal to x. It turns out that when you move to floating point numbers,

Read more »

Dona eis Python, whap!

January 15, 2011
By

Well, I'm taking the plunge and learning Python. We'll see how this goes. Then I'll try NumPy (and SciPy, if it gets ported), and see of I can get R and Python talking.

Read more »

Missing reference in Monte Carlo Statistical Methods

January 15, 2011
By
Missing reference in Monte Carlo Statistical Methods

A few days ago, Peng Yu sent me this email Dear Prof. Robert, The citation Edwards and Sokal (1988) appears on page 326 of your book MCSM2. However, I don’t find in in the Reference section (it would have appear on page 601 if it is in the reference section). I don’t find this error

Read more »

A lightweight object browser for R

January 15, 2011
By

Get access to a simple object browser in R so that you can see what variables, data frames, model objects and other junk you have in memory currently. If you don't want to install a full-fledged integrated development environment, this option may be fo...

Read more »

Easiest way to start imagining four-dimensional things is by…

January 15, 2011
By
Easiest way to start imagining four-dimensional things is by…

Easiest way to start imagining four-dimensional things is by numbering the corners of a 4-cube. First realize that the eight corners of a cube can be numbered “in binary” 000—001–010–100—110–101–011—111. Just like the four corners of ...

Read more »

Easiest way to start imagining four-dimensional things is by…

January 15, 2011
By
Easiest way to start imagining four-dimensional things is by…

Easiest way to start imagining four-dimensional things is by numbering the corners of a 4-cube. First realize that the eight corners of a cube can be numbered “in binary” 000—001–010–100—110–101–011—111. Just like the four corners of ...

Read more »

Adding lines or points to an existing barplot

January 15, 2011
By
Adding lines or points to an existing barplot

Sometimes you will need  to add some points to an existing barplot. You might try but you will get a funky looking line/points. It’s a bit squeezed. This happens because bars are not drawn at intervals 1:10, but rather on something else. This “else” can be seen if you save your barplot object. You will

Read more »

R Code Documentation Template

January 15, 2011
By
R Code Documentation Template

# *------------------------------------------------------------------# | PROGRAM NAME: # | DATE: # | CREATED BY: # | PROJECT FILE: # *----------------------------------------------------------------# | PURPOSE: # |# *-------...

Read more »

Quickly adapt starting values in MCMC using paste()

January 15, 2011
By
Quickly adapt starting values in MCMC using paste()

Waiting for convergence of MCMC models can take some time, therefore it may be a good idea to use better starting values. Using paste, one can quickly convert any (parameter) vector in the workspace into a R-style vector (with c()). Here's a function t...

Read more »

Parsing and plotting time series data

January 15, 2011
By
Parsing and plotting time series data

This morning I came across a post which discusses the differences between scala, ruby and python when trying to analyse time series data. Essentially, there is a text file consisting of times in the format HH:MM and we want to get an idea of its distribution. Tom discusses how this would be a bit clunky

Read more »

sab-R-metrics: Beginning with Boxplots, Scatterplots, and Histograms

January 15, 2011
By
sab-R-metrics: Beginning with Boxplots, Scatterplots, and Histograms

Today I decided to begin more with visualizations and less with basic statistical analysis for sabermetrics using R. I'm not really here to teach the ins and outs of regressions and statistical tests, so once I get there, I'm hoping that those who have read this already have a decent understanding of those subjects before implementing them. ...

Read more »

sab-R-metrics: Beginning with Boxplots, Scatterplots, and Histograms

January 15, 2011
By
sab-R-metrics: Beginning with Boxplots, Scatterplots, and Histograms

Today I decided to begin more with visualizations and less with basic statistical analysis for sabermetrics using R. I'm not really here to teach the ins and outs of regressions and statistical tests, so once I get there, I'm hoping that those who have read this already have a decent understanding of those subjects before implementing them. ...

Read more »

Book Review: Mixed Effects Models and Extensions in Ecology with R

January 14, 2011
By

A brief review of Zuur et al.'s book "Mixed Effects Models and Extensions in Ecology with R".

Read more »

Webinar on Portfolio Design, Optimization and Stability Analysis, Jan 26

January 14, 2011
By

We're very excited to host a new webinar from some of the leading researchers in portfolio design: Diethelm Würtz and Mahendra Mehta for the Rmetrics Association. This webinar will give an overview on current and recent developments and tools for portfolio design, optimization and stability analysis with the R/Rmetrics software environment. This webinar will review content available in the...

Read more »

Warming in Paris: minimas versus maximas ?

January 14, 2011
By
Warming in Paris: minimas versus maximas ?

Recently, I received comments (here and on Twitter) about my previous graphs on the temperature in Paris. I mentioned in a comment (there) that studying extremas (and more generally quantiles or interquantile evolution) is not the same as studying ...

Read more »

Bipartite networks and R

January 14, 2011
By
Bipartite networks and R

Earlier, I posted about generating networks from abundance distributions that you specify. If this post was interesting, check out Jeff Kilpatrick's website, where he provides code he produced in R and Octave to compare real bipartite networks to ones ...

Read more »

Statistical podcast: Random and Pseudorandom

January 14, 2011
By
Statistical podcast: Random and Pseudorandom

This morning when I downloaded the latest version of In our time, I was pleased to see that this weeks topic was “Random and Peudorandom.” If you’re not familiar with “In our time”, then I can I definitely recommend the series. Each week three academics and Melvyn Bragg discuss a particular topic from history, science,

Read more »

Changing phylogeny tip labels in R

January 14, 2011
By
Changing phylogeny tip labels in R

During the process of molecular systematic research, specimens are given code names and numbers to keep track of data through the pipeline. These can contain a lot of information of relevance to the researcher, but unfortunately are meaningless to others who aren't as involved with the data. On publication, it is necessary to change the names from the code...

Read more »

Changing phylogeny tip labels in R

January 14, 2011
By
Changing phylogeny tip labels in R

During the process of molecular systematic research, specimens are given code names and numbers to keep track of data through the pipeline. These can contain a lot of information of relevance to the researcher, but unfortunately are meaningless to others who aren't as involved with the data. On publication, it is necessary to change the names from the code...

Read more »

Remove all rows of an R dataframe

January 13, 2011
By
Remove all rows of an R dataframe

I should have probably figured this out a long time ago, but as I get deeper into programming with R, I am finding the need to remove all rows from a dataframe.  I was making this alot harder than it had to be. your.df<- your.df Replace your.df with, your dataframe and you are good

Read more »

Visualizing the Haiti earthquake with R

January 13, 2011
By

Yesterday was the one-year anniversary of the Haiti earthquake, and to put the scale of the event in context San Francisco bureau chief for New Scientist magazine and data journalist Peter Aldhous created a time-lapse animation of all large earthquakes in the last year, beginning with the 7.0-magnitude Haiti event. Peter used USGS data, R and Flash to generate...

Read more »

EPL Fantasy Football: Best overall, home and away teams

January 13, 2011
By
EPL Fantasy Football: Best overall, home and away teams

I've refined the R code to pick the best fantasy soccer team by using more granular player performance data (available publicly). Here are the best overall, home and away teams. The constraints used are: 1) Number of goalkeepers = 12) Nu...

Read more »