qoiqpwqr 发表于 2012-11-22 09:37 
qchisq

呵呵,如下是对的。谢谢您的极富价值的帮助!
而在此0.05置信水平下的统计量应该为:
qchisq(0.05, df=22, lower.tail=F)
等于 33.92444那么pchisq(33.92444, df=22, lower.tail=F)就等于0.05
假设统计量为223.3583,服从自由度为22的chi-square分布,则计算的p-value就应该等于
p1 <- pchisq(223.3538, df=22, lower.tail=FALSE)
p1等于 2.880972e-35
则qchisq(p1, df=22, lower.tail=FALSE)等于223.3583