Maarölli
Maarölli

Reputation: 385

plm with time effects

I'm trying to use the plm package in R for the first time.

I wish to estimate a pooling model with only time dummies, i.e. no unobserved heterogeneity.

I run a simple simple regression of the form:

plm(dep ~ x:y -1, data=data, index=c("panel_var", "time_var"), effect="time", model="pooling")

, where x is a continuous and y a categorical variable (and hence x:y the interaction). I added -1 to the model to not include an intercept given that I wished to have time dummies.

When using summary, the model correctly informs me time size of the 'panel' and 'time' dimensions. However, it does not report the time dummies. By inspection I found out that it is because it does not include time dummies in the regression (running a simple lm regression without an intercept gives the same answer).

Given that effect="time" option does not add time dummies, what does it do?

I know that my desired model can be run with lm but I wanted to explicitly state the panel structure and use the vcovSCC covariance structure included in the plm package (although this is probably feasible also after running an lm regression).

Thanks for help!

Upvotes: 2

Views: 3039

Answers (1)

Helix123
Helix123

Reputation: 3677

A pooled OLS model has neither time nor individual effects. Maybe the package should issue an error message. You probably want a fixed effects model, e. g.

data(Grunfeld, package="plm")
# estimate model with time effects
fe <- plm(inv ~ value + capital, data=Grunfeld, model = "within", effect = "time")

summary(fe)
# extract time effects
fixef(fe)

Upvotes: 5

Related Questions