vincentarelbundock / modelsummary

Beautiful and customizable model summaries in R.
http://modelsummary.com
Other
912 stars 76 forks source link

shape "rbind" and shape = term + response ~ statistic at the same time #815

Open daSilva5 opened 3 weeks ago

daSilva5 commented 3 weeks ago

Hi, I would like some help. I would like to know if it is somehow possible to use shape="rbind" and at the same time have the model stats on the wide format, such as while using shape = term + response ~ statistic at the same time.

Thanks

vincentarelbundock commented 3 weeks ago

No. But you can create two tables and use rbind(tab1, tab2)

daSilva5 commented 3 weeks ago

ooh I see!!!

Thanks!

daSilva5 commented 3 weeks ago

It does not seems to work. I get the following error: Error in .local(x, ...) : unused arguments (i = NULL, j = list(2:6, 7:11), indent = 1, ihead = -1)

Using a modified example:

models <- list() models[['OLS']] <- lm(mpg ~ factor(cyl), mtcars) models[['Logit']] <- glm(am ~ factor(cyl), mtcars, family = binomial)

models2 <- list() models2[['OLS']] <- lm(mpg ~ factor(cyl), mtcars) models2[['Logit']] <- glm(am ~ factor(cyl), mtcars, family = binomial)

tabmod1<-modelsummary(models, shape = term ~model+ statistic, statistic=c(c("conf.int", "std.error", "p.value")))

tabmod2<-modelsummary(models2, shape = term ~model+ statistic, statistic=c(c("conf.int", "std.error", "p.value")))

rbind(tabmod1,tabmod2)