panelbox 0.2.0__py3-none-any.whl → 0.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- panelbox/__init__.py +41 -0
- panelbox/__version__.py +13 -1
- panelbox/core/formula_parser.py +9 -2
- panelbox/core/panel_data.py +1 -1
- panelbox/datasets/__init__.py +39 -0
- panelbox/datasets/load.py +334 -0
- panelbox/gmm/difference_gmm.py +63 -15
- panelbox/gmm/estimator.py +46 -5
- panelbox/gmm/system_gmm.py +136 -21
- panelbox/models/static/__init__.py +4 -0
- panelbox/models/static/between.py +434 -0
- panelbox/models/static/first_difference.py +494 -0
- panelbox/models/static/fixed_effects.py +80 -11
- panelbox/models/static/pooled_ols.py +80 -11
- panelbox/models/static/random_effects.py +52 -10
- panelbox/standard_errors/__init__.py +119 -0
- panelbox/standard_errors/clustered.py +386 -0
- panelbox/standard_errors/comparison.py +528 -0
- panelbox/standard_errors/driscoll_kraay.py +386 -0
- panelbox/standard_errors/newey_west.py +324 -0
- panelbox/standard_errors/pcse.py +358 -0
- panelbox/standard_errors/robust.py +324 -0
- panelbox/standard_errors/utils.py +390 -0
- panelbox/validation/__init__.py +6 -0
- panelbox/validation/robustness/__init__.py +51 -0
- panelbox/validation/robustness/bootstrap.py +933 -0
- panelbox/validation/robustness/checks.py +143 -0
- panelbox/validation/robustness/cross_validation.py +538 -0
- panelbox/validation/robustness/influence.py +364 -0
- panelbox/validation/robustness/jackknife.py +457 -0
- panelbox/validation/robustness/outliers.py +529 -0
- panelbox/validation/robustness/sensitivity.py +809 -0
- {panelbox-0.2.0.dist-info → panelbox-0.4.0.dist-info}/METADATA +32 -3
- {panelbox-0.2.0.dist-info → panelbox-0.4.0.dist-info}/RECORD +38 -21
- {panelbox-0.2.0.dist-info → panelbox-0.4.0.dist-info}/WHEEL +1 -1
- {panelbox-0.2.0.dist-info → panelbox-0.4.0.dist-info}/entry_points.txt +0 -0
- {panelbox-0.2.0.dist-info → panelbox-0.4.0.dist-info}/licenses/LICENSE +0 -0
- {panelbox-0.2.0.dist-info → panelbox-0.4.0.dist-info}/top_level.txt +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: panelbox
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary: Panel data econometrics in Python: Fixed Effects, Random Effects, GMM (Arellano-Bond, Blundell-Bond)
|
|
3
|
+
Version: 0.4.0
|
|
4
|
+
Summary: Panel data econometrics in Python: Fixed Effects, Random Effects, GMM (Arellano-Bond, Blundell-Bond), Robust Standard Errors (HC, Clustered, Driscoll-Kraay, Newey-West), Bootstrap, Sensitivity Analysis
|
|
5
5
|
Author-email: Gustavo Haase <gustavo.haase@gmail.com>, Paulo Dourado <paulodourado.unb@gmail.com>
|
|
6
6
|
License: MIT
|
|
7
7
|
Project-URL: Homepage, https://github.com/PanelBox-Econometrics-Model/panelbox
|
|
@@ -9,7 +9,7 @@ Project-URL: Documentation, https://github.com/PanelBox-Econometrics-Model/panel
|
|
|
9
9
|
Project-URL: Repository, https://github.com/PanelBox-Econometrics-Model/panelbox
|
|
10
10
|
Project-URL: Issues, https://github.com/PanelBox-Econometrics-Model/panelbox/issues
|
|
11
11
|
Project-URL: Changelog, https://github.com/PanelBox-Econometrics-Model/panelbox/blob/main/CHANGELOG.md
|
|
12
|
-
Keywords: econometrics,panel data,GMM,Arellano-Bond,Blundell-Bond,fixed effects,random effects,dynamic panel,instrumental variables
|
|
12
|
+
Keywords: econometrics,panel data,GMM,Arellano-Bond,Blundell-Bond,fixed effects,random effects,dynamic panel,instrumental variables,robust standard errors,clustered standard errors,heteroskedasticity,Driscoll-Kraay,Newey-West,HAC,bootstrap,sensitivity analysis,robustness
|
|
13
13
|
Classifier: Development Status :: 4 - Beta
|
|
14
14
|
Classifier: Intended Audience :: Science/Research
|
|
15
15
|
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
@@ -31,6 +31,8 @@ Requires-Dist: pandas>=2.0.0
|
|
|
31
31
|
Requires-Dist: scipy>=1.10.0
|
|
32
32
|
Requires-Dist: statsmodels>=0.14.0
|
|
33
33
|
Requires-Dist: patsy>=0.5.3
|
|
34
|
+
Requires-Dist: tqdm>=4.65.0
|
|
35
|
+
Requires-Dist: jinja2>=3.1.0
|
|
34
36
|
Provides-Extra: dev
|
|
35
37
|
Requires-Dist: pytest>=7.3.0; extra == "dev"
|
|
36
38
|
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
|
|
@@ -56,6 +58,7 @@ Dynamic: license-file
|
|
|
56
58
|
[](https://www.python.org/downloads/)
|
|
57
59
|
[](https://opensource.org/licenses/MIT)
|
|
58
60
|
[]()
|
|
61
|
+
[](https://pepy.tech/projects/panelbox)
|
|
59
62
|
|
|
60
63
|
PanelBox provides comprehensive tools for panel data econometrics, bringing Stata's `xtabond2` and R's `plm` capabilities to Python with modern, user-friendly APIs.
|
|
61
64
|
|
|
@@ -184,6 +187,32 @@ print(f"Instrument count: {results.n_instruments}")
|
|
|
184
187
|
print(f"Instrument ratio: {results.instrument_ratio:.3f}")
|
|
185
188
|
```
|
|
186
189
|
|
|
190
|
+
## 📖 Best Practices for GMM
|
|
191
|
+
|
|
192
|
+
### Recommended: Use `collapse=True`
|
|
193
|
+
|
|
194
|
+
Following Roodman (2009), we **strongly recommend** using collapsed instruments:
|
|
195
|
+
|
|
196
|
+
```python
|
|
197
|
+
# ✅ RECOMMENDED
|
|
198
|
+
gmm = DifferenceGMM(..., collapse=True)
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
**Why collapse instruments?**
|
|
202
|
+
- ✅ **Better numerical stability** - Avoids ill-conditioned matrices
|
|
203
|
+
- ✅ **Reduces overfitting** - Fewer instruments mean less overfitting risk
|
|
204
|
+
- ✅ **Improves finite-sample properties** - Better performance with limited data
|
|
205
|
+
- ✅ **Grows as O(T) not O(T²)** - Scales better with time periods
|
|
206
|
+
|
|
207
|
+
**When you use `collapse=False`:**
|
|
208
|
+
- ⚠️ You'll see a detailed warning message
|
|
209
|
+
- ⚠️ May encounter numerical instability warnings
|
|
210
|
+
- ⚠️ Works but requires careful interpretation
|
|
211
|
+
|
|
212
|
+
See `examples/gmm/unbalanced_panel_guide.py` for detailed guidance.
|
|
213
|
+
|
|
214
|
+
**Reference:** Roodman, D. (2009). "How to do xtabond2: An introduction to difference and system GMM in Stata." *The Stata Journal*, 9(1), 86-136.
|
|
215
|
+
|
|
187
216
|
## Key Advantages
|
|
188
217
|
|
|
189
218
|
### 1. Handles Unbalanced Panels Gracefully
|
|
@@ -1,28 +1,31 @@
|
|
|
1
|
-
panelbox/__init__.py,sha256
|
|
2
|
-
panelbox/__version__.py,sha256=
|
|
1
|
+
panelbox/__init__.py,sha256=-PNznMtCoLXftzKjeUXKKLtUHY9adquWuhtESuJdufA,3069
|
|
2
|
+
panelbox/__version__.py,sha256=ekcLdXTGDFP7tfPpdwjcLSs77VxVbKGeg5BieZc9EJk,1517
|
|
3
3
|
panelbox/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
panelbox/cli/{commands}/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
panelbox/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
panelbox/core/base_model.py,sha256=PEtIs8kFF62EtMEpBjDqKF9eZc8sGdX3tnAcxGG9P_w,4373
|
|
7
|
-
panelbox/core/formula_parser.py,sha256=
|
|
8
|
-
panelbox/core/panel_data.py,sha256=
|
|
7
|
+
panelbox/core/formula_parser.py,sha256=insbEfEa7jmGvRMpSxcajaqYqkwVEWpzlS8E2migU2w,10138
|
|
8
|
+
panelbox/core/panel_data.py,sha256=fkdWHbrzuQJhkCcZmewwSgHX7Yly6EnEKvgZ5vM4mcw,12621
|
|
9
9
|
panelbox/core/results.py,sha256=oiEYly537kg0LZZGDGrbnnZPp3tHdUlwPwsnzEb-Szs,11635
|
|
10
|
-
panelbox/datasets/__init__.py,sha256=
|
|
10
|
+
panelbox/datasets/__init__.py,sha256=5EtnnYwfNkKvkjWCgIhUbLX1BU00rjIhowRIHByVA5c,753
|
|
11
|
+
panelbox/datasets/load.py,sha256=T_sODHRH1Ru6a-QhFCLZyzxOh3s1d4ayQzml6Kn46Kw,9740
|
|
11
12
|
panelbox/datasets/{data}/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
13
|
panelbox/gmm/__init__.py,sha256=ZJlPPmdWSJ0jWYQGMEhLT8F4NiNAWPEANoTlCDhnf3A,1922
|
|
13
|
-
panelbox/gmm/difference_gmm.py,sha256=
|
|
14
|
-
panelbox/gmm/estimator.py,sha256=
|
|
14
|
+
panelbox/gmm/difference_gmm.py,sha256=c3vhZs4dtLTmYNlTbyoMaB83Tnx1IqnYxg37RfMx4oE,25168
|
|
15
|
+
panelbox/gmm/estimator.py,sha256=13VR8rp62k1YnJgQNElm9Kj3c5w8gISl6Qa0v5fGqF8,19557
|
|
15
16
|
panelbox/gmm/instruments.py,sha256=2MJ1oeqSS8xiy6xylwNyiyEn2ogqumS0hUiUtjPnZuc,19517
|
|
16
17
|
panelbox/gmm/results.py,sha256=K6O7rBoAYuRQ1bRT8F-zsY8NdxAPa7rTsbfIegVvrN0,17078
|
|
17
|
-
panelbox/gmm/system_gmm.py,sha256=
|
|
18
|
+
panelbox/gmm/system_gmm.py,sha256=Lc_B3AjhiAUDr43prsmFsClaaEBVoNinZIZosAjmnls,25874
|
|
18
19
|
panelbox/gmm/tests.py,sha256=aQz6t-NeuCRhLjnhxboG7MaKmdhyU8GLmAPWlz2TZrM,17487
|
|
19
20
|
panelbox/models/__init__.py,sha256=q0OtlD_E3_yvAm7kRvjySoBulU2VfeHl1xp--8f3e9k,196
|
|
20
21
|
panelbox/models/dynamic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
21
22
|
panelbox/models/iv/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
|
-
panelbox/models/static/__init__.py,sha256=
|
|
23
|
-
panelbox/models/static/
|
|
24
|
-
panelbox/models/static/
|
|
25
|
-
panelbox/models/static/
|
|
23
|
+
panelbox/models/static/__init__.py,sha256=i2-RpYHe-lhxnW_djeMciaXC7DN9zAB4rV0HrqpTMcY,478
|
|
24
|
+
panelbox/models/static/between.py,sha256=HvSkakajhgHSeZSW-EcYWZZGmAOSuntTqwRA40HkXe0,15714
|
|
25
|
+
panelbox/models/static/first_difference.py,sha256=kKxLXZOITqUIYDuyGWdSHXT3n5TmPlEoWA7_O1wL1-o,17903
|
|
26
|
+
panelbox/models/static/fixed_effects.py,sha256=I1hZ0ruva_LjX4hm89hyPpGMFwW26yoWSsVQOGRPzrs,18813
|
|
27
|
+
panelbox/models/static/pooled_ols.py,sha256=IR415LSJzqWJbrluJpNirLBYkmF5eNutCZyTzhODHu0,11065
|
|
28
|
+
panelbox/models/static/random_effects.py,sha256=Vw0lwHig8WeXhTXUhAR7fNbrW6zeddhPyq50CeD9OuA,17752
|
|
26
29
|
panelbox/report/__init__.py,sha256=SgnfsuK8dXylf4mg8Oq5syquWNqwMURXdcAXXCXuqjg,1494
|
|
27
30
|
panelbox/report/asset_manager.py,sha256=aRpsN4M0iKLYvn_HQn88Vn952tyHX3m3Upq0-I4k3JU,10982
|
|
28
31
|
panelbox/report/css_manager.py,sha256=Z_5UsPsvA0vOZx5Iw32yUI7gecjPj5ljeBxIScnyWeY,12790
|
|
@@ -38,7 +41,14 @@ panelbox/report/renderers/static_validation_renderer.py,sha256=0ejhF7lxxX-lJcqTa
|
|
|
38
41
|
panelbox/report/renderers/static/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
39
42
|
panelbox/report/transformers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
40
43
|
panelbox/report/transformers/static/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
41
|
-
panelbox/standard_errors/__init__.py,sha256=
|
|
44
|
+
panelbox/standard_errors/__init__.py,sha256=3Xb20Py-TpY2CdswfvFXiZOLq9F0z46noYRcIizv_pw,2572
|
|
45
|
+
panelbox/standard_errors/clustered.py,sha256=cTcD0omricgh8MjhDyo30bfBkIhCUHDODPGbM7MG-DE,11554
|
|
46
|
+
panelbox/standard_errors/comparison.py,sha256=L98X575H75TgG94Q0E6_x53b17-QDNdBiz9bA7fkAXI,17442
|
|
47
|
+
panelbox/standard_errors/driscoll_kraay.py,sha256=3NMGNg0v9f1jAUFKLCtE6Ks9ykN_Q_tZ0fqAzEWQx-Q,11304
|
|
48
|
+
panelbox/standard_errors/newey_west.py,sha256=sw7GnO4G2tixEt7x_b9th7Sh0TC3IE7oNAa2mJ6WO-c,9290
|
|
49
|
+
panelbox/standard_errors/pcse.py,sha256=365Oqhk6jWVGNKTxfiPNxgV_dcpc5s3Rsg10S8Ogsyg,10976
|
|
50
|
+
panelbox/standard_errors/robust.py,sha256=1SIdwd3whg627Dw_J7Tw2MQMydC6uOcn_N2Faa9ECEA,8847
|
|
51
|
+
panelbox/standard_errors/utils.py,sha256=J2bscQIwVHPdVhZBp2fLQJGfTJaUj-3BOJ1LGcR5bH4,9717
|
|
42
52
|
panelbox/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
43
53
|
panelbox/templates/assets/css/base_styles.css,sha256=1N7-35-lHUcdjX0KosO43tOrZ-3oCG6OY4cEx0_gqCQ,12014
|
|
44
54
|
panelbox/templates/assets/css/report_components.css,sha256=DoAHoFDbOxp_dUB3_k4g3geI-jqDwIL1wqaIENFm9vI,15064
|
|
@@ -57,7 +67,7 @@ panelbox/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
57
67
|
panelbox/utils/formatting.py,sha256=kiw7NetocRsEVd5wA9cAf-SeQtAgeUWj_uguH-NmBrE,3531
|
|
58
68
|
panelbox/utils/matrix_ops.py,sha256=GtzpFG4lcM7Q0NMZjeeLqszpYEitYE5kDKACIJtj7HM,5397
|
|
59
69
|
panelbox/utils/statistical.py,sha256=pWmg6vW5jjU9IsftEwgLA1Rs_2srcW9Z9pEaAh7oJZU,3727
|
|
60
|
-
panelbox/validation/__init__.py,sha256=
|
|
70
|
+
panelbox/validation/__init__.py,sha256=wIa94ThTO0vI-nvaITZPsZaX7Qrj-PsBuQdpOVmK3Dk,2070
|
|
61
71
|
panelbox/validation/base.py,sha256=EbS2Gl1NOXz_76Y1GG47uR6sLVThrbUoI70AEPt0YCo,4972
|
|
62
72
|
panelbox/validation/validation_report.py,sha256=p0NpdbjuW--1lHBwmD4wMTkVwpSABfFWDGB3SdbcKPc,8910
|
|
63
73
|
panelbox/validation/validation_suite.py,sha256=cLy6zB_MU2G1HJWazBtz6ghgwEqpJAhGrMrWM3K4wPE,13246
|
|
@@ -71,7 +81,14 @@ panelbox/validation/heteroskedasticity/breusch_pagan.py,sha256=ND_rx1R4wwLrf1UeS
|
|
|
71
81
|
panelbox/validation/heteroskedasticity/modified_wald.py,sha256=f7e7Cnc5um2gdWjLEtVESK-hdPtJuSn-typGVONB34Y,5606
|
|
72
82
|
panelbox/validation/heteroskedasticity/white.py,sha256=Er0L1dHF5528xMdwlgFZLQKxkG4faEjYIc8XmZdFCeM,6552
|
|
73
83
|
panelbox/validation/instruments/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
74
|
-
panelbox/validation/robustness/__init__.py,sha256=
|
|
84
|
+
panelbox/validation/robustness/__init__.py,sha256=2YXA_qQTT4oq-dEok_K2j4V3DFczHP9Y7uk4-9Azg9k,1531
|
|
85
|
+
panelbox/validation/robustness/bootstrap.py,sha256=o-iM23UvbN506laIdfzDHqGRFlIoutiO7GZmnF6r0ec,32911
|
|
86
|
+
panelbox/validation/robustness/checks.py,sha256=ce1J_ZmRPerK1rA8we9aK2qdOT4T1VgCrUsWpWDw3eA,4270
|
|
87
|
+
panelbox/validation/robustness/cross_validation.py,sha256=TG_s9FL0GHiwtVOUXJBZjww5kqhCH75VMxk51w4mrvE,17906
|
|
88
|
+
panelbox/validation/robustness/influence.py,sha256=13clMbQU0FLiOivAD8NMusNpt2eDuK57CnFEDnr-yBc,12102
|
|
89
|
+
panelbox/validation/robustness/jackknife.py,sha256=GW4jtxzwv98vecj9NIT9VNqTEfmhRxTITqMb7MuJO2Y,14616
|
|
90
|
+
panelbox/validation/robustness/outliers.py,sha256=2lE5Tc-m5Nk0K7A6I9_13qmNqWyxSxRHxdIsWdHWEAU,16918
|
|
91
|
+
panelbox/validation/robustness/sensitivity.py,sha256=_kuBCCJjm1547KSqeQqIRPjBCucFMljgRvPwcRQcieg,25859
|
|
75
92
|
panelbox/validation/serial_correlation/__init__.py,sha256=oaVRtyoT4nNofqXIA0GiKX5kOx0qvCQy88dGDYwf48A,382
|
|
76
93
|
panelbox/validation/serial_correlation/baltagi_wu.py,sha256=v7A6f-d-mjcjs3Ujp8bq16Uc0jny7gAZFHJR6uUquq4,7106
|
|
77
94
|
panelbox/validation/serial_correlation/breusch_godfrey.py,sha256=_Itryc8pJT9q246gY4xvTmbB6rRlnr8z7vS8LRc4bwI,8851
|
|
@@ -82,9 +99,9 @@ panelbox/validation/specification/hausman.py,sha256=-sj5QPjaiHzL2MKwNAuArj4oRIug
|
|
|
82
99
|
panelbox/validation/specification/mundlak.py,sha256=mYbmbVTPjB3VdSyc5bAA286qq7rrZo4Utww4QI9gIjU,11305
|
|
83
100
|
panelbox/validation/specification/reset.py,sha256=lT5hyMrc7wYggoWiptERQoKSyqoekqO5ZSInRe5nRmw,8718
|
|
84
101
|
panelbox/validation/unit_root/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
85
|
-
panelbox-0.
|
|
86
|
-
panelbox-0.
|
|
87
|
-
panelbox-0.
|
|
88
|
-
panelbox-0.
|
|
89
|
-
panelbox-0.
|
|
90
|
-
panelbox-0.
|
|
102
|
+
panelbox-0.4.0.dist-info/licenses/LICENSE,sha256=8RMM6HTZa0iQnLVf_E_M7oRnrMJ6cFF5G0yaRJ4OALA,1085
|
|
103
|
+
panelbox-0.4.0.dist-info/METADATA,sha256=82FgV7_9YyBGgam8Hg73cFwDiwkOkA1IOU-vmYCkU4w,13319
|
|
104
|
+
panelbox-0.4.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
105
|
+
panelbox-0.4.0.dist-info/entry_points.txt,sha256=rC5en7wxrwHeY_Adnb7hkjPdOKLSEz9alxFgzCZQIhY,52
|
|
106
|
+
panelbox-0.4.0.dist-info/top_level.txt,sha256=prj4h9i7Hb-Hsb9UKAg5-RhRH0Q3wfzo3v7K4Xso6jo,9
|
|
107
|
+
panelbox-0.4.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|