Questions tagged [modelsummary]

modelsummary is an R package including a powerful set of utilities to customize the information in regression models

modelsummary includes a powerful set of utilities to customize the information displayed in your model summary tables. You can easily rename, reorder, subset or omit parameter estimates; choose the set of goodness-of-fit statistics to display; display various “robust” standard errors or confidence intervals; add titles, footnotes, or source notes; insert stars or custom characters to indicate levels of statistical significance; or add rows with supplemental information about your models.

130 questions
2
votes
1 answer

How to add a q value (adjusted p-value) to a modelsummary table after pooling the results of a multinomial model over multiple imputed datasets

I am using modelsummary to display the results of several multinomial models, each pooled over 5 datasets using the mice::pool function. It works great, but I want to add the q-value / adjusted p-value for false discovery rate. I understand I need…
Alex
  • 31
  • 2
1
vote
1 answer

Loop regression models and combine them in modelsummary (R)

I have regression models (OLS/IV ivreg) which I use on different datasets and different outcomes. I use a loop to change the outcome variable, run some models and store results with modelsummary in separate .html files. I wonder how I could combine…
Marco
  • 2,368
  • 6
  • 22
  • 48
1
vote
2 answers

Skip a model in a modelsummary table

I am trying to print a three-panel table of 3 regression models, in which instead of one of the results (the middle regression for the middle panel) it should be "NA" or "--". For example, I can run: library(modelsummary) y <- rnorm(5) models <-…
1
vote
2 answers

Rename the add_columns columns in modelsummary and add multiple columns

Suppose I have a table summarizing regressions using the modelsummary package such as the following: library(fixest) library(modelsummary) reg1 <- feols(hp ~ vs + am + qsec | carb, data = mtcars) reg2 <- feols(wt ~ vs + am + qsec | carb, data =…
flâneur
  • 633
  • 2
  • 8
1
vote
1 answer

Extract the number of groups of a model when using modelsummary

I am using the modelsummary package to create a table for a multilevel logistic regression model estimated via glmer from the lme4 package. I would know like to include the number of groups in my table. The information does not appear in…
flxflks
  • 498
  • 2
  • 13
1
vote
2 answers

Is ther a way in R and modelsummary to stack a comparisons table produced by marginal effects

I ran several linear regressions and obtained comparisons from the avg_comparisons function of the marginaleffects package and then form it with the shape = term : contrast ~ model option parameters of the modelsummary package to concatenate the…
econgr
  • 129
  • 5
1
vote
2 answers

Logistic regression results with and without odds ratio in modelsummary

I like to show logistic regression with and without exponentiated coefficients side by side with the modelsummary package. The package produces great html output. It comes with an easy option to turn exponentiate = TRUE on/off. But the option…
Marco
  • 2,368
  • 6
  • 22
  • 48
1
vote
1 answer

How to get weak instrument test from instrument variables in modelsummary in R?

How can I get the weak instrument F-test statistic in modelsummary? data(mtcars) library(ivreg) iv_model <- ivreg(mpg ~ qsec + cyl + drat | disp | wt, data = mtcars) summary(iv_model, diagnostics = TRUE) Call: ivreg(formula = mpg ~ qsec + cyl +…
Marco
  • 2,368
  • 6
  • 22
  • 48
1
vote
0 answers

modelsummary output to LaTeX with automatic column width and line breaks

I estimate a model with estimatr::lm_robust and display the model output with modelsummary::modelsummary. Consider the following example: df <- tibble(x=runif(100, 0, 100)) %>% mutate(y=x*(2+runif(100, 0, 10)), z=rep(c(1:10), 10)) tab <-…
Ivo
  • 3,890
  • 5
  • 22
  • 53
1
vote
1 answer

Fixed effect counts in modelsummary

I have a modelsummary of three fixed effects regressions like so: remotes::install_github("lrberge/fixest") remotes::install_github("vincentarelbundock/modelsummary") library(fixest) library(modelsummary) mod1 <- feols(mpg ~ hp | cyl, data =…
RoyalTS
  • 9,545
  • 12
  • 60
  • 101
1
vote
1 answer

Fixest and Standardized Coefficients from Easystats in R

I was wondering what would be the best way to calculate and present standardized coefficients using fixest. Here is what I tried using easystats library(parameters) library(effectsize) library(fixest) m <- lm(rating ~ complaints, data =…
1
vote
0 answers

Data summary table not showing p-value

I have a data set that looks somewhat like this: occup <- sample(c("working","housewife"), 100, replace = TRUE) # wife's occupation age <- sample(20:60, 100, replace = TRUE) # wife's age educ <- sample(0:15, 100, replace = TRUE) # wife's years of…
Saïd Maanan
  • 511
  • 4
  • 14
1
vote
1 answer

modelsummary and multiple comparisons from marginaleffects

dat <- mtcars dat$cyl <- as.factor(dat$cyl) dat$am <- as.logical(dat$am) dat$carb <- as.factor(dat$carb) mod <- lm(mpg ~ hp + cyl + am+carb, data = dat) mm_dat <- marginaleffects::comparisons(mod,variables = list(carb="pairwise"), …
Misha
  • 3,114
  • 8
  • 39
  • 60
1
vote
1 answer

Table of models with standardized coefficient size shown using color and size

I'm trying to produce a table of multiple models with standardized coefficients color-coded and sized based on the coefficient size. I'll be doing this with dozens of models and it seems using color and size would be a way to show patterns across…
tci
  • 69
  • 7
1
vote
1 answer

R modelsummary output: robust standard errors from coxph model

Im running a series of coxph models in R and compiling the output into latex tables using the modelsummary package and command. The coxph provides SE and robust se as outputs and the p-value is based on the robust se. Here is a quick example to…
dmort
  • 181
  • 1
  • 11
1
2
3
8 9