楼主: zdlspace
1075 1

[程序分享] 做完面板固定效应后的模型形式检验,值得我们学习 [推广有奖]

  • 1关注
  • 81粉丝

学科带头人

91%

还不是VIP/贵宾

-

威望
2
论坛币
5654 个
通用积分
8082.2832
学术水平
519 点
热心指数
535 点
信用等级
508 点
经验
52330 点
帖子
1681
精华
0
在线时间
2680 小时
注册时间
2013-7-21
最后登录
2024-5-12

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
这来自一位大神Carlo Lazzaro关于做完固定效应之后的模型形式检验,贴过来学习一下。


if you go -robust- you have also taken into account possible autocorrelation of the epsilon residual.

That said, the most substantive post estimation test should be aimed at checking for possible model (or better regressand functional form) misspecification.
Take a look at the following toy-example, when an ancillary and an augmented regressions are run with -fitted- and -sq_fitted- values as predictors:
  1. [/size][/color][/font]
  2. [color=#252c2f][size=13px]webuse nlswork,clear[/size]
  3. [size=13px](National Longitudinal Survey.  Young Women 14-26 years of age in 1968)[/size]
  4. [size=13px]
  5. [/size]
  6. [size=13px]. xtreg ln_wage age, fe robust[/size]
  7. [size=13px]
  8. [/size]
  9. [size=13px]Fixed-effects (within) regression               Number of obs     =     28,510[/size]
  10. [size=13px]Group variable: idcode                          Number of groups  =      4,710[/size]
  11. [size=13px]
  12. [/size]
  13. [size=13px]R-sq:                                           Obs per group:[/size]
  14. [size=13px]     within  = 0.1026                                         min =          1[/size]
  15. [size=13px]     between = 0.0877                                         avg =        6.1[/size]
  16. [size=13px]     overall = 0.0774                                         max =         15[/size]
  17. [size=13px]
  18. [/size]
  19. [size=13px]                                                F(1,4709)         =     884.05[/size]
  20. [size=13px]corr(u_i, Xb)  = 0.0314                         Prob > F          =     0.0000[/size]
  21. [size=13px]
  22. [/size]
  23. [size=13px]                             (Std. Err. adjusted for 4,710 clusters in idcode)[/size]
  24. [size=13px]------------------------------------------------------------------------------[/size]
  25. [size=13px]             |               Robust[/size]
  26. [size=13px]     ln_wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval][/size]
  27. [size=13px]-------------+----------------------------------------------------------------[/size]
  28. [size=13px]         age |      0.018      0.001    29.73   0.000        0.017       0.019[/size]
  29. [size=13px]       _cons |      1.148      0.018    64.81   0.000        1.113       1.183[/size]
  30. [size=13px]-------------+----------------------------------------------------------------[/size]
  31. [size=13px]     sigma_u |  .40635023[/size]
  32. [size=13px]     sigma_e |  .30349389[/size]
  33. [size=13px]         rho |  .64192015   (fraction of variance due to u_i)[/size]
  34. [size=13px]------------------------------------------------------------------------------[/size]
  35. [size=13px]
  36. [/size]
  37. [size=13px]. predict fitted, xb[/size]
  38. [size=13px](24 missing values generated)[/size]
  39. [size=13px]
  40. [/size]
  41. [size=13px]. g sq_fitted=fitted^2[/size]
  42. [size=13px](24 missing values generated)[/size]
  43. [size=13px]
  44. [/size]
  45. [size=13px]. xtreg ln_wage fitted sq_fitted , fe robust[/size]
  46. [size=13px]
  47. [/size]
  48. [size=13px]Fixed-effects (within) regression               Number of obs     =     28,510[/size]
  49. [size=13px]Group variable: idcode                          Number of groups  =      4,710[/size]
  50. [size=13px]
  51. [/size]
  52. [size=13px]R-sq:                                           Obs per group:[/size]
  53. [size=13px]     within  = 0.1087                                         min =          1[/size]
  54. [size=13px]     between = 0.1006                                         avg =        6.1[/size]
  55. [size=13px]     overall = 0.0865                                         max =         15[/size]
  56. [size=13px]
  57. [/size]
  58. [size=13px]                                                F(2,4709)         =     507.42[/size]
  59. [size=13px]corr(u_i, Xb)  = 0.0440                         Prob > F          =     0.0000[/size]
  60. [size=13px]
  61. [/size]
  62. [size=13px]                             (Std. Err. adjusted for 4,710 clusters in idcode)[/size]
  63. [size=13px]------------------------------------------------------------------------------[/size]
  64. [size=13px]             |               Robust[/size]
  65. [size=13px]     ln_wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval][/size]
  66. [size=13px]-------------+----------------------------------------------------------------[/size]
  67. [size=13px]      fitted |      7.143      0.738     9.67   0.000        5.696       8.591[/size]
  68. [size=13px]   sq_fitted |     -1.816      0.219    -8.30   0.000       -2.245      -1.387[/size]
  69. [size=13px]       _cons |     -5.168      0.621    -8.32   0.000       -6.385      -3.950[/size]
  70. [size=13px]-------------+----------------------------------------------------------------[/size]
  71. [size=13px]     sigma_u |   .4039153[/size]
  72. [size=13px]     sigma_e |  .30245467[/size]
  73. [size=13px]         rho |  .64073314   (fraction of variance due to u_i)[/size]
  74. [size=13px]------------------------------------------------------------------------------[/size]
  75. [size=13px]
  76. [/size]
  77. [size=13px]. test sq_fitted[/size]
  78. [size=13px]
  79. [/size]
  80. [size=13px] ( 1)  sq_fitted = 0[/size]
  81. [size=13px]
  82. [/size]
  83. [size=13px]       F(  1,  4709) =   68.87[/size]
  84. [size=13px]            Prob > F =    0.0000[/size]
  85. [size=13px]
  86. [/size]
  87. [size=13px]. xtreg ln_wage age fitted sq_fitted , fe robust[/size]
  88. [size=13px]note: fitted omitted because of collinearity[/size]
  89. [size=13px]
  90. [/size]
  91. [size=13px]Fixed-effects (within) regression               Number of obs     =     28,510[/size]
  92. [size=13px]Group variable: idcode                          Number of groups  =      4,710[/size]
  93. [size=13px]
  94. [/size]
  95. [size=13px]R-sq:                                           Obs per group:[/size]
  96. [size=13px]     within  = 0.1087                                         min =          1[/size]
  97. [size=13px]     between = 0.1006                                         avg =        6.1[/size]
  98. [size=13px]     overall = 0.0865                                         max =         15[/size]
  99. [size=13px]
  100. [/size]
  101. [size=13px]                                                F(2,4709)         =     507.42[/size]
  102. [size=13px]corr(u_i, Xb)  = 0.0440                         Prob > F          =     0.0000[/size]
  103. [size=13px]
  104. [/size]
  105. [size=13px]                             (Std. Err. adjusted for 4,710 clusters in idcode)[/size]
  106. [size=13px]------------------------------------------------------------------------------[/size]
  107. [size=13px]             |               Robust[/size]
  108. [size=13px]     ln_wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval][/size]
  109. [size=13px]-------------+----------------------------------------------------------------[/size]
  110. [size=13px]         age |      0.130      0.013     9.67   0.000        0.103       0.156[/size]
  111. [size=13px]      fitted |      0.000  (omitted)[/size]
  112. [size=13px]   sq_fitted |     -1.816      0.219    -8.30   0.000       -2.245      -1.387[/size]
  113. [size=13px]       _cons |      3.034      0.229    13.23   0.000        2.585       3.484[/size]
  114. [size=13px]-------------+----------------------------------------------------------------[/size]
  115. [size=13px]     sigma_u |   .4039153[/size]
  116. [size=13px]     sigma_e |  .30245467[/size]
  117. [size=13px]         rho |  .64073314   (fraction of variance due to u_i)[/size]
  118. [size=13px]------------------------------------------------------------------------------[/size][/color]
  119. [color=#252c2f][size=13px]
复制代码


As expected, the -test- outcome shows that the regression model is misspecified (because -age- taken as the unique predictor cannot give a fair and true view of the data generating process under investigation. Moreover, -age- has a non-linear relatinship with the regressand, as it can be easily found out by replacing -age- with -c.age##c.age-).
[code]
xtreg ln_wage c.age##c.age, fe robust

Fixed-effects (within) regression               Number of obs     =     28,510
Group variable: idcode                          Number of groups  =      4,710

R-sq:                                           Obs per group:
     within  = 0.1087                                         min =          1
     between = 0.1006                                         avg =        6.1
     overall = 0.0865                                         max =         15

                                                F(2,4709)         =     507.42
corr(u_i, Xb)  = 0.0440                         Prob > F          =     0.0000

                             (Std. Err. adjusted for 4,710 clusters in idcode)
------------------------------------------------------------------------------
             |               Robust
     ln_wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |      0.054      0.004    12.52   0.000        0.045       0.062
             |
c.age#c.age |     -0.001      0.000    -8.30   0.000       -0.001      -0.000
             |
       _cons |      0.640      0.062    10.25   0.000        0.518       0.762
-------------+----------------------------------------------------------------
     sigma_u |   .4039153
     sigma_e |  .30245467
         rho |  .64073314   (fraction of variance due to u_i)
------------------------------------------------------------------------------
[/code]










二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:固定效应 fixed-effect Collinearity Regressions correlation

Raymond
Stata 17.0, MP(4)
沙发
2381289853 发表于 2021-4-26 23:15:17 来自手机 |只看作者 |坛友微信交流群
zdlspace 发表于 2021-1-14 17:30
这来自一位大神Carlo Lazzaro关于做完固定效应之后的模型形式检验,贴过来学习一下。
高手!!!

使用道具

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

本版微信群
加好友,备注jltj
拉您入交流群

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

GMT+8, 2024-6-17 19:12