vincentarelbundock / modelsummary

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

Missing GoF Names #142

Closed volkovacodes closed 4 years ago

volkovacodes commented 4 years ago

Thank you for the awesome package!

I am following you example but most GoF names are missing in the output. The names are coded as 3/4/5/6 instead of R2, Adj.R2 etc

library(modelsummary)

url <- 'https://vincentarelbundock.github.io/Rdatasets/csv/HistData/Guerry.csv'
dat <- read.csv(url)

models <- list()
models[['OLS 1']] <- lm(Donations ~ Literacy + Clergy, data = dat)
models[['Poisson 1']] <- glm(Donations ~ Literacy + Commerce, family = poisson, data = dat)
models[['OLS 2']] <- lm(Crime_pers ~ Literacy + Clergy, data = dat)
models[['Poisson 2']] <- glm(Crime_pers ~ Literacy + Commerce, family = poisson, data = dat)
models[['OLS 3']] <- lm(Crime_prop ~ Literacy + Clergy, data = dat)

modelsummary(models)
Screen Shot 2020-09-29 at 21 21 04
vincentarelbundock commented 4 years ago

Thanks for the report!

Unfortunately, I can't replicate it on my computer. When I paste your code, I get the correct names for the GOF statistics.

Would you mind updating the package (and its dependencies) and trying again?

install.packages(c("modelsummary", "dplyr", "tidyr", "kableExtra", "broom"))

Then, shut down R completely and start a fresh session. Finally,

library(modelsummary)

url <- 'https://vincentarelbundock.github.io/Rdatasets/csv/HistData/Guerry.csv'
dat <- read.csv(url)

models <- list()
models[['OLS 1']] <- lm(Donations ~ Literacy + Clergy, data = dat)
models[['Poisson 1']] <- glm(Donations ~ Literacy + Commerce, family = poisson, data = dat)
models[['OLS 2']] <- lm(Crime_pers ~ Literacy + Clergy, data = dat)
models[['Poisson 2']] <- glm(Crime_pers ~ Literacy + Commerce, family = poisson, data = dat)
models[['OLS 3']] <- lm(Crime_prop ~ Literacy + Clergy, data = dat)

modelsummary(models)

And if that doesn't work, please show me the output of this command:

sessionInfo()
volkovacodes commented 4 years ago

Good suggestion, updating packages did not help but updating R to 4.0.2 version fixed the issue!