楼主: Dylan890328
1800 1

[程序分享] 一道SAS基础题重金悬赏,求程序 [推广有奖]

  • 0关注
  • 0粉丝

硕士生

36%

还不是VIP/贵宾

-

威望
0
论坛币
2 个
通用积分
0
学术水平
3 点
热心指数
0 点
信用等级
0 点
经验
931 点
帖子
76
精华
0
在线时间
184 小时
注册时间
2010-9-15
最后登录
2022-6-22

楼主
Dylan890328 发表于 2010-10-6 16:33:11 |AI写论文
20论坛币
一道SAS基础题重金悬赏,求程序. (题中的参考帮助来自 SAS Certification Prep Guide Base Programming for SAS 9的第14章)

Assignment:


Create a data set with the following attributes. Arrays and material from chapter 14 should help.

Use a do loop to create a variable i that goes from 0 to 9.
 Use a do loop to create a variable j that goes from 0 to 9 for each value of i.
 Create a variable k that is the sum of i times 10 plus j. (k will count from 0 to 99).
 Create an array x of 10 variables named x1 through x10. For each observation, the value of x1 is 1 divided by the current value of k, x2 is 2 over k, x3 is 3 over k, and so on.
Create a variable m that takes the value of `ODD' for odd value of k and `EVEN' for even values of k.
 Create a variable n that takes the value of i written out (i.e. n = `Zero' for i = 0).
 Create a variable o that takes the value of j written out (i.e. o = `Zero' for j = 0).
 Create a variable p that concatenates n and o (no spaces) and converts it to all uppercase.
 Create a variable q that removes all instances of the substring `ON' from p and replaces them with `NO'.
Create a variable r that takes only the rst two characters of q
 Output to the data set for every value of k.


As a hint, the data set should have 100 observations and 19 variables.

HW5.pdf
下载链接: https://bbs.pinggu.org/a-764296.html

57.72 KB

题目原本

关键词:sas基础 重金悬赏 基础题 observations observation following material Create create should

沙发
hopewell 发表于 2010-10-6 16:33:12
  1. data temp;
  2.     length i j k 8 x1-x10 8 m $4 n o $5 p q $10 r $2;
  3.     array x{10};
  4.     do i=0 to 9;
  5.         do j=0 to 9;
  6.             k=i*10+j;
  7.             do l=1 to dim(x);
  8.                 x(l)=round(k/l, .01);
  9.             end;
  10.             m=ifc(mod(k,2)=1,'ODD','EVEN');
  11.             n=propcase(put(i,words5.));
  12.             o=propcase(put(j,words5.));
  13.             p=upcase(cats(n,o));
  14.             q=tranwrd(p,'ON','NO');
  15.             r=substr(q,1,2);
  16.             output;
  17.         end;
  18.     end;
  19.     drop l;
  20. run;
复制代码
已有 1 人评分学术水平 热心指数 信用等级 收起 理由
Dylan890328 + 1 + 1 + 1 精彩帖子

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

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

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