【发布时间】:2017-04-28 23:57:40
【问题描述】:
假设
data11 <- c(0.5388417, 0.7263466, 0.3612457, 0.2495263, 0.1780413)
data22 <- c(0.674262245, 0.659560230, 0.001548212, 0.501228052, 0.802885484)
d=as.data.frame(cbind(dat=c(data11,data22),level=c(rep(1,length(data11)),rep(2,length(data22)))))
然后,我使用函数 oneway_test 来获取 tje p-value
library(coin)
oneway_test(d$dat~as.factor(d$level))
我明白了:
Asymptotic Two-Sample Fisher-Pitman Permutation Test
data: d$dat by as.factor(d$level) (1, 2)
Z = -0.70257, p-value = 0.4823
alternative hypothesis: true mu is not equal to 0
但是,我怎样才能保存 P 值的值呢? .尝试这样做:d$p.value。没看懂
谢谢
【问题讨论】:
-
给 oneway_test 对象命名,例如
p <- oneway_test(d$dat~as.factor(d$level))。用pvalue(p)调出p值 -
只是一个提示,要访问 S4 对象的元素,请使用插槽运算符
@而不是美元运算符$。 -
@albert 嗨,如果有任何答案解决了您的问题,您可以点击“接受”以便其他人看到吗?谢谢