我想知道如何使用 modelsummary 来组合模型名称和 DV 名称,就像在 Stata 中的 outreg2 中一样?这是代表:
url <- 'https://vincentarelbundock.github.io/Rdatasets/csv/HistData/Guerry.csv'
dat <- read.csv(url)
models <- list(
"OLS 1" = lm(Donations ~ Literacy + Clergy, data = dat),
"Poisson 1" = glm(Donations ~ Literacy + Commerce, family = poisson, data = dat),
"OLS 2" = lm(Crime_pers ~ Literacy + Clergy, data = dat),
"Poisson 2" = glm(Crime_pers ~ Literacy + Commerce, family = poisson, data = dat),
"OLS 3" = lm(Crime_prop ~ Literacy + Clergy, data = dat)
)
modelsummary(models)
#N: DV names
modelsummary(dvnames(models), output = "flextable", estimate="{estimate}{stars}",
statistic = 'statistic', stars = c('*' = .1, '**' = .05, '***'=0.01))
#N: Model names
modelsummary(models, output = "flextable", estimate="{estimate}{stars}",
statistic = 'statistic', stars = c('*' = .1, '**' = .05, '***'=0.01))
以下是 DV 和型号名称组合表outreg2
在 Stata 中的外观:
任何信息或建议将不胜感激!