Skip to content
Prev 360256 / 398503 Next

Interquartile Range

Hi,
  Here is what I am doing

notGroupedAll <- ddply(data
                 ,~groupColumn
                 ,summarise
                 ,col1_mean=mean(col1)
                 ,col2_mode=Mode(col2) #Function I wrote for getting the
mode shown below
                 ,col3_Range=myIqr(col3)
                 )

groupedAll <- ddply(data
                 ,~groupColumn
                 ,summarise
                 ,col1_mean=mean(col1)
                 ,col2_mode=Mode(col2) #Function I wrote for getting the
mode shown below
                 ,col3_Range=Mode(col3)
                 )

#custom Mode function
Mode <- function(x) {
  ux <- unique(x)
  ux[which.max(tabulate(match(x, ux)))]

#the range function
myIqr <- function(x) {
  paste(round(quantile(x,0.375),0),round(quantile(x,0.625),0),sep="-")
}


}


Here is what I am doing!! :)
On Tue, Apr 19, 2016 at 2:57 PM, William Dunlap <wdunlap at tibco.com> wrote: