- 阅读权限
- 255
- 威望
- 13 级
- 论坛币
- 1096956 个
- 通用积分
- 77286.2949
- 学术水平
- 3447 点
- 热心指数
- 3906 点
- 信用等级
- 2743 点
- 经验
- 470093 点
- 帖子
- 11687
- 精华
- 5
- 在线时间
- 20154 小时
- 注册时间
- 2004-7-15
- 最后登录
- 2024-5-19
|
- input ///
- str10 x
- "1,6,7"
- "1,5,8,3"
- "5,6"
- "8,2,1"
- end
- split x, p(,) gen(new) destring
- egen vmax=rmax(new1-new4)
- list
复制代码- . clear
- . input ///
- > str10 x
- x
- 1. "1,6,7"
- 2. "1,5,8,3"
- 3. "5,6"
- 4. "8,2,1"
- 5. end
- .
- . split x, p(,) gen(new) destring
- variables born as string:
- new1 new2 new3 new4
- new1 has all characters numeric; replaced as byte
- new2 has all characters numeric; replaced as byte
- new3 has all characters numeric; replaced as byte
- (1 missing value generated)
- new4 has all characters numeric; replaced as byte
- (3 missing values generated)
- . egen vmax=rmax(new1-new4)
- . list
- +--------------------------------------------+
- | x new1 new2 new3 new4 vmax |
- |--------------------------------------------|
- 1. | 1,6,7 1 6 7 . 7 |
- 2. | 1,5,8,3 1 5 8 3 8 |
- 3. | 5,6 5 6 . . 6 |
- 4. | 8,2,1 8 2 1 . 8 |
- +--------------------------------------------+
复制代码
|
|