如何在glm Tweedie回归模型中使用emmeans?

时间:2018-10-20 04:10:07

标签: r glm emmeans

我与家人glm调整了Tweedie。现在,我需要获得调整后的均值和标准误。到目前为止:

mtcars$am <- as.factor(mtcars$am)
m1 <- glm(hp ~ am, data = mtcars,
          family = statmod::tweedie(var.power = 2.2, 
                                    link.power = 0 #link log
                                    ))
summary(emmeans(m1, "am"), type = "response")

 am response      SE  df asymp.LCL asymp.UCL
 0    5.0768 0.11516 Inf    4.8511    5.3025
 1    4.8430 0.13600 Inf    4.5764    5.1095

Unknown transformation "mu^0": no transformation done 
Confidence level used: 0.95 

如何通知我使用了链接log()?如何处理:“未知转换” mu ^ 0“:未完成转换”?

1 个答案:

答案 0 :(得分:1)

执行以下操作:

emm <- update(emmeans(m1, "am"), tran = "log")
summary(emm, type = "response")

有关详细信息,请参见变换中的插图。