Giter Site home page Giter Site logo

Comments (5)

aeturrell avatar aeturrell commented on July 23, 2024 1

Amazing, thank you for looking at this. From my POV, the dream is to recommend a single regression package to rule them all because it will make life much easier for economists new to coding so I'm only too excited to be adding it.

As I'm going through the chapter, I am likely to come up with a few more issues—just want to give you a heads up, and to say please don't feel obliged in any way to tackle them all really quickly, grateful for whatever progress you make.

from pyfixest.

s3alfisc avatar s3alfisc commented on July 23, 2024 1

Hi, I have added a prototype implementation of etable() in #201 . Will merge and release after CI checks pass. It can output markdown, a pd.DataFrame and even latex =)

%load_ext autoreload
%autoreload 2

from pyfixest.estimation import feols
from pyfixest.utils import get_data
from pyfixest.summarize import etable
import pandas as pd

data = get_data()
fit1 = feols("Y ~ X1", data = data)
fit2 = feols("Y ~ X1 + X2", data = data)
fit3 = feols("Y ~ X2", data = data)

etable([fit1, fit2, fit3])

# | Coefficient   | est1            | est2             | est3             |
# |:--------------|:----------------|:-----------------|:-----------------|
# | Intercept     | 2.349*** (0.09) | 2.35*** (0.09)   | 2.587*** (0.056) |
# | X1            | 0.221** (0.069) | 0.228** (0.068)  |                  |
# | X2            |                 | 0.071*** (0.018) | 0.069*** (0.018) |
# Significance levels: * p < 0.05, ** p < 0.01, *** p < 0.001

The implementation is still rather bare bone - I could print out lots more information + make the output prettier, so I will keep this PR open even after merging.

from pyfixest.

aeturrell avatar aeturrell commented on July 23, 2024 1

This looks so good, thanks for kicking it off!! Happy to feedback on what a more polished version would look like but reckon the fixest etable is a great place to start.

from pyfixest.

s3alfisc avatar s3alfisc commented on July 23, 2024

Hi Arthur, super cool that you have started to integrate Pyfixest into Coding for Economists!

So far, the closest thing pyfixest provides is the summary() function, which allows to print multiple models on top of each other, which is not really great (but I considered good enough in the moment).

from pyfixest.summarize import summary
summary([model1, model2])

I have allocated some time this weekend to push on new pyfixest features, so I will try to produce something close to stargazer of fixest::etable()=)

from pyfixest.

s3alfisc avatar s3alfisc commented on July 23, 2024

I've now managed to make things a little prettier + add some information :

%load_ext autoreload
%autoreload 2

from pyfixest.estimation import feols
from pyfixest.summarize import etable
from pyfixest.utils import get_data

data = get_data()

fit1 = feols("Y ~ X1 ", data=data)
fit2 = feols("np.log(Y) ~ X1 + X2 | f2 + f1 ", data=data, vcov = {"CRV1":"f1+f2"})
fit3 = feols("Y2 ~ X1 + X2 + C(f3) | f1", data=data)

etable([fit1, fit2, fit3])

# est1              est2            est3
# -------------  ----------------  ----------------  --------------
#   depvar                        Y         np.log(Y)              Y2
# -----------------------------------------------------------------
#   Intercept      2.197*** (0.088)
# X1             0.367*** (0.068)  0.133*** (0.029)   0.491 (0.244)
# X2                               0.027*** (0.005)   0.067 (0.041)
# C(f3)[T.1.0]                                        1.221 (0.998)
# C(f3)[T.2.0]                                        0.346 (0.947)
# C(f3)[T.3.0]                                        0.856 (0.865)
# C(f3)[T.4.0]                                          0.75 (0.94)
# C(f3)[T.5.0]                                        0.705 (0.975)
# C(f3)[T.6.0]                                         0.473 (1.04)
# C(f3)[T.7.0]                                       -0.502 (1.013)
# C(f3)[T.8.0]                                       -1.082 (0.783)
# C(f3)[T.9.0]                                        0.175 (0.793)
# C(f3)[T.10.0]                                       0.828 (0.928)
# C(f3)[T.11.0]                                      -0.663 (0.609)
# C(f3)[T.12.0]                                        0.328 (1.02)
# -----------------------------------------------------------------
#   f1                            -                 x               x
# f2                            -                 x               -
#   -----------------------------------------------------------------
#   Observations                998               923             998
# S.E. type                   iid         by: f1+f2          by: f1
# -----------------------------------------------------------------
#   Significance levels: * p < 0.05, ** p < 0.01, *** p < 0.001

I'll close the issue with #210 for now - I will add R-squared later (I worry there might be an error in the implementation).

Best, Alex

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.