#890 - Show how to replicate Stata results#897
#890 - Show how to replicate Stata results#897s3alfisc merged 4 commits intopy-econometrics:masterfrom
Conversation
.qmd file showing how to replicate common Stata results in PyFixest. Note: I ran each part in both Stata and PyFixest and got the same results everywhere except for `fit4` where I show how to get HC3 standard errors. For some reason the HC3 errors in PyFixest and Stata do not match. I haven't had a chance to try to figure out why though. If you know why, let me know and I can update the example. If not, I can try to figure it out at a later date. In the meantime we can remove that section or add a note that the HC3 standard errors do not match.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Flags with carried forward coverage won't be shown. Click here to find out more. see 6 files with indirect coverage changes 🚀 New features to boost your workflow:
|
|
General comment on the PR - looks very good, thanks! Do you think it would be a lot of work to add the Stata output to the code chunk as commented out text? So that readers could directly compare the Stata and R outputs? |
|
pre-commit.ci autofix |
|
@all-contributors please add @jestover for docs |
|
I've put up a pull request to add @jestover! 🎉 |
for more information, see https://pre-commit.ci
You were correct about the HC3 needing ssc(adj = False)! Also, I liked the idea about adding the Stata output, so I have done that as well.
|
You were correct on HC3 correction, so that is fixed and I have added the Stata output which should make it so people can follow along without having to replicate everything themselves. |
|
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
| which includes a section on | ||
| [Coming from Stata](https://aeturrell.github.io/coding-for-economists/coming-from-stata.html), | ||
| or [Tidy Finance with Python](https://www.tidy-finance.org/python/) by Christopher | ||
| Scheuch, Stefan Voigt, Patrick Weiss, and Christoph Frey. |
There was a problem hiding this comment.
Maybe we could link the stata2r project here as well and note that fixest syntax almost exaclty matches pyfixest?
|
Looks great, link here: https://py-econometrics.github.io/pyfixest/stata-2-pyfixest.html =) |
…trics#897) * py-econometrics#890 - Show how to replicate Stata results .qmd file showing how to replicate common Stata results in PyFixest. Note: I ran each part in both Stata and PyFixest and got the same results everywhere except for `fit4` where I show how to get HC3 standard errors. For some reason the HC3 errors in PyFixest and Stata do not match. I haven't had a chance to try to figure out why though. If you know why, let me know and I can update the example. If not, I can try to figure it out at a later date. In the meantime we can remove that section or add a note that the HC3 standard errors do not match. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * py-econometrics#890 Requested Changes You were correct about the HC3 needing ssc(adj = False)! Also, I liked the idea about adding the Stata output, so I have done that as well. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

.qmd file showing how to replicate common Stata results in PyFixest.
Note: I ran each part in both Stata and PyFixest and got the same results everywhere except for
fit4where I show how to get HC3 standard errors. For some reason the HC3 errors in PyFixest and Stata do not match. I haven't had a chance to try to figure out why though.If you know why, let me know and I can update the example. If not, I can try to figure it out at a later date. In the meantime we can remove that section or add a note that the HC3 standard errors do not match.