1

I'm estimating a fixed-effects logit model using the bife package in R. I need to estimate the marginal effects of the estimation and export them to latex. However, the package that supports bife estimation, texreg, doesn't allow to export objects of class "bifeAPEs". Is there any solution to this?

Here's a reproducible example:

#Require packages
packages<-c("bife", "texreg")
lapply(packages, require, character.only = TRUE)

#Dataset
data("iris")
iris$big <- ifelse(iris$Sepal.Length > median(iris$Sepal.Length),1,0)

#Model
output <- bife(big ~ Sepal.Width + Petal.Length | Species, data=iris, "logit")

#Output
apes_stat <- get_APEs(output)
class(apes_stat)
extract(output)
extract(apes_stat)
  • Hi there. See also [my answer here](https://stackoverflow.com/questions/38894044/print-pretty-tables-for-h2o-models-in-r/39135080#39135080) regarding how to write new extensions for `texreg` and [the code for the existing `bife` extension](https://github.com/leifeld/texreg/blob/92e393131f5d6c0f75fbfc3934567d36032e626a/R/extract.R#L464). Together, this should allow you to change the code to make it work with those model objects. (I would do it but am a bit pressed for time atm.) – Philip Leifeld Aug 07 '21 at 17:31

1 Answers1

0

Maybe what you can do is create a data.frame of the average partial effects and then convert that data.frame into a latex table using xtable, like below:-

ape_data <- data.frame(APES = attr(apes_stat$delta, "names"),
                       delta = unname(apes_stat$delta))
xtab_ape <- xtable::xtable(ape_data)
xtab_ape

If you don't want rownames to be printed in latex, then you can add the following command:-

print(xtab_ape, include.rownames = FALSE)
Shawn Brar
  • 1,346
  • 3
  • 17