Monthly Archives: October 2009

Long R, Short Excel

October 29, 2009
By
Long R, Short Excel

R is very speedy statistical package that's like an F-18A Hornet, versus Excel which is like a paper airplane. R is professional sports, Excel is Pop Warner. R is Mona Lisa, Excel is stick figures. R is ... okay, you get the idea. I'm long R, and short...

Read more »

Income inequality and partisan voting in the United States

October 29, 2009
By

Lane Kenworthy, Yu-Sung Su, and I write: Income inequality in the United States has risen during the past several decades. Has this produced an increase in partisan voting differences between rich and poor? We examine trends from the 1940s thr...

Read more »

Simple R figures

October 29, 2009
By
Simple R figures

http://www.harding.edu/fmccown/R/This comes very handy.

Read more »

Kicking Ass with plyr

October 29, 2009
By
Kicking Ass with plyr

Tonight (October 29, 2009) at 5:30 PM is the Chicago R meetup at Jaks tap. Here’s more info.  I’ll be making a presentation based on my earlier blog post about plyr. The presentation will only be 8 minutes long so I’ve had to pick and choose my info carefully. OK, who am I kidding? I

Read more »

Go long on close and sell on open

October 29, 2009
By
Go long on close and sell on open

I found a description of supposed to be profitable strategy on Bloomberg. The strategy is simple – buy S&P500 index on close and sell it on next day open. So, I tested this claim and got nice P/L curve:Yes, since 1993 this strategy has generated the profit >300%. But, neither commissions or slippage are included:) Let’s

Read more »

Bioconductor 2.5 is out

October 29, 2009
By
Bioconductor 2.5 is out

For all bioinformaticians and R users out there: the Bioconductor project  for the analysis and comprehension of genomic data is out! A lot of interesting new stuff! See the full announcement here.

Read more »

Tips for Using StatET and Eclipse for Data Analysis in R

October 29, 2009
By
Tips for Using StatET and Eclipse for Data Analysis in R

My favourite editor for conducting analysis in R is the StatET plug-in for Eclipse. This post discusses an assortment of tips and tricks that I've discovered to make this editing environment even better.SearchSearch (Control + H): I maintain projects i...

Read more »

Using the “foreign” package for data conversion

October 27, 2009
By
Using the “foreign” package for data conversion

I was in a rush to convert a SPSS data into Stata format. Somehow my Stattransfer v.8 for Linux was lost and I did not want pause my work and go back to Windows just to get this one file converted. So fire Emacs+ESS+R, load the "foreign" package, did t...

Read more »

Literate programming, etc.

October 27, 2009
By
Literate programming, etc.

http://biostat.mc.vanderbilt.edu/wiki/Main/StatReport

Read more »

MultBar : Advanced multiple barplot with SEM

October 26, 2009
By
MultBar : Advanced multiple barplot with SEM

Producing this kind of graphs (below) in R can be a pain in the a*s. Here is a simple code that requires that data are presented in lists (see the example below). multbar <- function(list.of.lists,...,condnames=0,pal=colorRampPalette(c('grey','cornsilk')),seriesnames=0,legendpos='topleft',legh=TRUE,do.pty='s') { par(pty=do.pty,mgp=c(1.9,0.8,0),oma=c(0,0,0,0),mar=c(4,3,2,1),bg='transparent',bty='o',tck=0.02,yaxs='i') NofList <- length(list.of.lists) NofSubList <- length(list.of.lists]) if(condnames==0){condnames=c(1:NofList)} if(seriesnames==0){seriesnames=c(1:NofSubList)} dim.mat.treat <- (NofList+1)*NofSubList pos <- c(1:dim.mat.treat) pos <- matrix(pos,nrow=(NofList+1)) nbreaks

Read more »