全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
2023 2
2010-11-02
悬赏 50 个论坛币 已解决
昨天已经发过一个100论坛币悬赏贴,一位热心网友已经给我详细解答了那个macro代码的各个部分,我把他的答案设为最佳答案,也让大家参考学习一下。我还有几个问题求教各位。这是一个我组上在做的research,按照老板的要求和teammate的讨论,我需要往以下几个方向编代码,SAS新手在此再发两个悬赏帖竭诚向大家求教了。

Sample Data: StudentScore
  

StudentID

  
  

Year

  
  

Score

  
  

A

  
  

91

  
  

400

  
  

A

  
  

92

  
  

398

  
  

A

  
  

92

  
  

399

  
  

B

  
  

91

  
  

430

  
  

B

  
  

92

  
  

432

  
  

B

  
  

93

  
  

444

  
  

B

  
  

94

  
  

446

  
  

C

  
  

91

  
  

455

  
  

C

  
  

92

  
  

423

  
  

C

  
  

93

  
  

411

  
  

C

  
  

94

  
  

415

  
  

C

  
  

95

  
  

427

  
  

C

  
  

95

  
  

418

  

Q1. Create a variable called “inorde” which indicates whethera student’s score increased or decreased from the previous record in the data. Marka “0” for records where the student’s score was lower than the previous record.Conversely, mark a “1” for records where a student’s score was equal or higherthan the previous record. Mark a “0” for the first record of each student.

Q2. Write code to create a SAS dataset named“StudentScore2” by picking each student’s most recent score. If there aremultiple scores for the most recent year, then pick the highest one for thatyear.

Q3. Tag on the following variables to “StudentScore2” fromthe above question.

1.
HighScore: the highest score of each student. (Use“StudentScore” as the input)
2.
AvgScore: Average score for each student. (Use“StudentScore” as the input)
二维码

扫码加我 拉你入群

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

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

全部回复
2010-11-2 14:23:08
复制代码
二维码

扫码加我 拉你入群

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

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

2010-11-3 09:56:03
yellowriver  发表于 2010-11-2 14:23

soporaeternus 发表于 2010-11-2 14:23

终于知道了,什么是秒杀。。。
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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