如何在 logistic svyglm() 中添加 p 值到 odds ratio?

huangapple go评论49阅读模式
英文:

How to add p-values to odds ratio with logistic svyglm()?

问题

我正在使用以下代码来获取我的svyglm模型的比值比和置信区间。

model <- svyglm(y ~ x + covariate,
                 design = survey_design,
                 family = quasibinomial(link = logit)) 

exp(cbind(OR = coef(model), confint(model)))

当我使用 summary 时,我会得到 p 值,但这会返回需要进行指数化的系数。如何将这些 p 值添加到比值比和置信区间表中?

英文:

I am using the code below to get odds ratios and confidence intervals for my svyglm model.

model &lt;- svyglm(y ~ x + covariate,
                 design = survey_design,
                 family = quasibinomial(link = logit)) 

exp(cbind(OR = coef(model), confint(model)))

I get the p-values when I use summary, however, this returns coefficients that then need to be exponentiated. How do I add these p-values to the odds ratio and confint table?

答案1

得分: 2

有一个用于 broom 包中的 svlglm 对象的整洁方法。

library(broom)
tidy(model, expo=TRUE, conf.int=TRUE)
英文:

There's a tidy method for svlglm objects in the broom package.

library(broom)
tidy(model, expo=TRUE, conf.int=TRUE)

huangapple
  • 本文由 发表于 2023年2月8日 08:47:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/75380402.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定