Blog Archives

Beware: 2 is not always 2 in R

May 14, 2013
By

This post is minimalistic. Consider this: Now let's have look at what's inside x: But is it really true? Here you go. A colleague of mine was once ruined by this for an entire day before we realized what was…

Read more →

Read more »

AIC & BIC vs. Crossvalidation

May 7, 2013
By
AIC & BIC vs. Crossvalidation

Model selection is a process of seeking the model in a set of candidate models that gives the best balance between model fit and complexity (Burnham & Anderson 2002). I have always used AIC for that. But you can also…

Read more →

Read more »

Session 1: Gridding data for multi-scale macroecological analyses

April 22, 2013
By

These are materials for the first practical lesson of the Spatial Scale in Ecology course. All of the data and codes are available here. The class covered a 1.5h session. R code for the session is also at the end … Continue reading

Read more »

Not all proportion data are binomial outcomes

March 24, 2013
By

It really is trivial. Not every proportion is frequency. There are things that have values  bounded between 0 and 1 and yet they are neither probabilities, nor frequencies. Why do I even bother to write this? Because some kinds of … Continue reading

Read more »

Predictors, responses and residuals: What really needs to be normally distributed?

February 18, 2013
By

Introduction Many scientists are concerned about normality or non-normality of variables in statistical analyses. The following and similar sentiments are often expressed, published or taught: "If you want to do statistics, then everything needs to be normally distributed." "We normalized … Continue reading

Read more »

Data-driven science is a failure of imagination

January 2, 2013
By

Professor Hans Rosling certainly is a remarkable figure. I recommend watching his performances. Especially the BBC's "Joy of Stats" is exemplary. Rosling sells passion for data, visual clarity and great deal of comedy. He represents the data-driven paradigm in science. What … Continue reading

Read more »

Fast Conway’s game of life in R

November 25, 2012
By

Here I demonstrate a simple way to code Conway's game of life (GoL) in R and to produce the animation above. Cellular automata in R are usually painfully slow if you iterate through all grid cells in an array. A … Continue reading

Read more »

The simplest Species Distribution Model in OpenBUGS & R

September 27, 2012
By

This post demonstrates the simplest Species Distribution Model based on logistic regression for presence/absence data. I heavily simplified the example from Kéry (2010): Introduction to WinBUGS for Ecologists, Chapter 20.

Read more »

Using R for parallelizing OpenBUGS on a single Windows PC

August 22, 2012
By

It seems that most of the R-parallelizing business takes place on Linux clusters. And it makes sense. Why would you want to paralellize R on just a few processors (2 or 4) of a Windows laptop PC when the whole … Continue reading

Read more »

Linear regression in OpenBUGS

August 18, 2012
By

I always wondered why is it so difficult to find an OpenBUGS example of simple linear regression on the Web. Curiously, such example is even missing in the OpenBUGS help. The only nice example so far is in the book … Continue reading

Read more »