Comments (5)
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.
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.
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.
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.
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)
- Ritest: Implement class agnostic function with numpy API
- Feols, Fepois, Feiv: Implement Option to use different Solver for Normal Equation HOT 12
- Inference: Implement `Conley` Standard Errors
- Inference: Support `fixef_k = "nested"` for small sample correction in `ssc()` for identical standard errors with `fixest` HOT 1
- Wildboottest: Incorrect Initiation of R vector -> incorrect results
- Contributing Documentation does not show full code blocks HOT 2
- Contributing Documentation Formatting Issue
- Extract covariance matrix from regression object HOT 7
- F-test in pyfixest HOT 9
- narwhals = Pandas + polars + ... HOT 5
- Helping demean() Fail Gracefully - Add a'fixef_iter' argument to feols() and fepois() HOT 1
- Examples Layout Docs HOT 3
- Feiv : More diagnostic tests on the first stage regression need to be added HOT 2
- Add note on `wald_test` method to `quickstart` (or even a new notebook)? HOT 2
- Add "lean" argument to `feols()` and `fepois()` HOT 4
- Publish `pyfixest` on conda
- Add `solver` argument to `feols()`, `fepois()` APIs HOT 3
- Support for weights as an optional parameter for did2s? HOT 4
- Add benchmarks against `linearmodels` and `fastreg` HOT 8
- Add default IV Diagnostics to `pf.summary()` and `pf.etable()`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyfixest.