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 を返します