全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
2725 1
2010-05-21
问比较 菜鸟的 问题  

我在用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  这个是为什么我的错误出现在哪里了?
请高手指点
二维码

扫码加我 拉你入群

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

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

全部回复
2014-10-27 13:36:20
keep if ind==32,因为这一句你把很多观测值删掉了,只保留了ind==32的观测值
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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