Questions tagged [fixest]

86 questions
0
votes
0 answers

Handling error with regressions inside a parallel foreach loop

Hi I am having issues regarding a foreach loop where in every iteration I estimate a regression on a subset of the data with a different list of controls on several outcomes. The problem is that for some outcomes in some countries I only have…
0
votes
1 answer

Extract variance covariance matrix for specific variables from feols package

I am trying to extract the estimated variance-covariance matrix for specific variables after performing the Sun and Abraham’s estimator. Below is the regression model: lost = feols(y ~ X1+ X2 + X3 + X4 + sunab(g, year) | id + year, data = impact,…
Ing
  • 1
  • 1
0
votes
0 answers

Use fixest::etable to export sidesways table

I am estimating many models using the fixest package. I want to use etable to export these models into a sidewaystable in latex: does anyone knows how I can do it? Here is an example library(fixest) iris <- iris m1 <-…
Alex
  • 1,207
  • 9
  • 25
0
votes
0 answers

`modelsummary::msummary()` does not produce R2 after running `fixest::feols`

I found the same issue here: R2 for several fixed effects models using fixest::feols and modelsummary I followed the suggestion provided and it solved my problem on Windows. But this did not solve the problem on my Mac. In fact, after running the…
Anup
  • 239
  • 2
  • 11
0
votes
0 answers

Fixest package warning that estimation is void due to collinearity even though there isn't collinearity

A reproducible example dataframe looks like this: dur_exp_0204_p <- structure(list(hhid02 = c(823130649017, 823130649018, 823130649018, 823131407002, 823131407002, 823131407003, 823131407003, 823131407004, 823131407004, 823131407006, 823131407011,…
anrisakaki96
  • 193
  • 8
0
votes
0 answers

I'm getting this error in Rstudio when trying to install "fixest" package

I have to install the package "fixest" for an assignment and everytime I try to install it I get the following error. Error: package or namespace load failed for ‘fixest’: .onLoad failed in loadNamespace() for 'fixest', details: call:…
Debra
  • 1
0
votes
1 answer

What is ref in fixest's feols used for fixed-effect estimation?

I am going through an R example of using interaction terms in a fixed effect model. The example can be found here. The example uses the fixest package and uses the syntax var::fe(ref). I don't understand what ref is and what it does here. How do I…
Anup
  • 239
  • 2
  • 11
0
votes
1 answer

Removing Observations/Rows Dropped by Fixest (feols) from original data set

I have a large (millions of observations) dataset and I have used feols to run a linear model. That model has dropped many observations from consideration for missing values. I have recovered the row numbers that were dropped using $obs_selection,…
KLB
  • 57
  • 7
0
votes
0 answers

Why doesn't the fixest package on R include probit?

feglm(y ~ x + z, df, family = 'probit') This does not seem to work in R. This is odd. The fixest package is really great. But for two step regressions such as the Heckman in a panel context, would involve a first stage probit. It doesn't…
0
votes
1 answer

rpy2 in python with `R.feols(lnSO2 ~ tp, data = df) ` , I get the SyntaxError located on `~`

I am a student in Economics with little experience in R. I am trying to use python to call fixest::feols. But get some error, can anyone do me a favor? Here is the code of my project, which is a basic DID model. By the way, this is my first time to…
0
votes
0 answers

2SLS / instrumental variables regression with fixest::feols but with control variables only in the second stage

I want to run a two stages least squares/instrumental variables regression with a second stage that includes controls not included in the first stage. When I run: library(fixest) library(modelsummary) modelsummary(summary(feols(mpg ~ 1 + csw0(cyl,…
Anton
  • 254
  • 1
  • 9
0
votes
2 answers

Delta method for fixed effects regression using feols function

I have the following regression in R using the 'fixest' package. Yields are a function of N, N^2, P, K and S with producer by year fixed effects. yield<- feols(yield ~ N + N_square + P + K + S |producer*year, data=data, se="hetero") I need to use…
Erin
  • 37
  • 4
0
votes
0 answers

time trends vs year fixed effects: is peaceful coexistence possible?

How can I deal with collinearity between a time variable and year fixed effects? I have a panel model where the outcome is measure in three separate years. I am using OLS from the fixest package. One of the variables is gasprice. It takes the same…
YouLocalRUser
  • 309
  • 1
  • 9
0
votes
1 answer

Different result using fixest and multiple fixed effects

First of all, I have to apologize if my headline is misleading. I am not sure how to put it appropriately for my question. I am currently working on the fixed-effect model. My data looks like the following table, although it is not actual data due…
Kob
  • 147
  • 1
  • 11
0
votes
1 answer

R model.matrix drop multicollinear variables

Is there a way to force model.matrix.lm to drop multicollinear variables, as is done in the estimation stage by lm()? Here is an example: library(fixest) N <- 10 x1 <- rnorm(N) x2 <- x1 y <- 1 + x1 + x2 + rnorm(N) df <- data.frame(y = y, x1 = x1,…
A.Fischer
  • 596
  • 5
  • 11