Is there a way to convert the HTML tab_model object into an R object, like a data.frame or tibble?
Please let me know if/when you can. Thanks.
Here is the code I used to create the tab_model object:
# Loads packages
# ---- NOTE: making plots and diamonds dataset
if(!require(ggplot2)){install.packages("ggplot2")}
# ---- NOTE: run mixed effects models
if(!require(lme4)){install.packages("lme4")}
# ---- NOTE: for data wrangling
if(!require(dplyr)){install.packages("dplyr")}
# ---- NOTE: for sjPlot command
if(!require(sjPlot)){install.packages("sjPlot")}
# dataset creation
## for dataset with top 300 rows
# ---- NOTE: selects only the top 300 rows of the dataset
diamonds_top300 <- data.frame(dplyr::top_n(ggplot2::diamonds, 300, y))
# ---- NOTE: gives dataset info
head(diamonds_top300)
str(diamonds_top300)
colnames(diamonds_top300)
nrow(diamonds_top300)
# model creation
## DV price for diamonds_top300, using poisson family
(
mlm_top300_poisson_price <-
lme4::glmer(
price ~ cut + color + carat + (1 | clarity) + (1 | depth),
data = diamonds_top300,
family = poisson()
)
)
# creates tab_model object
## tab_model of mlm_top300_poisson_price
tab_model_mlm_top300_poisson_price <-
sjPlot::tab_model(mlm_top300_poisson_price)