Monthly Archives: July 2009

ggplot2: more wicked-cool plots in R

July 20, 2009
By

As far as I know there are 3 different systems for producing figures in R: (1) base graphics, included with R, (2) the lattice package, and (3) ggplot2, one of the newer plotting systems which is, according to the creator Hadley Wickham, "based on the grammar of graphics, which tries to take the good parts of base and lattice...

Read more »

Probability exercise: negative binomial distribution

July 19, 2009
By
Probability exercise: negative binomial distribution

What is the probability you get the 4th cross before the 3rd head, flipping a coin?The mathematical formula for solving this exercise, which follows a negative binomial distribution, is:$$f(x)=P(X=x)=\begin{pmatrix} x+y-1\\ y-1 \end{pmatrix} \cdot p^x ...

Read more »

New RInside release

July 19, 2009
By

I just rolled up a new release of RInside, my C++ wrapper classes which facilitate embedding R into your own C++ application. This releases owes a big Thank you! to Miguel Lechón who not only noticed errant behaviour and occassional segfaults with overly long commands sent to the embedded R, but even traced it to an oversight of mine in a simple memory buffer class...

Read more »

New RInside release

July 19, 2009
By

I just rolled up a new release of RInside, my C++ wrapper classes which facilitate embedding R into your own C++ application. This releases owes a big Thank you! to Miguel Lechón who not only noticed errant behaviour and occassional segfaults with ov...

Read more »

New RInside release

July 19, 2009
By

I just rolled up a new release of RInside, my C++ wrapper classes which facilitate embedding R into your own C++ application. This releases owes a big Thank you! to Miguel Lechón who not only noticed errant behaviour and occassional segfaults with overly long commands sent to the embedded R, but even traced it to an oversight of mine in a simple memory buffer class...

Read more »

David Varadi’s RSI(2) alternative

July 19, 2009
By
David Varadi’s RSI(2) alternative

Here's a quick R implementation of David Varadi's alternative to the RSI(2).  Michael Stokes over at the MarketSci blog has three great posts exploring this indicator: Varadi’s RSI(2) Alternative: The DV(2) RSI(2) vs. DV(2) Last Couple...

Read more »

A probability exercise on the Bernoulli distribution

July 18, 2009
By
A probability exercise on the Bernoulli distribution

What is the probability, flipping a coin 8 times, to obtain the sequence HHTTTHTT? (H = head; T= tail)The theory teaches us that to solve this question, we can simply use the following formula:$$f(x)=P(X=x)=B(n,p)=\begin{pmatrix}n\\ x \end{pmatrix} \cd...

Read more »

Let us practice with some functions of R

July 18, 2009
By
Let us practice with some functions of R

Given the following data set, compute the arithmetic mean, median, variance, standard deviation; find the greatest and the smaller value, the sum of all values, the square of the sum of all values, the sum of the square of all values; assigne the ranks...

Read more »

Book excerpts now posted

July 18, 2009
By
Book excerpts now posted

We've posted excerpts from the book on the book website. The excerpts include Chapter 3 (regression and ANOVA) in its entirety. This demonstrates how the entries (the generic descriptions of software functions) and the worked examples reinforce each ...

Read more »

Parsing GEO SOFT files with Python and Sqlite

July 17, 2009
By
Parsing GEO SOFT files with Python and Sqlite

NCBI's GEO database of gene expression data is a great resource, but its records are very open ended. This lack of rigidity was perhaps necessary to accommodate the variety of measurement technologies, but makes getting data out a little tricky. But, a...

Read more »