Save *both* estimated effects

Aperta
#392 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python
Ambito
data

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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!

Lingua principale
Python
Stelle
1.1k
Fork
203
Merge medio
3h 26m
PR unite (30g)
115

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di bashtage/linearmodels

Tutte le issue di bashtage/linearmodels

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.