[R] Quartiles and Inter-Quartile Range

eeramalho eeramalho at hotmail.com
Sat Jan 23 00:31:45 CET 2010


Why am I getting a wrong result for quartiles?

here is my code:

> cbiomass = c(910, 1058, 929, 1103, 1056, 1022, 1255, 1121, 1111, 1192,
> 1074, 1415)

> summary(cbiomass)

> IQR(cbiomass)

The result R gives me is:

For the summary
> Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
    910    1048    1088    1104    1139    1415 

For IQR
> 91.25

*********

The true Q1 is 1039 and not 1048. Q2 is 1156.5 and not 1139. And the
Inter-Quartile Range is 117.5 and not 91.25

How can I get these number right?




-- 
View this message in context: http://n4.nabble.com/Quartiles-and-Inter-Quartile-Range-tp1145817p1145817.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list