search for: myiqr

Displaying 13 results from an estimated 13 matches for "myiqr".

2016 Apr 19
0
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)...
2016 Apr 19
2
Interquartile Range
...to ddply to use that function. Here is something >> >>> that might "work" for you: >> >>> >> >>> library(plyr) >> >>> >> >>> data <- data.frame(groupColumn=rep(1:5,1:5), col1=2^(0:14)) >> >>> myIqr <- function(x) { >> >>> >> paste(round(quantile(x,0.25),0),round(quantile(x,0.75),0),sep="-") >> >>> } >> >>> ddply(data, ~groupColumn, summarise, col1_myIqr=myIqr(col1), >> >>> col1_IQR=stats::IQR(col1)) >> >...
2016 Apr 20
2
Interquartile Range
...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 >...
2016 Apr 19
0
Interquartile Range
...say how the suggestion did not work. Jim's function had a typo in it - was that the problem? Or did you not change the call to ddply to use that function. Here is something that might "work" for you: library(plyr) data <- data.frame(groupColumn=rep(1:5,1:5), col1=2^(0:14)) myIqr <- function(x) { paste(round(quantile(x,0.25),0),round(quantile(x,0.75),0),sep="-") } ddply(data, ~groupColumn, summarise, col1_myIqr=myIqr(col1), col1_IQR=stats::IQR(col1)) # groupColumn col1_myIqr col1_IQR #1 1 1-1 0 #2 2 2-4...
2016 Apr 20
0
Interquartile Range
...t; 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 sh...
2016 Apr 20
2
Interquartile Range
...ata > >> ,~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 wrot...
2016 Apr 19
1
Interquartile Range
...Jim's > function had a typo in it - was that the problem? Or did you not > change the call to ddply to use that function. Here is something > that might "work" for you: > > library(plyr) > > data <- data.frame(groupColumn=rep(1:5,1:5), col1=2^(0:14)) > myIqr <- function(x) { > paste(round(quantile(x,0.25),0),round(quantile(x,0.75),0),sep="-") > } > ddply(data, ~groupColumn, summarise, col1_myIqr=myIqr(col1), > col1_IQR=stats::IQR(col1)) > # groupColumn col1_myIqr col1_IQR > #1 1 1-1 0 &gt...
2016 Apr 19
2
Interquartile Range
...Jim's > function had a typo in it - was that the problem? Or did you not > change the call to ddply to use that function. Here is something > that might "work" for you: > > library(plyr) > > data <- data.frame(groupColumn=rep(1:5,1:5), col1=2^(0:14)) > myIqr <- function(x) { > paste(round(quantile(x,0.25),0),round(quantile(x,0.75),0),sep="-") > } > ddply(data, ~groupColumn, summarise, col1_myIqr=myIqr(col1), > col1_IQR=stats::IQR(col1)) > # groupColumn col1_myIqr col1_IQR > #1 1 1-1 0 &gt...
2016 Apr 20
0
Interquartile Range
...,~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...
2016 Apr 19
2
Interquartile Range
...problem? Or did you not >>> change the call to ddply to use that function. Here is something >>> that might "work" for you: >>> >>> library(plyr) >>> >>> data <- data.frame(groupColumn=rep(1:5,1:5), col1=2^(0:14)) >>> myIqr <- function(x) { >>> paste(round(quantile(x,0.25),0),round(quantile(x,0.75),0),sep="-") >>> } >>> ddply(data, ~groupColumn, summarise, col1_myIqr=myIqr(col1), >>> col1_IQR=stats::IQR(col1)) >>> # groupColumn col1_myIqr col1_IQR >...
2016 Apr 19
0
Interquartile Range
...a typo in it - was that the problem? Or did you not >> change the call to ddply to use that function. Here is something >> that might "work" for you: >> >> library(plyr) >> >> data <- data.frame(groupColumn=rep(1:5,1:5), col1=2^(0:14)) >> myIqr <- function(x) { >> paste(round(quantile(x,0.25),0),round(quantile(x,0.75),0),sep="-") >> } >> ddply(data, ~groupColumn, summarise, col1_myIqr=myIqr(col1), >> col1_IQR=stats::IQR(col1)) >> # groupColumn col1_myIqr col1_IQR >> #1 1...
2016 Apr 19
5
Interquartile Range
That didn't work Jim! Thanks anyway On Mon, Apr 18, 2016 at 9:02 PM, Jim Lemon <drjimlemon at gmail.com> wrote: > Hi Michael, > At a guess, try this: > > iqr<-function(x) { > return(paste(round(quantile(x,0.25),0),round(quantile(x,0.75),0),sep="-") > } > > .col3_Range=iqr(datat$tenure) > > Jim > > > > On Tue, Apr 19, 2016 at
2016 Apr 19
0
Interquartile Range
...>> change the call to ddply to use that function. Here is something > >>> that might "work" for you: > >>> > >>> library(plyr) > >>> > >>> data <- data.frame(groupColumn=rep(1:5,1:5), col1=2^(0:14)) > >>> myIqr <- function(x) { > >>> paste(round(quantile(x,0.25),0),round(quantile(x,0.75),0),sep="-") > >>> } > >>> ddply(data, ~groupColumn, summarise, col1_myIqr=myIqr(col1), > >>> col1_IQR=stats::IQR(col1)) > >>> # groupColumn...