Giter VIP home page Giter VIP logo

Comments (5)

s3alfisc avatar s3alfisc commented on August 14, 2024

Some design considerations for internal processing:

Assume the following model formula: fml = "Y + Y2~ X1 | csw0(X3, X4) .

Currently, information on model variables is e.g. encoded in self.var_dict in the following way

>>> self.var_dict
{'0': ['Y', 'Y2', 'X1'], 'X3': ['Y', 'Y2', 'X1'], 'X3+X4': ['Y', 'Y2', 'X1']}

and in self.fml_dict as

>>> self.fml_dict
{'0': ['Y~X1', 'Y2~X1'], 'X3': ['Y~X1', 'Y2~X1'], 'X3+X4': ['Y~X1', 'Y2~X1']}

With instruments, the formula might look as fml = "Y + Y2~ X1 | csw0(X3, X4) | X1 ~ Z1". It is likely preferable to use a "clearer" data structure to save the information above. E.g.

{'0': [{"depvar": "Y", x_vars = ["X1"], z_vars = ["Z1"]}, {{"depvar": "Y2", x_vars = ["X1"], z_vars = ["Z1"]}}, "X3":  ...].

from pyfixest.

s3alfisc avatar s3alfisc commented on August 14, 2024

Status:

  • In dev branch, IV-Estimator is implemented + associated SEs (iid, HC1-3, CRV1).
  • some tests against fixest are implemented & pass
  • still to be done: error handling + tests for multiple estimations

Also, formula syntax currently deviates from fixest. For models without covariates, fixest syntax is

feols(Y ~ 1 | fe | endogvar ~ instrument)

while pyfixest is

Fixest(df).feols("Y ~ endogvar | fe | endogvar ~ instrument"). 

After tackling all points above, I will merge the PR and implement the 2SLS estimator in a separate PR.

from pyfixest.

s3alfisc avatar s3alfisc commented on August 14, 2024

Basic IV support added with version 0.5.

from pyfixest.

s3alfisc avatar s3alfisc commented on August 14, 2024

2SLS estimator now implemented in the dev branch.

from pyfixest.

s3alfisc avatar s3alfisc commented on August 14, 2024

To do:

  • currently, there is a minor deviation to fixest syntax. For models without any covariates, fixest syntax is feols(depvar ~ 1 | fe | endogvar ~ instruments), while pyfixest requires feols(depvar ~ endogvar | fe | endogvar ~ instruments). Align pyfixest syntax with fixest.
  • multiple estimation syntax does not work in the first part of the three-part formula, i.e. depvar ~ csw(X1, X2) | fe | endogvar ~ instrument leads to a bug
  • add tests for IV with multiple estimation
  • add F-test (for first stage and in general)
  • some documentation improvements are definitely possible

from pyfixest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.