1

I ran an binomial logit model while controlling for bank- and time-fixed effects by using the feglm() function from the fixest package. However this function saves the regression output as a list. Unfortunately Stargazer doesn't seem to recognize this. Can anyone help me with this?

This is the regression I ran:

BinomialLogitModelWinsorizedLag <- feglm(CoCoIssuance ~ log(TotalAssetsLagged) + DepositsOverAssetsLagged + T1RatioLagged + AssetGrowthLagged + EquityOverAssetsLagged + CashOverAssetsLagged + CET1RatioLagged + DividendsOverEquityLagged + PriceOverBookLagged + ROALagged + LoansOverAssetsLagged | IssuerName + YearOfIssuance, data = WinsorizedDataLagged , family = binomial("logit") )

I tried extracting the estimated coefficients and standard errors from this list and save it as a data frame. However when I do this, Stargazer gives me the descriptive statistics and not the regression output table that I want.

# extract coefficients and standard errors
coef_tableLogitLag <- BinomialLogitModelWinsorizedLag$coeftable

stargazer(coef_tableLogitLag, type = "text")
user438383
  • 5,716
  • 8
  • 28
  • 43
MathisVS
  • 13
  • 2
  • what do you mean by `regression output table` ?? – Manoj Kumar Apr 27 '23 at 15:06
  • 1
    [‘stargazer’ is a terrible package](https://www.reddit.com/r/rstats/comments/6o9v9h/comment/dkgw9q1/). I strongly recommend against using it. Use *anything* else instead, e.g. ‘[modelsummary](https://vincentarelbundock.github.io/modelsummary/)’ or ‘[texreg](https://cran.r-project.org/web/packages/texreg/index.html)’. – Konrad Rudolph Apr 27 '23 at 16:48
  • agree wiht you... `texreg` is better... @KonradRudolph – Manoj Kumar Apr 27 '23 at 17:42

1 Answers1

0

I am not sure about stargazer, why it is not producing the result what you wanted, I would suggest you to try out texreg package instead.

Below code work fine for me:

library(fixest)
library(texreg)

# Fit a binomial logit model with bank- and time-fixed effects
model1 <- feglm(am ~ mpg + cyl + hp | factor(vs) + factor(gear), 
               data = mtcars, family = binomial("logit"))


htmlreg(model1, file = "texreg.html", 
        inline.css = FALSE, doctype = TRUE, html.tag = TRUE, 
        head.tag = TRUE, body.tag = TRUE)

This produces the result as:

enter image description here

Or for the models:

# Fit a binomial logit model 
model1 <- feglm(am ~ mpg + cyl + hp | factor(vs) + factor(gear), 
               data = mtcars, family = binomial("logit"))

model2 <- feglm(am ~ mpg + cyl + hp + factor(vs) + factor(gear), 
               data = mtcars, family = binomial("logit"))

The code below:

htmlreg(list(model1, model2), file = "texreg2.html", 
        inline.css = FALSE, doctype = TRUE, html.tag = TRUE, 
        head.tag = TRUE, body.tag = TRUE)

Produces:

enter image description here

Manoj Kumar
  • 5,273
  • 1
  • 26
  • 33