1

我试图在 aglm与二项式 dv 之后进行成对比较,并emmeans报告优势比,而我需要概率差异。

library(magrittr)
library(emmeans)

glm(
  am ~  wt * factor(vs), 
  family = binomial(),
  data = mtcars
) %>% 
  emmeans(
~ vs | wt, at = list(wt = seq(2.6, 3.6, length.out = 10))
  ) %>% 
  pairs(type = "response")

返回

wt = 2.6:
 contrast odds.ratio         SE  df z.ratio p.value
 0 / 1     668.84887 3388.29452 Inf   1.284  0.1991

wt = 2.71111111111111:
 contrast odds.ratio         SE  df z.ratio p.value
 0 / 1     453.70452 2028.70137 Inf   1.368  0.1713
4

1 回答 1

3

Add %>% regrid() before pairs(). The regrid() call back-transforms all the results to a new set of EMMs as if there had never been a transformation.

See the vignette on transformations.

于 2018-05-12T12:52:29.440 回答