臨床統計もおもしろいですよ、その3
- 161 :卵の名無しさん:2020/05/14(木) 10:03:25.31 ID:coRQ6//C.net
- あんまり相関係数の信頼区間など気にしていなかった。
必要ならmcmcかbootstrapすれば出せるし、
corr.testのソースを
sink('cor.text.txt')
stats:::cor.test.default
sink()
で覗いてみた。
if (n > 3) {
if (!missing(conf.level) && (length(conf.level) !=
1 || !is.finite(conf.level) || conf.level < 0 ||
conf.level > 1))
stop("'conf.level' must be a single number between 0 and 1")
conf.int <- TRUE
z <- atanh(r)
sigma <- 1/sqrt(n - 3)
cint <- switch(alternative, less = c(-Inf, z + sigma *
qnorm(conf.level)), greater = c(z - sigma * qnorm(conf.level),
Inf), two.sided = z + c(-1, 1) * sigma * qnorm((1 +
conf.level)/2))
cint <- tanh(cint)
FisherのZ変換して正規分布近似して信頼区間を出して、それをZ変換の逆関数で出しているな。
145 KB
新着レスの表示
掲示板に戻る
全部
前100
次100
最新50
read.cgi ver.24052200