Tips/エラーバー・信頼区間
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
*エラーバーや信頼区間をグラフに出力
元ネタ StatsRUs
http://gifi.stat.ucla.edu/R/doc/statsRus.html
5.9 Plot with error bars (11/08/2000 Paul Johnson <pauljohn@ukans.edu>)
x<-c(1,2,3,4,5)
y<-c(1.1, 2.3, 3.0, 3.9, 5.1)
ucl<-c(1.3, 2.4, 3.5, 4.1, 5.3)
lcl<-c(.9, 1.8, 2.7, 3.8, 5.0)
plot(x,y, ylim=range(c(lcl,ucl)))
arrows(x,ucl,x,lcl,length=.05,angle=90,code=3)
#or
segments(x,ucl,x,lcl)
ポイントはarrowsが使えるということ。
ちなみにlibrary(gregmisc) にある plotCI()という関数があります。
example(plotCI) を参照してください。
#ref(plotCI.png)
gregmiscにはbarplot2()もあります。
#ref(barplot2.png)
終了行:
*エラーバーや信頼区間をグラフに出力
元ネタ StatsRUs
http://gifi.stat.ucla.edu/R/doc/statsRus.html
5.9 Plot with error bars (11/08/2000 Paul Johnson <pauljohn@ukans.edu>)
x<-c(1,2,3,4,5)
y<-c(1.1, 2.3, 3.0, 3.9, 5.1)
ucl<-c(1.3, 2.4, 3.5, 4.1, 5.3)
lcl<-c(.9, 1.8, 2.7, 3.8, 5.0)
plot(x,y, ylim=range(c(lcl,ucl)))
arrows(x,ucl,x,lcl,length=.05,angle=90,code=3)
#or
segments(x,ucl,x,lcl)
ポイントはarrowsが使えるということ。
ちなみにlibrary(gregmisc) にある plotCI()という関数があります。
example(plotCI) を参照してください。
#ref(plotCI.png)
gregmiscにはbarplot2()もあります。
#ref(barplot2.png)
ページ名: