提取P-SIGN價值 - 測試 - 封裝BSDA我需要提取包BSDA從SIGN.test功能的p值:R中
> library(BSDA)
> x <- c(7.8, 6.6, 6.5, 7.4, 7.3, 7., 6.4, 7.1, 6.7, 7.6, 6.8)
> t1=SIGN.test(x,md=6.5)
One-sample Sign-Test
data: x
s = 9, p-value = 0.02148
alternative hypothesis: true median is not equal to 6.5
95 percent confidence interval:
6.571273 7.457455
sample estimates:
median of x
7
但我收到以下錯誤:
> t1$p.value
Error in t1$p.value : $ operator is invalid for atomic vectors
我也試過str(t1)
沒用。
> str(t1)
num [1:3, 1:3] 0.935 0.95 0.988 6.6 6.571 ...
- attr(*, "dimnames")=List of 2
..$ : chr [1:3] "Lower Achieved CI" "Interpolated CI" "Upper Achieved CI"
..$ : chr [1:3] "Conf.Level" "L.E.pt" "U.E.pt"
什麼'STR(T1)'的輸出? – Aaron
Aaron:我爲'str(t1)'添加了輸出。 – Stat
謝謝,這是意想不到的! – Aaron