Description
Good first issue
I've labeled this a "good first issue" because it shouldn't be too difficult to implement, still the changes are somewhat intricate and it is not necessarily a "quick win".
Context
Currently, we only support regression decompositions without any background covariates in the decompose class.
Hence, the short regression is always defined as depvar ~ param
and it is not possible to always additionally control for any other variables.
In math,
We would like to allow users to add background variables always contained in
To do so, we have to add an argument to Feols.decompose()
, which we might call xfml
. The decompose API might then look like this:
import pyfixest as pf
fit = pf.feols("Y ~ X1 + X2 + C(f1)", data = pf.get_data())
fit.decompose(param = "X1", xfml = "X2")
Now, the "short" regression is defined as Y ~ X1 + X2
and the "long" regression becomes Y ~ X1 + X2 + C(f1)
.
Without providing a xfml
argument, the short regression is
fit.decompose(param = "X1")
Y ~ X1
and the long regression as above.
To Do
- We need to add a
xfml
argument to the decompose() method of Feols and add appropriate checks and parsing. - We need to update the Decomposition class so that we pass
X1
including the covariates inxfml
here:pyfixest/pyfixest/estimation/decomposition.py
Line 107 in 1ceac58
- We need to add unit test against Stata, might have to as @leostimpfle to help us out once again with running some Stata code =)