I am wondering if you know how to return by function or show in boxplot,
the indexes of unusual points, such as,
points that are outside the box or in [Q3+1.5IQR,Max].
For example,
boxplot(c(4,rnorm(20),8))
There are 2 unusual points 4 and 8. How to show the indexes of 4 and 8 in
the boxplot
or
Try this:
bp - boxplot(c(4,rnorm(20),8))
bp$out
On Wed, Sep 9, 2009 at 4:25 PM, g...@ucalgary.ca wrote:
I am wondering if you know how to return by function or show in boxplot,
the indexes of unusual points, such as,
points that are outside the box or in [Q3+1.5IQR,Max].
For example,
boxplot returns a dataframe that has the values in it at $out:
x - boxplot(c(4,rnorm(20),8))
x
$stats
[,1]
[1,] -1.5364498
[2,] -0.5282799
[3,] -0.1398736
[4,] 0.3065579
[5,] 1.3430388
$n
[1] 22
$conf
[,1]
[1,] -0.4210947
[2,] 0.1413474
$out
[1] 4 8
$group
[1] 1 1
Thank you very much.
But it seems that
x$out returns the values not the indexes of the values (1,22).
-james
boxplot returns a dataframe that has the values in it at $out:
x - boxplot(c(4,rnorm(20),8))
x
$stats
[,1]
[1,] -1.5364498
[2,] -0.5282799
[3,] -0.1398736
[4,]
use 'match' to get the indices;
match(x$out, yourData)
On Wed, Sep 9, 2009 at 4:07 PM, g...@ucalgary.ca wrote:
Thank you very much.
But it seems that
x$out returns the values not the indexes of the values (1,22).
-james
boxplot returns a dataframe that has the values in it at $out:
x -
Hi James,
If that's the case, then
set.seed(123)
x - c(4,rnorm(20),8)
bp - boxplot(x)
bp$out
# [1] 4 8
which(x %in% bp$out)
# [1] 1 22
is what you are looking for. :-)
HTH,
Jorge
On Wed, Sep 9, 2009 at 4:07 PM, g...@ucalgary.ca wrote:
Thank you very much.
But it seems that
x$out returns
Thanks for your help.
-jmaes
Hi James,
If that's the case, then
set.seed(123)
x - c(4,rnorm(20),8)
bp - boxplot(x)
bp$out
# [1] 4 8
which(x %in% bp$out)
# [1] 1 22
is what you are looking for. :-)
HTH,
Jorge
On Wed, Sep 9, 2009 at 4:07 PM, g...@ucalgary.ca wrote:
Thank you
7 matches
Mail list logo