问比较 菜鸟的 问题
我在用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 这个是为什么我的错误出现在哪里了?
请高手指点