2012-06-02 ROC curve, AUC の比較
異なる指標で判定された ROC curve とその AUC (area under a curve) を比較する方法。
R で pROC package の roc.test 関数にいくつかの検定法が実装してある。
roc.test のヘルプをまとめたもの↓
* paired or not-paired (auto-detection default) * paired: the same samples were measured using different measures * methods * DeLong test (default) * tests over AUC * basically for empirical ROC curve * paired test: DeLong et al. (1988) http://www.ncbi.nlm.nih.gov/pubmed/3203132 * unpaired test: unpaired t-test with unequal sample size and unequal variance (Welch t-test) * Bootstrap method (n=2000 default) * tests over AUC * supports partial ROC and smoothed ROC as well as empirical ROC * stratified or not stratified (stratified default) * stratified: same number of cases/controls in each resampling as in the original sample * statistic D: summation of difference between two observed AUCs over difference between two resampled AUCs * p-value: D is compared to the normal distribution * Venkatraman's test * tests over ROC curves * basically for empirical ROC curve * permutation of sample ranks * paired test: Venkatraman and Begg (1996) http://www.ncbi.nlm.nih.gov/pubmed/10900448 * unpaired test: Venkatraman (2000) http://www.ncbi.nlm.nih.gov/pubmed/11129471 * Specificity * tests if sensitivity of ROC curves are different at the level of given specificity * Bootstrap resampling is performed * Proposed by Pepe et al. (2009) http://www.ncbi.nlm.nih.gov/pubmed/20161343 * Sensitivity * tests if specificity of ROC curves are different at the level of given sensitivity * similar with specificity method * Alternative * two.sided (default), less, greater * For Venkatraman's test only two.sided is available
2012-02-26
Introduction to Computer-Intensive Methods of Data Analysis in Biology
この本を勉強中。
本では S-PLUS を使っているが、私は R で確認する。
生物学のための計算統計学 ?最尤法,ブートストラップ,無作為化法?
- 作者: Derek A. Roff,野間口眞太郎
- 出版社/メーカー: 共立出版
- 発売日: 2011/03/10
- メディア: 単行本
- クリック: 19回
- この商品を含むブログ (5件) を見る
Notebook 公開
更新ログ
2012/02/26 第2章 追加
ところで、タイトルで、原著では "Computer-Intensive method" の部分を「計算統計学」と訳しているのは正しいのか?
「計算機統計学」でないと意味がおかしいような気がした。
2012-02-19
R 関数の ...
R の関数のコードを見ると、 arguments のフリー記載を表す ... が書いてある。
例。
> getS3method("plot", "default") function (x, y = NULL, type = "p", xlim = NULL, ylim = NULL, log = "", main = NULL, sub = NULL, xlab = NULL, ylab = NULL, ann = par("ann"), axes = TRUE, frame.plot = axes, panel.first = NULL, panel.last = NULL, asp = NA, ...)
... にはどのような仕組みで引数が渡されて、関数の中で使用されるのか。ちょっと気になったのでテストしてみると、これ自体が object となっているらしいということに気がついた。
例えば自前の関数で
myPlot <- function (x, y, ...) { plot(x, y, ...) } x <- y <- 1 myPlot(x, y, pch=2, main="test")
と書くと、... に入れた argument が全て myPlot の中の plot に渡されるという仕様。
また ... をただ渡すだけでなく、もうちょっと操作したいならば、関数の中で
arg <- list(...)
とすると、argument の名前がリストの項目名に、値がその値として arg に渡すことができる。
では、... は . が3つでないといけないのか。
例えば、.... としたら?
だめそうなな気がしたけど一応試してみた。
myPlot2 <- function (x, y, ....) { plot(x, y, ....) } x <- y <- 1 myPlot2(x, y, pch=2, main="test")
これは、pch という argument が定義されていないという理由でエラーになった。つまり、関数中の ... は特別な意味をもつ。
そして、これは特別な名前なので、関数の外で ... に値を入れようとするとエラーになった。
ちなみに、普通はやらないはずだけど、 .... には値を入れることができた。
2012-02-09
いざというときのために。
ウォシュレットが使用中にいきなり狂って止まらなくなってしまった場合、自分がどいたらピューと飛び出て外が水浸しになるし、かといって自分が座り続けて蓋をしてるわけにはいかないという状況で、しばらく動けないまま、まずは固まる。
3分くらい、えーって思いながら困っていたら名案がうかんだ。
応急処置として一瞬で立ち上がって速攻トイレのフタを閉めようっと。
そうすれば、ウォシュレットが出続けようが、とりあえず外は水浸たしにならない。
そう思って速攻でフタを閉めてやった。
そしたら、ウォシュレットは止まった。
同じ状況で困った場合の参考までに。
フタを閉めれば狂ったウォシュレットも止まります。