Hello, I faced something I can't understand. When I use boxplot.stats(1:10) and quantiles(1:10) the results are different for 25% and 75%:> boxplot.stats(1:10)$stats [1] 1.0 3.0 5.5 8.0 10.0> quantile(1:10)0% 25% 50% 75% 100% 1.00 3.25 5.50 7.75 10.00 Actually, I expected the value 3 for 25% and 8 for 75% as results of quantile(1:10). Can you please explain me why it isn't so. Regards, Vlad -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
"Vladimir N. Kutinsky" wrote:> > Hello, > > I faced something I can't understand. When I use boxplot.stats(1:10) and > quantiles(1:10) the results are different for 25% and 75%: > > > boxplot.stats(1:10) > $stats > [1] 1.0 3.0 5.5 8.0 10.0 > > > quantile(1:10) > 0% 25% 50% 75% 100% > 1.00 3.25 5.50 7.75 10.00 > > Actually, I expected the value 3 for 25% and 8 for 75% as results of > quantile(1:10). Can you please explain me why it isn't so.The two ``hinges'' in boxplots are defined differently. They are versions of the first and third quartile, but they are identical only for odd n. This is explained in help(boxplot.stats) Details: The two ``hinges'' are versions of the first first and third quartile, i.e. close to `quantile(x, c(1,3)/4)'. The hinges equal the quartiles for odd n (where `n <- length(x)') and differ for even n. Where the quartiles only equal observations for `n %% 4 = 1' (n = 1 mod 4), the hinges do so additionally for `n %% 4 == 2' (n = 2 mod 4), and are in the middle of two observations otherwise.> Regards, > Vlad > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
I think this is already explained well enough in the help page for boxplot.stats. Andy __________________________________ Andy Jaworski Engineering Systems Technology Center 3M Center, 518-1-01 St. Paul, MN 55144-1000 ----- E-mail: apjaworski at mmm.com Tel: (651) 733-6092 Fax: (651) 736-3122 "Vladimir N. Kutinsky" To: r-help at stat.math.ethz.ch <kutinskyv at obni cc: (bcc: Andrzej P. Jaworski/US-Corporate/3M/US) nsk.com> Subject: [R] quantile() and boxplot.stats() 05/14/2002 12:32 Hello, I faced something I can't understand. When I use boxplot.stats(1:10) and quantiles(1:10) the results are different for 25% and 75%:> boxplot.stats(1:10)$stats [1] 1.0 3.0 5.5 8.0 10.0> quantile(1:10)0% 25% 50% 75% 100% 1.00 3.25 5.50 7.75 10.00 Actually, I expected the value 3 for 25% and 8 for 75% as results of quantile(1:10). Can you please explain me why it isn't so. Regards, Vlad -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. -.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._. _._._ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._