我想从 Pr(>|t|) 列中提取值
library(lsmeans)
warp.lm = lm(breaks ~ wool * tension, data = warpbreaks)
toP<-lsmeans(warp.lm, pairwise ~ wool | tension, glhargs=list())
toP[[2]]
Simultaneous Tests for General Linear Hypotheses
Fit: lm(formula = breaks ~ wool * tension, data = warpbreaks)
Linear Hypotheses:
Estimate Std. Error t value Pr(>|t|)
A - B | L == 0 16.333 5.157 3.167 0.00797 **
A - B | M == 0 -4.778 5.157 -0.926 0.73187
A - B | H == 0 5.778 5.157 1.120 0.60282
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Adjusted p values reported -- single-step method)
这该怎么做?class(toP[[2]])
说吧"summary.glht" "glht"
。toP[[2]][9] 中有 $pvalues 但 toP[[2]][9]$pvalues 给出 NULL