简体   繁体   English

具有时间效应的plm

[英]plm with time effects

I'm trying to use the plm package in R for the first time. 我正在尝试第一次在R中使用plm软件包。

I wish to estimate a pooling model with only time dummies, ie 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 ya categorical variable (and hence x:y the interaction). ,其中x是连续的ya类别变量(因此x:y是交互作用)。 I added -1 to the model to not include an intercept given that I wished to have time dummies. 考虑到我希望有时间假人,我在模型中添加了-1 ,以不包括截距。

When using summary , the model correctly informs me time size of the 'panel' and 'time' dimensions. 使用summary ,模型会正确告知我“面板”和“时间”尺寸的时间大小。 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). 通过检查,我发现这是因为它在回归中不包括时间虚拟变量(运行没有截距的简单lm回归给出相同的答案)。

Given that effect="time" option does not add time dummies, what does it do? 鉴于effect="time"选项不会添加时间虚拟变量,它有什么作用?

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). 我知道我想要的模型可以与lm一起运行,但是我想明确声明面板结构并使用plm包中包含的vcovSCC协方差结构(尽管在运行lm回归后这可能也是可行的)。

Thanks for help! 感谢帮助!

A pooled OLS model has neither time nor individual effects. 汇总的OLS模型既没有时间也没有个人影响。 Maybe the package should issue an error message. 也许程序包应该发出错误消息。 You probably want a fixed effects model, eg 您可能需要固定效果模型,例如

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)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM