【问题标题】:R: APA regression tables with mipo/mice objectsR:带有 mipo/mice 对象的 APA 回归表
【发布时间】:2022-01-20 01:38:23
【问题描述】:

我曾经使用sjPlot 创建直接导出为docx 的APA 样式回归表。不幸的是,基于估算数据(mipo 对象)的模型目前与tab_model 不兼容。

我正在寻找一个类似于 tab_model 的函数,它可以将 APA 样式的回归表直接导出到单个块中的 Word 文档中,而无需编织。我发现的大多数包(例如,stargazer)似乎都需要编织来创建表格。或者,如果有人知道让mipo 对象与tab_model 一起工作的解决方法,我将不胜感激。

library(tidyverse)
library(sjPlot)
library(mice)
set.seed(123)

# error
data(nhanes)
imp <- mice(nhanes, m=3, print=FALSE)
with(imp, lm(age ~ bmi + chl)) %>% 
  pool() %>% 
  tab_model(.,
            file = "table.doc")
#> Error in fam.info$is_linear || identical(fam.info$link_function, "identity"): invalid 'x' type in 'x || y'

【问题讨论】:

    标签: r dplyr regression r-mice sjplot


    【解决方案1】:

    mice 依赖于 pool() 函数中的 broom::tidy()broom::glance()。所以我认为解决方案可以在tab_model()与扫帚对象的组合中找到,比如这里:https://github.com/strengejacke/sjPlot/issues/385

    【讨论】:

      猜你喜欢
      • 2022-01-16
      • 2012-10-30
      • 2022-01-26
      • 2021-09-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-28
      • 2020-03-28
      相关资源
      最近更新 更多