[R] strange results in summary and IQR functions

Chunhao Tu tu_chunhao at yahoo.com
Tue Sep 8 17:09:05 CEST 2009


Dear R users,
Something is strange in summary and IQR. Suppose, I have a data set and I
would like to find the Q1, Q2, Q3 and IQR.  
 
x<-c(2,4,11,12,13,15,31,31,37,47)
> summary(x)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
   2.00   11.25   14.00   20.30   31.00   47.00 
> IQR(x)
[1] 19.75
However, I test the same data set in SAS "proc univariate", and SAS shows
that Q1=11, Q2=14 and Q3=31. I think most of us agree that Q1 is 11 not
11.25. 

Could someone please explain to me why R shows Q1=11.25 not 11?

Many Thanks
Tu


-- 
View this message in context: http://www.nabble.com/strange-results-in-summary-and-IQR-functions-tp25348079p25348079.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list