全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
6462 3
2010-12-04

reshape long (变量名1), i((变量名2)) j((变量名3))

谁能够给解释一下,这三个变量分别是什么意思?哪个变量是在转换过程中变化的?哪个是不变的?

O(∩_∩)O谢谢

二维码

扫码加我 拉你入群

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

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

全部回复
2010-12-4 21:18:49
用help 自己查看吧,好像有例子的
二维码

扫码加我 拉你入群

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

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

2010-12-5 08:30:55
是啊
帮助里面的例子很容易看懂额的
    Before using reshape, you need to determine whether the data are in long or wide form.  You also
    must determine the logical observation (i) and the subobservation (j) by which to organize the
    data.  Suppose that you had the following data, which could be organized in wide or long form as
    follows:


                                            (wide form)           

                                   i         ....... x_ij ........
                                   id  sex   inc80   inc81   inc82
                                   -------------------------------
                                    1    0    5000    5500    6000
                                    2    1    2000    2200    3300
                                    3    0    3000    2000    1000


                                             (long form)      

                                        i     j           x_ij
                                       id   year   sex    inc
                                       -----------------------
                                        1     80     0   5000
                                        1     81     0   5500
                                        1     82     0   6000
                                        2     80     1   2000
                                        2     81     1   2200
                                        2     82     1   3300
                                        3     80     0   3000
                                        3     81     0   2000
                                        3     82     0   1000


    Given these data, you could use reshape to convert from one form to the other:

        . reshape long inc, i(id) j(year)  (goes from top form to bottom)
        . reshape wide inc, i(id) j(year)  (goes from bottom form to top)
二维码

扫码加我 拉你入群

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

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

2010-12-5 11:24:11
弄明白了,谢谢楼上各位
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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