31

重複の可能性:
箱ひげ図の外れ値ルールを変更する

箱ひげ図を使用して結果を視覚化する必要があります。

x<-rnorm(10000)
boxplot(x,horizontal=TRUE,axes=FALSE)

視覚化中に外れ値をフィルタリングするにはどうすればよいですか?

(1)醜い外れ値がなくても、画面全体に画像を表示できるようにします。

http://postimage.org/image/szzbez0h1/a610666d/

(2)特定の範囲までの外れ値を表示する方法はありますか? http://postimage.org/image/np28oee0b/8251d102/

よろしく

4

1 に答える 1

57

?boxplot必要なすべてのヘルプを参照してください。

 outline: if ‘outline’ is not true, the outliers are not drawn (as
          points whereas S+ uses lines).

boxplot(x,horizontal=TRUE,axes=FALSE,outline=FALSE)

そして、ひげの範囲を拡張し、この範囲内の外れ値を抑制するために:

   range: this determines how far the plot whiskers extend out from the
          box.  If ‘range’ is positive, the whiskers extend to the most
          extreme data point which is no more than ‘range’ times the
          interquartile range from the box. A value of zero causes the
          whiskers to extend to the data extremes.

# change the value of range to change the whisker length
boxplot(x,horizontal=TRUE,axes=FALSE,range=2)
于 2013-01-08T03:37:19.123 に答える