楼主: chasedreamtrue
1572 1

帮我看看这道题 [推广有奖]

  • 0关注
  • 0粉丝

本科生

78%

还不是VIP/贵宾

-

威望
0
论坛币
123 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
781 点
帖子
82
精华
0
在线时间
12 小时
注册时间
2007-7-30
最后登录
2010-10-24

楼主
chasedreamtrue 发表于 2007-9-9 22:08:00 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
name birthday gender which race time
Smith, James 03-09-91 M 1 00:39:42
Smith, James 03-09-91 M 2 00:38:25
Anderson, Jim 05-27-79 M 1 00:36:10
Anderson, Jim 05-27-79 M 2 00:36:52
Milton, Karen 10-23-71 F 1 00:42:36
Milton, Karen 10-23-71 F 2 00:44:01
Cooper, Frances 02-13-82 F 1 00:46:47
(这个数据只是一部分)
就是说有两个比赛,有的人参加一次,也参加了另一次,还给出了每次所用的时间。
现在要求:
restructure the data set so there is only observation per runner with the
observation giving the name of the runner ,their sex ,age ,age group (Youth,
adult ,or Senior),the times for the two races and the best time.Print(
display)this new data set.
Female Youth(16 and under) Female Adult(17-49) Female Senior (50 and over) -
----

都快崩溃了,周围没有人够请教的的,只能上来问了。
1.知道了生日怎末求年龄呢?是不是只有知道了年龄才能用它给出的条件来分组呢?
2.还有就是一个名字出现两次怎样变成他只出现一次呢?
还不知道学的啥呢,就要考试了,谢谢大家指点.

二维码

扫码加我 拉你入群

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

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

关键词:observation restructure Structure Anderson observat

沙发
liujx80 发表于 2007-9-9 23:35:00
proc sort data =work; by name gender birthday;
proc transpose data = work out=work2;
by name gender birthday ;
id which_race;
var time;
run;
data work3( rename = ( _1 = race1 _2 = race2));
set work2;
age = year(today()) - year(birthday);
if age le 16 then age_group = '16 and under';
else if age le 49 then age_group = '17-49';
else age_group = '50 and over';
bestTime = min(_1, _2);
run;
proc print data =work3;
run;

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

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