【问题标题】:Likelihood ratio test pvalues in gtsummarygtsummary 中的似然比检验 p 值
【发布时间】:2021-05-12 10:39:52
【问题描述】:

如何在 gtsummary 输出表中加入似然比检验 p 值?

library(gtsummary)

    trial %>% 
      select(response, grade) %>% 
      tbl_uvregression(
        method = glm,
        y = response,
        method.args = list(family = binomial),
exponentiate = TRUE)

【问题讨论】:

    标签: r gtsummary


    【解决方案1】:

    您可以使用add_global_p(test = "LR") 添加轻轨 p 值。在后台,函数使用car::Anova(mod = x, type = "III", test = "LR")计算p值

    library(gtsummary)
    #> #BlackLivesMatter
    
    tbl <-
      trial %>% 
      select(response, grade) %>% 
      tbl_uvregression(
        method = glm,
        y = response,
        method.args = list(family = binomial)
      ) %>%
      add_global_p(test = "LR")
    
    #> add_global_p: Global p-values for variable(s) `add_global_p(include = "grade")`
    #> were calculated with
    #>   `car::Anova(mod = x$model_obj, type = "III", test = "LR")`
    

    reprex package (v2.0.0) 于 2021-05-12 创建

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-11-09
      • 1970-01-01
      • 2018-08-10
      • 1970-01-01
      • 1970-01-01
      • 2014-07-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多