全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
6365 3
2010-05-22
问比较 菜鸟的 问题  
我在用stata做数据分析的时候在comend 栏里, 输入了
第一步 : 先 tsset
tsset state_code year 后 出现
panel variable: state_code (unbalanced)
time variable: year, 1975 to 2008, but with gaps
delta: 1 unit
第二步 :为了去掉 “gaps” 输入了
  by state_code, sort: gen time=_n
. tsset state_code time
       panel variable:  state_code (unbalanced)
        time variable:  time, 1 to 32
                delta:  1 unit
第三步 :为了做 “balanced” 版面数据输入了
by state_code, sort: gen ind=_n
. list state_code year ind in 1/15
     +-----------------------+
     | state_~e   year   ind |
     |-----------------------|
  1. |        1   1975     1 |
  2. |        1   1976     2 |
  3. |        1   1977     3 |
  4. |        1   1978     4 |
  5. |        1   1979     5 |
     |-----------------------|
  6. |        1   1980     6 |
  7. |        1   1981     7 |
  8. |        1   1982     8 |
  9. |        1   1983     9 |
10. |        1   1984    10 |
     |-----------------------|
11. |        1   1985    11 |
12. |        1   1986    12 |
13. |        1   1987    13 |
14. |        1   1988    14 |
15. |        1   1989    15 |
     +-----------------------+
. keep if ind==32
(262 observations deleted)
. tsset state_code year
       panel variable:  state_code (strongly balanced)
        time variable:  year, 2008 to 2008
                delta:  1 unit
.
现在出现了 问题!!!!  time variable 出现了从 2008-2008  这个是为什么我的错误出现在哪里了?
请高手指点
二维码

扫码加我 拉你入群

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

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

全部回复
2010-5-22 18:12:03
一般为了消除共线性,都要用drop去掉一个虚拟变量
二维码

扫码加我 拉你入群

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

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

2010-5-23 11:03:10
谢谢您的指点, 您是说我的数据有共线性对吗?  从什么可以看出来呢 ?
或者首先进行 OLS的时候直接用“unbalanced”"wihi a gaps"数据进行的话会有什么不妥吗?
二维码

扫码加我 拉你入群

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

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

2010-5-28 05:30:45
while your method may solve the problem, it's error-prone and tedious. try this:

tsset  xxx
tsfill, full
    * sometimes, you need to fill in blanks for other variables
二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群