gpt4 book ai didi

r - gsummary 中的似然比检验 p 值

转载 作者:行者123 更新时间:2023-12-05 06:00:42 25 4
gpt4 key购买 nike

如何将似然比检验 p 值合并到 gtsummary 输出表中?

library(gtsummary)

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

最佳答案

您可以使用 add_global_p(test = "LR") 添加 LRT 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")`

enter image description herereprex package 创建于 2021-05-12 (v2.0.0)

关于r - gsummary 中的似然比检验 p 值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67501997/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com