Closed s3alfisc closed 1 month ago
Probably related to bootstrap. We can try comparing the analytical std error.
Pedro H. C. Sant'Anna https://psantanna.com https://psantanna.com
On Sun, Sep 22, 2024 at 13:03 Alexander Fischer @.***> wrote:
Hi all,
As suggested in #38 https://github.com/d2cml-ai/csdid/issues/38, this PR adds a test against R::did via rpy2 and a CI workflow to run the test.
To do so, pytest and rpy2 are added as dependencies to requirements.txt.
Currently, I only implement one simple test of the for the ATE and associated SEs; tests for other aggregation levels could easily be added following the same schema.
Tests for point estimates pass, but not for the SEs, where I observe minor differences. Maybe it is small sample corrections?
You can view, comment on, or merge this pull request online at:
https://github.com/d2cml-ai/csdid/pull/39 Commit Summary
- 2f3f841 https://github.com/d2cml-ai/csdid/pull/39/commits/2f3f841cfe200157c55b6cf2ff81a80b9cce5120 add rpy2, pytest as dependencies
- 56cdba4 https://github.com/d2cml-ai/csdid/pull/39/commits/56cdba4acfa4251acbd6bd3af6f1d960da5fd636 add test vs R::did
- 10bd59a https://github.com/d2cml-ai/csdid/pull/39/commits/10bd59a553a794fb68df78ef812d83e2403ef593 add ci run
- 38580ea https://github.com/d2cml-ai/csdid/pull/39/commits/38580eab1b8c192546b476854ad291b47c1577bc ci run on main
- b8c113e https://github.com/d2cml-ai/csdid/pull/39/commits/b8c113e68f91f4627ed8340d33f2ed917ac2d154 Update Readme
- 37fc3e4 https://github.com/d2cml-ai/csdid/pull/39/commits/37fc3e47c1b808bfccd0fc87a1d0033d113c98b8 run ci on python 3.8
- 3cabe13 https://github.com/d2cml-ai/csdid/pull/39/commits/3cabe135772c5a2c90a4269abda8c84bd7492ea7 Merge branch 'main' of https://github.com/s3alfisc/csdid into main
- a1bf762 https://github.com/d2cml-ai/csdid/pull/39/commits/a1bf7622fe33e6c9659cde4f9f253d6d1b4e63fd Update Readme
- a927eba https://github.com/d2cml-ai/csdid/pull/39/commits/a927eba51f11112822e754d8ff4d3628fcb4f4e8 install csdid in ci
- d288bc6 https://github.com/d2cml-ai/csdid/pull/39/commits/d288bc6753f02a08cb1a585144ecebc4b4994360 Merge branch 'main' of https://github.com/s3alfisc/csdid into main
- 29a47a9 https://github.com/d2cml-ai/csdid/pull/39/commits/29a47a9b448a929fb92194fc047b524642a1a287 Update Readme
- b3e145a https://github.com/d2cml-ai/csdid/pull/39/commits/b3e145a36dd885979b6f940808e9caef833979bb use custom abs diff function
- f522439 https://github.com/d2cml-ai/csdid/pull/39/commits/f522439af15159e8a945f9824cf0d03a555aeea0 Merge branch 'main' of https://github.com/s3alfisc/csdid into main
- 66e44db https://github.com/d2cml-ai/csdid/pull/39/commits/66e44dba5d12c1f902f97f7f3adef2874dbe16d9 Update Readme
- cff25d1 https://github.com/d2cml-ai/csdid/pull/39/commits/cff25d18784cdae2ae936198a56cd76f795f3b41 rename ci wfl
- 53a1944 https://github.com/d2cml-ai/csdid/pull/39/commits/53a19445330d27570407d09d059fba5790e2d296 Merge branch 'main' of https://github.com/s3alfisc/csdid into main
- 71096ec https://github.com/d2cml-ai/csdid/pull/39/commits/71096ecb46594a566fd039d1032136047149e490 Update Readme
- ab4a755 https://github.com/d2cml-ai/csdid/pull/39/commits/ab4a755a1724a1dc80c0dda3e033dcb530973ff7 fix typo
- 0a18540 https://github.com/d2cml-ai/csdid/pull/39/commits/0a18540d83b8e56b53401175cb9f2edddf0a4de7 Merge branch 'main' of https://github.com/s3alfisc/csdid into main
- 2643e40 https://github.com/d2cml-ai/csdid/pull/39/commits/2643e40a528b09b90c922cbed78b38ab6e6c6c68 Update Readme
File Changes
(6 files https://github.com/d2cml-ai/csdid/pull/39/files)
- A .github/workflows/ci-tests.yml https://github.com/d2cml-ai/csdid/pull/39/files#diff-03609cb60b0c6e92fb771eb8787d6722b8c31ca4c03eabc788e147acd8c6fb43 (49)
- A README.md https://github.com/d2cml-ai/csdid/pull/39/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5 (191)
- M README_files/figure-commonmark/cell-5-output-2.png https://github.com/d2cml-ai/csdid/pull/39/files#diff-54fa333a6a6f8dd45aa2dbb911473b9dc31cff5aa88d626c9c29f2199ba8abec (0)
- A README_files/figure-commonmark/cell-7-output-2.png https://github.com/d2cml-ai/csdid/pull/39/files#diff-df3d78063bd1fe061f915eb36862cb079c51fbef4e724829b30ea8c0064c12d5 (0)
- M requirements.txt https://github.com/d2cml-ai/csdid/pull/39/files#diff-4d7c51b1efe9043e44439a949dfd92e5827321b34082903477fd04876edb7552 (2)
- A test/test_vs_r.py https://github.com/d2cml-ai/csdid/pull/39/files#diff-22c8b2ff3c110aec1c2399bb59cd8283c1e8ad815b5f40e0d21164c634d4e225 (57)
Patch Links:
— Reply to this email directly, view it on GitHub https://github.com/d2cml-ai/csdid/pull/39, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABE7346L3ALIPMXZ57YAYU3ZX3Z7JAVCNFSM6AAAAABOUW5LGCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGU2DCMJWG42TCMQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Yep, increasing the # of bootstrap iterations reduces the difference and the tests pass. For some reason, I was assuming that only the CIs were based on a multiplier bootstrap & the SEs were analytical.
Hi @s3alfisc , thanks a lot for your contribution! Yes, I was doing the same excercise for the difference between the stds and for bootstraps when increasing the # obs the difference reduces, so great that you found the same :). I just merged the commit.
Hi all,
As suggested in #38, this PR adds a test against
R::did
viarpy2
and a CI workflow to run the test.To do so,
pytest
andrpy2
are added as dependencies torequirements.txt
.Currently, I only implement one simple test of the for the ATE and associated SEs; tests for other aggregation levels could easily be added following the same schema.
Tests for point estimates pass, but not for the SEs, where I observe minor differences. Maybe it is small sample corrections?