I used the ggeffects package to calculate the marginal effects of two logistic models (one binary and another multinomial). I was wondering if there is a way to visualize or export this results in a table, similar to the tables presenting the coefficients of the variables in the models as is done by sjPlot and Stargazer.
Hi @gustavobrp,
The object returned from ggpredict()
is a list which contains a data.frame
of predictions. So you can pass this data frame into any function that generates tables for presenting results.
library(ggeffects)
mod <- lm(Sepal.Length ~ Sepal.Width, data = iris)
preds <- ggpredict(mod)
knitr::kable(preds$Sepal.Width)
stargazer::stargazer(preds$Sepal.Width)
reactable::reactable(preds$Sepal.Width)
Hope this helps.
1 Like
Hi @mattwarkentin, thanks a lot for the reply.
It helped a lot, because now I'm understanding better the objects created by ggpredict()
.
I was trying to summarize the results as is done by Stargazer and sjPlot. For example, in Stargazer, it is possible to substitute the coefficients by the odds ratio. I wanted to do something like this. I will continue to tweak to figure it out.
Thanks again!
1 Like
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.