楼主: 禅那
11476 6

【求助】STATA可以换列的位置么? [推广有奖]

  • 1关注
  • 2粉丝

已卖:187份资源

硕士生

34%

还不是VIP/贵宾

-

威望
0
论坛币
1278 个
通用积分
0
学术水平
0 点
热心指数
2 点
信用等级
0 点
经验
478 点
帖子
31
精华
0
在线时间
250 小时
注册时间
2010-4-18
最后登录
2017-2-19

楼主
禅那 发表于 2010-6-10 15:39:14 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
RT
STATA可以随意拖动改变列的位置么?
还是用什么命令才能调整?
比如我想把最后一列调到第一列应当怎么做呢?
多谢版主啦!
二维码

扫码加我 拉你入群

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

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

关键词:Stata tata 怎么做 求助 位置 Stata

沙发
houquan 发表于 2010-6-10 17:15:38
1# 禅那

help order                                                                                                                                 dialog:  order
---------------------------------------------------------------------------------------------------------------------------------------------------------

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


Also see

    Manual:  [D] order

      Help:  [D] describe, [D] edit, [D] rename
已有 1 人评分论坛币 收起 理由
dxystata + 5 根据规定进行奖励

总评分: 论坛币 + 5   查看全部评分

We all love to instruct, though we can teach only what is not worth knowing. -- J. Austen

藤椅
小洋芋 发表于 2010-6-11 19:05:58
楼上说的是stata11的 order吧,好像10的版本没有option吧,不过10的可以用下面的order或是move 两个命令
Move specified variables to front of dataset
order varlist
Move one variable to specified position
move varname1 varname2
已有 1 人评分论坛币 热心指数 收起 理由
arthistory4 + 5 + 1 好的意见建议

总评分: 论坛币 + 5  热心指数 + 1   查看全部评分

板凳
johnayl 发表于 2010-6-16 05:36:49
there is an old command for stata 9 and prior:
ssc install placevars

报纸
danshenyazi 发表于 2010-6-17 15:18:34
yes ,use the command "move"
sample: move var1 var2

地板
神神的坤坤 发表于 2020-4-12 10:19:39
新版本可help order 查看具体操作方法

7
xjtuYM 发表于 2024-8-30 20:08:03
目前感觉最方便的方法就是使用move语句,如果想实现博主说的这个情况,就是move 最后一列变量名 第二列变量名

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

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