Questions tagged [fixest]

86 questions
1
vote
2 answers

Separate coefficients from lm() and plot next to each other

I'm running a simple lm() regression that returns 4 coefficients. I would like to plot them two by two (next to each other, with different colours), as if I would have run two models giving two coefficients each. Minimal example: Y <- runif(100, 0,…
jkortner
  • 549
  • 2
  • 8
  • 23
1
vote
2 answers

What's the most "standard" way to concatenate formulas in R?

I would like to define different parts of a formula in R and then concatenate these parts - not necessarily only by adding the terms up. I could imagine a syntax like this: # define one-handed formulas part_1 <- ~ x:w part_2 <- ~ y + z #…
dufei
  • 2,166
  • 1
  • 7
  • 18
1
vote
0 answers

In fixest::etable, is there a way to change the font size and the footnote for the p-value?

In fixest::etable, is there a way to change the font size and the footnote for the p-value? I am currently looking into documentation and such to be able to output a pdf table in etable with my preferred settings. I would like to adjust the font…
ryoto
  • 361
  • 1
  • 10
1
vote
1 answer

fixest vs lm - diffrent results? (difference in difference)

I'm trying to do a 'classic' difference in difference with multiple time periods. The model I want to do is: y = a + b1x1 + b2_treat + b3_period + b_4(treat*period) + u (eq.1) So basically I'm testing different setups just to make sure I specify my…
Tomas R
  • 440
  • 2
  • 10
0
votes
0 answers

Event-study with continous treatment in R using fixest

I have a panel dataset with "id", "year" (1970 to 2000), and "post" a dummy which takes a value=1 if year > 1985. The treatment variable ("treatment") is a continuous variable measured in 1985. A control variable ("control") is a continuous variable…
Fuser
  • 47
  • 1
  • 9
0
votes
0 answers

How to compare two different group regression coefficient with feols?(a function from fixest package)

I want to compare weather the effect of x to y are different in male group and female group. So i hvae run the regress like this. library(arrow) library(fixest) df <- arrow::read_feather('test.feather') res <- feols(y~x | id +year , data = df,…
0
votes
0 answers

Show varying slopes indicator in modelsummary for fixest estimation

The fixest package lets the user specify varying slopes using the fe1[x2] syntax. A varying slope indicator is then printed at the bottom of fixest::etable(). However, I was unable to find the term for the varying slope fixed-effects using…
vinceroni
  • 87
  • 5
0
votes
0 answers

Difference in difference using R fixest package for multiple treatments

I'm not sure if this is a question for StackOverflow or CrossValidated, as the question relates both to coding and statistics. I have a panel data with information about sewage and water privatization in 82 municipalities between 1998 and 2020. For…
0
votes
0 answers

fixest::sunab() with daily level data, treatment at the monthly

I would like to estimate fixest::sunab using a panel at the daily-level, but with point estimates binned for every month. It does not look like this is possible at the moment, but here is a toy data set: library(tidyverse) library(fixest) ##…
mikeytop
  • 150
  • 9
0
votes
2 answers

How do I store the estimation sample from a fixest regression to calculate summary statistics?

How do I store the estimation sample from a fixest::feols regression so that I can calculate summary statistics? In Stata this can be done with e(sample), eg. sum y if e(sample) to calculate the mean of the dependent variable on the estimation…
Macaulay
  • 59
  • 1
  • 8
0
votes
0 answers

Feols - fixest: variable should drop because of multicollinearity, but doesn't (always)

I am working with a dataset which consists of loan amounts (variable "ln_amount_alt2") given by different banks (variable "name") to different borrowers (variable "permid"). I am interested in finding out whether loan amounts are different after a…
0
votes
0 answers

How do I add leads and lags for my TWFE regression with month-year data?

I have data which looks like this: N = 10 ISIC <- c(111, 112, 113, 114, 115, 111, 112, 113, 114, 115) n_workers <- rnorm(N) year_month <- c(201801, 201801, 201802, 201801, 201802, 201901, 201902, 201901, 201902, 201903) year <- c(2018, 2018, 2018,…
anrisakaki96
  • 193
  • 8
0
votes
1 answer

Exclude Interacted variable to avoid colinearity dropping variables in FE regression (R)

I am running a regression such as the following: library(fixest) reg <- feols(data = df, outcome ~ interaction * (typeA + control1 + control2 + control3) + interaction * (typeB + control1 + control2 + control3) + interaction * (typeC + control1 +…
flâneur
  • 633
  • 2
  • 8
0
votes
1 answer

Intercept in fixed effects regression with feols

How do I get the intercept from a fixed effects regression using fixest::feols? library(fixest) feols(Sepal.Length ~ Sepal.Width | Species, iris) #> Estimate Std. Error t value Pr(>|t|) #> Sepal.Width 0.803561 0.071397 11.2548…
Macaulay
  • 59
  • 1
  • 8
0
votes
1 answer

How to use estimation outputs using functions from library `fixest` in `texreg`

I am using the estimation function femlm from the library fixest and want to use the results/values in texreg to create LaTeX tables side-by-side with results from using other estimation functions. I have been able to include results/values from…
Grillo
  • 75
  • 6