楼主: freesky521
20931 12

[其他] 怎么查找变量中的某个值 [推广有奖]

11
hplcdadong 发表于 2012-4-4 05:15:21
The following is a better one to convert the string "id" variable:

destring id, gen (id_n1)

then change the last command as follows:

collapse (sum) export (min) id_min=id_n1 (max) id_max=id_n1, by(group)

已有 1 人评分学术水平 热心指数 信用等级 收起 理由
ywh19860616 + 1 + 1 + 1 so kindly.

总评分: 学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

12
freesky521 发表于 2012-4-4 12:19:38
hplcdadong 发表于 2012-4-4 05:15
The following is a better one to convert the string "id" variable:

destring id, gen (id_n1)
刚才有试了一下。出现了r(111) error . . . . . . . . . . . . . . . . . . . . . . . .  Return code 111
        __________ not found;
        no variables defined;
        The variable does not exist.  You may have mistyped the
        variable's name.
        variables out of order;
        You specified a varlist containing varname1-varname2, yet
        varname1 occurs after varname2.  Reverse the order of the
        variables if you did not make some other typographical error.
        Remember, varname1-varname2 is taken by Stata to mean varname1,
        varname2, and all the variables in dataset order in between.
        Type describe to see the order of the variables in your dataset.
        __________ not found in using data;
        You specified a varlist with merge, yet the variables on which
        you wish to merge are not found in the using dataset, so the
        merge is not possible.
        __________ ambiguous abbreviation;
        You typed an ambiguous abbreviation for a variable in your data.
        The abbreviation could refer to more than one variable.  Use a
        nonambiguous abbreviation or, if you intend all the variables
        implied by the ambiguous abbreviation, append a `*' to the end
        of the abbreviation.
有付出总有回报。相信未来是美好的。。加油!!!

13
hanlinxian246 发表于 2016-4-29 10:18:14
学写了!

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

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