【发布时间】:2022-01-12 13:12:01
【问题描述】:
我正在尝试导出使用broom 和map 创建的嵌套回归的回归输出。
例如:
library(tidyverse)
library(broom)
year <- rep(2014:2015, length.out=10000)
group <- sample(c(0,1,2,3,4,5,6), replace=TRUE, size=10000)
female <- sample(c(0,1), replace=TRUE, size=10000)
smoker <- sample(c(0,1), replace=TRUE, size=10000)
dta <- tibble(year = year, group = group, female = female, smoker = smoker)
mods <- dta %>%
nest(data = c(-year)) %>%
mutate(model = map(data, ~ glm(smoker ~ female*group, data = .,
family = binomial(link = "probit"))))
## export mods
## upload mods
- 如何保存模组?
- 保存后,如何将其加载到全局环境中?
【问题讨论】: