Alex's Avatar

Alex

@s3alfisc.bsky.social

Data Science, open source and economics. Developing pyfixest. https://github.com/s3alfisc

264 Followers  |  422 Following  |  204 Posts  |  Joined: 25.09.2023  |  2.3832

Latest posts by s3alfisc.bsky.social on Bluesky

(Ok, FixedEffectsModels.jl does pretty awesome as well. And we still have quite some catchup work to do with pyfixest =) )

31.01.2026 11:26 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image

If you fit hdfe regressions with complex fixed effects structures, fixest is unquestionably the goat in terms of performance.

31.01.2026 11:26 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Plus, the performance, which you get via a highly optimized MAP algorithm (with local IT acceleration, global smoothing, and a range of internal tricks and heuristics, see here for lrberge.github.io/fixest/refer...) and all the perf improvements that multiple estimation syntax allows.

31.01.2026 11:20 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

I could of course go on here... for more ideas in API design, read the paper!

31.01.2026 11:20 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

- Then of course you get regression tables out of the box with etable.
- And you can "bring your own vcov's" functionality with easy plug ins.
- We get a new operator for interacting variables with i(var1, var2) (very under appreciated imo!)
- Last, my favorite feature: multiple estimation syntax!

31.01.2026 11:20 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

To point out just a few innovations on the API side that imo set the standard for regression packages. You get

- separation of estimation and inference - and you can adjust inference post-estimation "on the fly"
- a lot of handy post-estimation processing: coef, se, iplot, predict, and much more ..

31.01.2026 11:20 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Strong agree. And do read the paper! It illustrates very nicely how much thought and creativity has gone into designing fixest's API and performance optimizations which are really the two things that make fixest as great.

31.01.2026 11:05 β€” πŸ‘ 4    πŸ” 0    πŸ’¬ 2    πŸ“Œ 0

The neat thing is that this idea generalizes to regression and is worked out in the paper by Wong et al listed in the dbreg docs.

28.01.2026 20:08 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

You are left with a 2x2 "compressed" data matrix of "sufficient statistics" and "weights", which here is just the number of treated and untreated observations. You can now compute an ATE (as sum_Y(1) / w(1) - sum_Y(0) / w(0)) and also SEs.

28.01.2026 20:08 β€” πŸ‘ 4    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Core idea: say you want to compute the impact of an RCT on Y. You only need:

- the sum of Y in test and control sum_Y(D)
- the sum of squares of Y in test and control
- and store the number of treated and non treated units. w(D)

You can get all of it in a simple group by and sum evaluation.

28.01.2026 20:08 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
dbreg

Things are grim. But in more frivolous news...

@jamesbrandecon.bsky.social and I have been chipping away at `dbreg`, a πŸ“¦ for running big regression models on database backends. For the right kinds of problems, the speed-ups are near magical.

Website: grantmcdermott.com/dbreg/

#rstats

[1/2]

26.01.2026 16:57 β€” πŸ‘ 68    πŸ” 16    πŸ’¬ 4    πŸ“Œ 1

Cool! I have many question: Is this in Python and do you have a GitHub repo and would you be up to contribute to moderndid? πŸ˜€

06.01.2026 20:27 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

I'll take a close look, thanks!

06.01.2026 20:25 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Very flattering (and exciting!) to see that Claude Code, even though prompted to use other packages, decided that it was a good choice to fit a TWFE regression in Python via PyFixest =)

05.01.2026 20:26 β€” πŸ‘ 6    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image

I also like the `event_study` API @kylefbutts.bsky.social introduced (and that we also have in pyfixest), though I think this is mostly a functional wrapper around the att_gt class?

04.01.2026 10:52 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Post image

I've been wondering if pyfixest syntax is ideal for the new DiD estimators - what moderndid does seems to make very good sense to me - first there is a model class call, and then users can specify aggregation levels of ATTs. This is more or less the same API that the R did package uses:

04.01.2026 10:52 β€” πŸ‘ 3    πŸ” 1    πŸ’¬ 1    πŸ“Œ 0

If you want to get started with OSS and have questions, please reach out! I'm happy to help wherever I can =)

03.01.2026 10:42 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

As all packages are developed by volunteers, please consider helping out with writing code or documentation - the hurdle for contributing to OSS has never been lower. Plus, you might learn a thing or two about software engineering best practices, which will be a useful skill to have in the future!

03.01.2026 10:40 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

- mlsynth for synth controls (github.com/jgreathouse9...)
- moderndid & PyFixest for DiD
- rdrobust (which needs better documentation and maybe a cleaner API) github.com/rdpackages/r...
- @apoorvalal.com 's torchonometrics for metrics on the GPU: github.com/apoorvalal/t...

03.01.2026 10:40 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Btw - the Python open source applied metrics tooling is growing rapidly. We now have:

- PyFixest for HDFE regressions (github.com/py-econometr...)
- marginaleffects for marginal effects (github.com/vincentarelb...)
- maketables for regression tables (github.com/py-econometr...)

03.01.2026 10:40 β€” πŸ‘ 3    πŸ” 1    πŸ’¬ 1    πŸ“Œ 0

If you are aware of any other high quality implementations of "modern" estimators in Python, please let us know!

03.01.2026 10:40 β€” πŸ‘ 1    πŸ” 1    πŸ’¬ 1    πŸ“Œ 0

From PyFixest, we plan to contribute

- DiD2s a la Gardner
- Local Projections as in @arindube.bsky.social
- Fully Interacted Estimators as in Sun&Abraham

Plus, hopefully, the imputation estimator from github.com/jsr-p

03.01.2026 10:40 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

It comes with implementations for

- The CS estimator @pedrosantanna.bsky.social
- Honest DiDs following @jondr44.bsky.social 's work
- Continuous DiD following @pedrosantanna.bsky.social

03.01.2026 10:40 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 2    πŸ“Œ 0
Preview
GitHub - jordandeklerk/moderndid: Python package implementing modern DiD estimators with diagnostic tools and sensitivity analysis. Python package implementing modern DiD estimators with diagnostic tools and sensitivity analysis. - jordandeklerk/moderndid

There is a new-ish Python package, moderndid, that implements almost all of the "modern" DiD estimators:
github.com/jordandekler...

03.01.2026 10:40 β€” πŸ‘ 31    πŸ” 4    πŸ’¬ 1    πŸ“Œ 0

Absolutely phenomenal news, congratulations Juan!

01.01.2026 17:50 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

TIL that `maketables` already supports regression tables via `typst`: py-econometrics.github.io/maketables/d... Happy holidays everyone! =)

26.12.2025 10:39 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Setting up a small repo to evaluate this based on CRAN packages. Will post here once on GitHub

21.12.2025 16:28 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Note sure we'll manage to produce as much great content as on marginaleffects.com πŸ˜…

21.12.2025 15:15 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Yes, makes very good sense to me. Similar idea in this repo - basically try to make your docs as LLM-readable as possible πŸ˜€ github.com/jacobtomlins...

21.12.2025 14:34 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Maybe one could use LLM knowledge cutoffs and packages create pre-and post these cutoffs to study this? @gaborbekes.bsky.social

21.12.2025 14:26 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

@s3alfisc is following 20 prominent accounts