楼主: yanbridge
16096 15

[问答] R 面板分析为何无截距(固定效应模型) [推广有奖]

11
蘿蔔thr 学生认证  发表于 2017-12-15 10:53:02 |只看作者 |坛友微信交流群
ywh19860616 发表于 2011-8-27 20:29
> library(plm)
> data(Grunfeld)
> grun.fe1 summary(fixef(grun.fe1,type="level"))
只能这样得到截距项吗?

使用道具

12
蘿蔔thr 学生认证  发表于 2017-12-15 10:53:06 |只看作者 |坛友微信交流群
ywh19860616 发表于 2011-8-27 20:29
> library(plm)
> data(Grunfeld)
> grun.fe1 summary(fixef(grun.fe1,type="level"))
只能这样得到截距项吗?

使用道具

13
rano96 学生认证  发表于 2018-5-31 12:55:40 |只看作者 |坛友微信交流群
ywh19860616 发表于 2011-8-27 20:29
> library(plm)
> data(Grunfeld)
> grun.fe1 summary(fixef(grun.fe1,type="level"))
summary(fixef(grun.fe1,type="level"))
summary(fixef(grun.fe1,type="dmean"))

想请教一下“level”和“demean”分别指的是什么?
另外固定效应模型,每个个体都有各自不同的截距,那这个截距到底是“level”和“demean”哪个算出来的?

使用道具

14
hifinecon 发表于 2018-5-31 15:39:25 |只看作者 |坛友微信交流群
great answer!

使用道具

15
chien_bill 发表于 2019-5-19 21:21:17 |只看作者 |坛友微信交流群
a fixed effects (within) model does not have a single intercept: it has
N. I suggest you have another look at FE models' theory.

Some confusion often stems from Stata (misleadingly, IMHO) reporting an
"intercept" which is actually the average of the individual intercepts,
which you can recover in R as 'mean(fixef(<yourmodel>))'. Remember,
though, that this isn't "the intercept" of the estimated model in the
usual sense of the term. If you "need" an intercept, then you must
review your specification.

如果你一定要一个数字,可以使用
代码:
mean(fixef(yourmodel))
算出截距项的平均值

使用道具

16
QQQQQQ1998 发表于 2022-8-16 13:55:53 |只看作者 |坛友微信交流群
请问如何一次性得到包括效应值和截距的结果呢?我在R上运行时没有截距显示R方为负值,在stata上运行就会同时显示效应值和截距项,且得到的R方均大于0.9,请问R软件能得到这种形式的结果吗

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-5-21 07:16