a***o 发帖数: 1607 | 1 一个变量x,x有100个值,怎么调用其中任何一个值呢?比如第10个
在matlab里面,直接用x(10)就可以了,SAS没用过,不知道怎么弄?
谢谢! |
d*******1 发帖数: 854 | 2 you need to change your mindset when you switch from R, matlab to SAS, which
is a basically data language.
If your variable x is stored in a data set in which variable x has 100
observation. such as
data test;
do i=1 to 100;
x=rnorm(1); output;
end;
run;
One way to call them is to make every observation a macro variable as
follows:
data _null_;
set test;
call symput('x_'||trim(left(put(_n_,best.))),trim(left(put(x,best.))));
run;
Now, you can call any x by using macro
【在 a***o 的大作中提到】 : 一个变量x,x有100个值,怎么调用其中任何一个值呢?比如第10个 : 在matlab里面,直接用x(10)就可以了,SAS没用过,不知道怎么弄? : 谢谢!
|
o****o 发帖数: 8077 | 3 sas Data Steps and many statistical procedures support array as in other
programming languages
declare a 2-D array as :
array _A_{n1, n2} /* pre-set names; or _temporary_ */
refer any array elements with their subscripts, just as in other languages
【在 a***o 的大作中提到】 : 一个变量x,x有100个值,怎么调用其中任何一个值呢?比如第10个 : 在matlab里面,直接用x(10)就可以了,SAS没用过,不知道怎么弄? : 谢谢!
|
A*****s 发帖数: 13748 | 4 是不是应该看看SAS/IML Guide
我最近也在头疼这个问题
【在 a***o 的大作中提到】 : 一个变量x,x有100个值,怎么调用其中任何一个值呢?比如第10个 : 在matlab里面,直接用x(10)就可以了,SAS没用过,不知道怎么弄? : 谢谢!
|
q********i 发帖数: 795 | 5 read them into iml and process as a vector... |