Using modelsummary() 'shape' argument as alternative to deprecated modelsummary_wide()

177 views Asked by At

I'm running a multinomial logit model using nnet, and then want to display the results, with the factor levels as columns, in a modelsummary table:

library("nnet")

multi <- multinom(DV ~ var1, data = wave1)

alpha <- summary(multi)$coefficients / summary(multi)$standard.errors
abs(alpha)
# Calculate p values by hand
p_values <- (1 - pnorm(abs(alpha))) * 2
p_values

library("modelsummary")
modelsummary_wide(multi, output = "gt", stars = TRUE)

Previously I did this using modelsummary_wide(), but this is now apparently deprecated and I should use the shape argument in modelsummary().

However, I can't really figure out how to do this. Could someone offer me some tips on this?

Thanks

1

There are 1 answers

0
Reuben Long On

Answered by @Vincent

Using this arrangement:

modelsummary(multi, stars = T, shape = model + term ~ response)