[問題] 關於pchisqsum 做 power simulation
各位大神前輩大家好
目前在做統計分析,因為統計模型類似SKAT,
因此使用 'survey'這個packages下的 pchisqsum
進行p-value的運算,則以下是 survey 的 manual 下的例子,
x <- 2.7*rnorm(1001)^2+rnorm(1001)^2+0.3*rnorm(1001)^2
x.thin<-sort(x)[1+(0:100)*10]
p.invert<-pchisqsum(x.thin,df=c(1,1,1),a=c(2.7,1,.3),method="int"
,lower=FALSE)
p.satt<-pchisqsum(x.thin,df=c(1,1,1),a=c(2.7,1,.3),method="satt",lower=FALSE)
p.sadd<-pchisqsum(x.thin,df=c(1,1,1),a=c(2.7,1,.3),method="sad",lower=FALSE)
plot(p.invert, p.satt,type="l",log="xy")
abline(0,1,lty=2,col="purple")
plot(p.invert, p.sadd,type="l",log="xy")
abline(0,1,lty=2,col="purple")
pchisqsum(20, df=c(1,1,1),a=c(2.7,1,.3), lower.tail=FALSE,method="sad")
如果只是一般的 pchisq 這個function,就有相關套件可以進行power simulation,
因此想請問各位大大pchisqsum 該如何運算 power,
非常謝謝!!
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.164.85.121
※ 文章網址: https://www.ptt.cc/bbs/R_Language/M.1470242016.A.77A.html
R_Language 近期熱門文章
PTT數位生活區 即時熱門文章