楼主: jtengyp
92078 27

[面板数据求助] xtset和tsset区别 [推广有奖]

  • 0关注
  • 1粉丝

已卖:1份资源

副教授

10%

还不是VIP/贵宾

-

威望
0
论坛币
2448 个
通用积分
8.8700
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
3641 点
帖子
274
精华
0
在线时间
394 小时
注册时间
2012-7-5
最后登录
2025-10-18

楼主
jtengyp 发表于 2012-12-23 11:20:11 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币

求问,xtset和tsset的区别

二维码

扫码加我 拉你入群

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

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

关键词:TSSET xtset Set TSE TSS

沙发
蓝色 发表于 2012-12-23 11:37:30
There are two syntaxes for setting the data:

                tsset timevar

                tsset panelvar timevar

    In the first syntax -- tsset timevar -- the data are set to be a straight time series.

    In the second syntax -- tsset panelvar timevar -- the data are set to be a collection of time series, one for
    each value of panelvar, also known as panel data, cross-sectional time-series data, and xt data.  Such datasets
    can be analyzed by xt commands as well as ts commands.  If you tsset panelvar timevar, you do not need to xtset
    panelvar timevar to use the xt commands.

已有 2 人评分经验 学术水平 热心指数 收起 理由
happy_287422301 + 2 + 2 热心帮助其他会员
SpencerMeng + 60 + 1 观点有启发

总评分: 经验 + 60  学术水平 + 2  热心指数 + 3   查看全部评分

藤椅
fgleric 发表于 2012-12-23 11:45:51
如果是要处理panel data,两者等价;
如果处理费panel data,参见详细命令

板凳
jtengyp 发表于 2012-12-23 16:51:44
fgleric 发表于 2012-12-23 11:45
如果是要处理panel data,两者等价;
如果处理费panel data,参见详细命令
处理非面板数据的话,能不能介绍一下区别,我看不太懂

报纸
fgleric 发表于 2012-12-23 21:39:08
jtengyp 发表于 2012-12-23 16:51
处理非面板数据的话,能不能介绍一下区别,我看不太懂
处理非面板数据
xtset is used to declare the dataset is panel data, see example

webuse pig
xtset id week

declare data is panel with id as identifier and stub is week
.        xtset id week
        panel variable:        id (strongly        balanced)
        time variable:        week, 1 to 9
        delta:        1 unit

tsset is used to declare the data is time-series data, see example
use the same dataset as above:

. tsset week
repeated time        values        in        sample
r(451);

the reason of error is because week is not a time-series variable. list  week in 1/10

     | week |
     |------|
  1. |    1 |
  2. |    1 |
  3. |    1 |
  4. |    1 |
  5. |    1 |
     |------|
  6. |    1 |
  7. |    1 |
  8. |    1 |
  9. |    1 |
10. |    1 |


now show a case where tsset can be applied to time-series data
webuse dow1
tsset date



.             . tsset date
        time variable:  date, 02jan1953 to 20feb1990, but with gaps
                delta:  1 day

list date in 1/10

      |      date |
      |-----------|
   1. | 02jan1953 |
   2. | 05jan1953 |
   3. | 06jan1953 |
   4. | 07jan1953 |
   5. | 08jan1953 |
      |-----------|
   6. | 09jan1953 |
   7. | 12jan1953 |
   8. | 13jan1953 |
   9. | 14jan1953 |
  10. | 15jan1953 |





地板
peyzf 发表于 2012-12-28 13:31:13
learning.

7
jtengyp 发表于 2012-12-28 13:48:11
fgleric 发表于 2012-12-23 21:39
处理非面板数据
xtset is used to declare the dataset is panel data, see example
这么多英文

8
xinmincheung 发表于 2013-8-9 10:42:30
没懂啊

9
里甜甜 发表于 2013-12-10 22:57:16
新手入门,各种学习ing~

10
SpencerMeng 在职认证  发表于 2013-12-23 21:58:05
xtset和tsset对于平衡面板是一样的
有问题来发帖,来发帖没问题!
我尊重版规,一切为了学术!
Stata专版版规:https://bbs.pinggu.org/thread-1651470-1-1.html

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-16 16:19