# apply

### Processing Data from a Statistica Worksheet Using R

August 29, 2012 |

Context: I work with data from non-profit organizations, and so a big concern in many of my analyses is if and how much people are donating from one year to the next.  One of the  things I normally like to do … Continue reading → [Read more...]

### Guess who wins: apply() versus for loops in R

April 28, 2012 |

Yesterday I tried to do some data processing on my really big data set in MS Excel. Wow, did it not like handling all those data!! Every time I tried to click on a different ribbon, the screen didn’t even … Continue reading → [Read more...]

### Example 9.21: The birthday "problem" re-examined

February 23, 2012 |

The so-called birthday paradox or birthday problem is simply the counter-intutitive discovery that the probability of (at least) two people in a group sharing a birthday goes up surprisingly fast as the group size increases. If the group is only 23 peo...

### Say it in R with "by", "apply" and friends

January 28, 2012 |

Iris versicolor (Source: Wikipedia)R is a language, as Luis Apiolaza pointed out in his recent post. This is absolutely true, and learning a programming language is not much different from learning a foreign language. It takes time and a lot of pr...

### Example 9.19: Demonstrating the central limit theorem

January 11, 2012 |

A colleague recently asked "why should the average get closer to the mean when we increase the sample size?" We should interpret this question as asking why the standard error of the mean gets smaller as n increases. The central limit theorem shows t...

### A quick primer on split-apply-combine problems

December 16, 2011 |

I’ve just answered my hundred billionth question on Stack Overflow that goes something like I want to calculate some statistic for lots of different groups. Although these questions provide a steady stream of easy points, its such a common and basic data analysis concept that I thought it would ... [Read more...]

### Struggling with apply() in R

December 11, 2009 |

It’s common knowledge that I struggle wrapping my head around the apply functions in R. That is illustrated very clearly in the following discussion on Stack Overflow: Dirk’s comment is actually spot on. I’ve asked the same damn question at least 4-5 times. Only I didn’t ... [Read more...]