使用 modelsummary() 'shape' 参数作为已弃用的 modelsummary_wide() 的替代方案

Using modelsummary() 'shape' argument as alternative to deprecated modelsummary_wide()

提问人:Reuben Long 提问时间:4/15/2023 更新时间:4/15/2023 访问量:88

问:

我正在使用 nnet 运行多项式 logit 模型,然后想在模型汇总表中显示结果,并将因子水平作为列:

library("nnet")

multi <- multinom(DV ~ var1, data = wave1)

alpha <- summary(multi)$coefficients / summary(multi)$standard.errors
abs(alpha)
# Calculate p values by hand
p_values <- (1 - pnorm(abs(alpha))) * 2
p_values

library("modelsummary")
modelsummary_wide(multi, output = "gt", stars = TRUE)

以前我使用 modelsummary_wide() 执行此操作,但现在显然已弃用,我应该使用 modelsummary() 中的 shape 参数。

但是,我真的不知道该怎么做。有人可以给我一些提示吗?

谢谢

R NNET 模型摘要

评论

1赞 Vincent 4/15/2023
网站上有几个例子,包括一些具有这种模型的例子:vincentarelbundock.github.io/modelsummary/articles/......nnet::multinom
0赞 Reuben Long 4/15/2023
啊,谢谢!我没见过

答:

1赞 Reuben Long 4/15/2023 #1

回答者 @Vincent

使用此安排:

modelsummary(multi, stars = T, shape = model + term ~ response)