Save *both* estimated effects

オープン
#392 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
data

調査の方向性

Start by reading the PanelEffectsResults.estimated_effects API and how PanelOLS handles entity and time effects. Check the existing documentation and tests for estimated effects; the issue does not name specific files or tests. Done means the expected way to save both effects is clear and supported, with output that can be checked against the reported example.

索引モデルが issue の本文から書いたものです。

説明

Hey there,

I run the textbook example of PanelOLS with both "entity" and "time" FEs. I am trying to save the two estimated effects using linearmodels.panel.results.PanelEffectsResults.estimated_effects, but I obtain only one column in the output DataFrame, which does not even seem to resemble either of the two FEs (I am double checking everything with Stata's reghdfe).

from linearmodels.datasets import wage_panel
from linearmodels import PanelOLS

data = wage_panel.load()
year = pd.Categorical(data.year)
data = data.set_index(["nr", "year"])

exog_vars = ['expersq']
exog = sm.add_constant(data[exog_vars])

mod = PanelOLS(data.lwage, exog, entity_effects=True, time_effects=True)
result = mod.fit(cov_type='clustered')

result.estimated_effects

gives me the following output

nr		year		estimated_effects
13		1980		-0.993351
		1981		-0.835877
		1982		-0.728156
		1983		-0.620804
		1984		-0.479181
...		...		...
12548	        1983		-0.212544
		1984		-0.070921
		1985		0.059622
		1986		0.212194
		1987		0.382053

4360 rows × 1 columns

How can I save both the estimated effects?
Am I missing something, or is this a bug?

Thank you for your help!

主要言語
Python
スター
1.1k
フォーク
203
平均マージ
3時間 26分
マージ済み PR(30日)
115

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

bashtage/linearmodels のほかの issue

bashtage/linearmodels の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。