From ff9899cc2a49b849e69cfdbf1cff7cfc9a245ee9 Mon Sep 17 00:00:00 2001 From: Malte Londschien Date: Thu, 3 Oct 2024 17:22:52 +0200 Subject: [PATCH 1/4] Correctly display f-test, j-test in summary. --- ivmodels/summary.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ivmodels/summary.py b/ivmodels/summary.py index cc2c972..573c054 100644 --- a/ivmodels/summary.py +++ b/ivmodels/summary.py @@ -199,14 +199,14 @@ def fit(self, X, y, Z=None, C=None, *args, **kwargs): self.f_statistic_, self.f_p_value_ = ( tests.rank_test(Z, X, C=C, fit_intercept=fit_intercept) if self.kclass._is_iv_estimator() - else None - ), None + else (None, None) + ) self.j_statistic_, self.j_p_value_ = ( tests.j_test(Z, X, y=y, C=C, fit_intercept=fit_intercept) if self.kclass._is_iv_estimator() and Z.shape[1] > X.shape[1] - else None - ), None + else (None, None) + ) return self From 679d57954b349e35cb62db07e0e43ec9005a7499 Mon Sep 17 00:00:00 2001 From: Malte Londschien Date: Thu, 3 Oct 2024 17:23:54 +0200 Subject: [PATCH 2/4] changelog. --- CHANGELOG.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 79bf752..b4dd50b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,13 @@ Changelog ========= +0.5.2 - 2024-10-03 +------------------ + +**Bug fixes:** + +- The :class:`~ivmodels.summary.Summary` now correctly includes the rank and J test results. + 0.5.1 - 2024-09-16 ------------------ From bb0260fdd22be6a9f95880ed69e2c0cb9e53a49d Mon Sep 17 00:00:00 2001 From: Malte Londschien Date: Thu, 3 Oct 2024 17:34:01 +0200 Subject: [PATCH 3/4] Add test. --- tests/test_summary.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_summary.py b/tests/test_summary.py index 86d8719..c86cbde 100644 --- a/tests/test_summary.py +++ b/tests/test_summary.py @@ -44,6 +44,13 @@ def test_kclass_summary(test, n, mx, k, mc, fit_intercept): assert table.feature_names == names + if k < mx: + assert summary.f_statistic_ > 0 + assert 0 <= summary.f_p_value_ <= 1 + + assert summary.j_statistic_ > 0 + assert 0 <= summary.j_p_value_ <= 1 + summary_string = str(summary) for name in names: assert name in summary_string From 49271c2a6acb557b6847d1e048ad09337daf1183 Mon Sep 17 00:00:00 2001 From: Malte Londschien Date: Thu, 3 Oct 2024 17:34:31 +0200 Subject: [PATCH 4/4] Prepare for 0.5.2 release. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4398a61..e7bf46c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ requires = ['setuptools', 'setuptools-scm', 'wheel'] name = "ivmodels" description = "IV Models" readme = "README.md" -version = "0.5.1" +version = "0.5.2" requires-python = ">=3.7" authors = [ { name = "Malte Londschien", email = "malte@londschien.ch" },