Questions tagged [fixest]
86 questions
7
votes
3 answers
Is there anyway to export feols model using stargazer in R?
I ran a bunch of models using feols model (fixest package), but I have trouble exporting my model into a table using stargazer. Any suggestions on how I can do that?
It does seem like I can use etable function, but I want to use stargazer because I…

Dr. Yutam
- 89
- 1
- 2
4
votes
1 answer
How to Plot the "time" effects results from PLM/ Fixest?
I am running a fixed effects model with a continuous variable (say parental wealth) on another continuous variable (children's wealth). I have a few control variables as well.
I want to plot the relationship between X and Y, over "Time". Is it…

NanoBot
- 837
- 1
- 7
- 10
3
votes
1 answer
How to update a formula object containing a pipe ("|")
Some packages such as fixest use the pipe to separate explanatory variables from fixed effects in formulas. How can I use update() to modify each of those parts? In the example below, I would like to remove z from the right-hand side but keep the…

dufei
- 2,166
- 1
- 7
- 18
3
votes
2 answers
Compute and display mean of dependent variable in modelsummary output tables in R
I am using the feols command from the fixest package in R to estimate fixed effect regressions, in most cases with weights. In order to output my results, I am mainly using the modelsummary command from the modelsummary package. I have figured out…

artur
- 33
- 5
2
votes
1 answer
Predict out of sample on fixed effects model with fixest
Is there a way to make predictions from a fixest model on an observation that has an out-of-sample fixed effects level? I would like this prediction to be based on the weighted mean of the existing fixed effects levels in the training data. For the…

dufei
- 2,166
- 1
- 7
- 18
2
votes
3 answers
Why does update method does not work when estimation is wrapped in function?
Apparently the update() method cannot retrieve the dataset the estimation was based on if I wrap the estimation function in another function. Is there any way around this, e.g., by specifying an environment?
library(fixest)
data(trade)
# fit model…

dufei
- 2,166
- 1
- 7
- 18
2
votes
0 answers
How to include output from etable() of fixest package as latex regression table into markdown as html output?
I would like to include the regression output from etable(feols(fml = formula, data = data, cluster = ~cluster)) as latex regression table into an rmarkdown creating an html output.
My regression function at the moment is this one:
regression <-…

tiny
- 129
- 6
2
votes
0 answers
Error in exporting fixed effects feols model with texreg
I am trying to export fixed effects model estimated with fixest using texreg. It yields an error:
> library(fixest)
> library(texreg)
>
> race <- sample(c(0,1), replace=TRUE, size=100)
> sex <- sample(c(0,1), replace=TRUE, size=100)
> stranger <-…

Alex Knorre
- 620
- 4
- 15
2
votes
1 answer
Does purrr::map change an object type?
I've noticed something very strange while doing some regression analysis. Essentially, when I estimate a regression independently and that same regression within a purrr::map function and extract the element, I get that these two objects are not…

mikeytop
- 150
- 9
2
votes
2 answers
How can I use a for loop to run regression?
My current dataset looks like:
N = 10000
wage <- rnorm(N)
educ <- rnorm(N)
age <- rnorm(N)
tce <- rnorm(N)
work <- rbinom(n = N, size = 1, prob = 0.05)
manu <- rbinom(n = N, size = 1, prob = 0.05)
id <- sample(10, N, replace = TRUE)
df <-…

anrisakaki96
- 193
- 8
2
votes
1 answer
Mapping broom::tidy to nested list of {fixest} models and keep name of list element
I want to apply broom::tidy() to models nested in a fixest_multi object and extract the names of each list level as data frame columns. Here's an example of what I mean.
library(fixest)
library(tidyverse)
library(broom)
multiple_est <-…

Felix
- 1,611
- 13
- 22
2
votes
3 answers
Extract degrees of freedom from a fixest feols object
simple question:
Can I extract the final degrees of freedom after a feols estimation using the fixest package?
res = feols(Sepal.Length ~ Sepal.Width + Petal.Length | Species, iris)
summary(res)
I know that there are many fancy ways to specify the…

Moritz Schwarz
- 2,019
- 2
- 15
- 33
1
vote
1 answer
How does marginaleffects compute groupwise predictions in the presence of fixed effects?
I want to compute predictions for a fixed effects ols regression by group with the marginaleffects package. When I generate new data for the prediction and do not specify the specific level of the fixed effects variables that I want the prediction…

dameili
- 35
- 3
1
vote
0 answers
Having a problem to install fixest packages
Currently I am estimating IV regresssion with panel data. I thought, fixest packages is the good fit for the analysis. After it is showing some warning when I installed, I can't recall the library.
The error is
library(fixest)
Error: package or…

Ankhbayar.S
- 11
- 2
1
vote
1 answer
etable() to word output
I'm trying to export etable() output to word but it seems like it only outputs to latex, any tips?
library(fixest)
lms<-feols(mpg~csw0(cyl,disp,hp),mtcars)
etable(lms)

EconMatt
- 339
- 2
- 7