全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
3994 2
2013-03-05
rt,谢谢!
二维码

扫码加我 拉你入群

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

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

全部回复
2013-3-5 02:50:45




Title

    [D] order -- Reorder variables in dataset


Syntax

        order varlist [, options]

    options           Description
    ---------------------------------------------------------------------------------------------------
    first             move varlist to beginning of dataset; the default
    last              move varlist to end of dataset
    before(varname)   move varlist before varname
    after(varname)    move varlist after varname
    alphabetic        alphabetize varlist and move it to beginning of dataset
    sequential        alphabetize varlist keeping numbers sequential and move it to beginning of
                        dataset
    ---------------------------------------------------------------------------------------------------


Menu

    Data > Data utilities > Change order of variables


Description

    order relocates varlist to a position depending on which option you specify.  If no option is
    specified, order relocates varlist to the beginning of the dataset in the order in which the
    variables are specified.


Options

    first shifts varlist to the beginning of the dataset.  This is the default.

    last shifts varlist to the end of the dataset.

    before(varname) shifts varlist before varname.

    after(varname) shifts varlist after varname.

    alphabetic alphabetizes varlist and moves it to the beginning of the dataset.  For example, here is
        a varlist in alphabetic order:  a x7 x70 x8 x80 z.  If combined with another option, alphabetic
        just alphabetizes varlist, and the movement of varlist is controlled by the other option.

    sequential alphabetizes varlist, keeping variables with the same ordered letters but with differing
        appended numbers in sequential order.  varlist is moved to the beginning of the dataset.  For
        example, here is a varlist in sequential order: a x7 x8 x70 x80 z.


Examples

    Setup
        . webuse auto4

    Describe the dataset
        . describe

    Move make and mpg to the beginning of the dataset
        . order make mpg

    Describe the dataset
        . describe

    Make length be the last variable in the dataset
        . order length, last

    Describe the dataset
        . describe

    Make weight be the third variable in the dataset
        . order weight, before(price)

    Describe the dataset
        . describe

    Alphabetize the variables
        . order _all, alphabetic

    Describe the dataset
        . describe
二维码

扫码加我 拉你入群

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

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

2013-3-5 09:20:34
蓝色 发表于 2013-3-5 02:50
Title

    [D] order -- Reorder variables in dataset
谢谢
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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