由买买提看人间百态

topics

全部话题 - 话题: var4
1 (共1页)
t**j
发帖数: 418
1
来自主题: Statistics版 - help about initial value in retain statement
data a;
set b;
by var1 var2;
if first.var1 or first.var2 then var4=var3;
retain var4; var4=var4*var3;run;
why for observations are first.var1 or first.var2, var4 is the square of
var3 but not var3?
thanks a lot!
r**********y
发帖数: 49
2
Given the text file COLORS.TXT:
----+----1----+----2----+----
RED ORANGE YELLOW GREEN
BLUE INDIGO PURPLE VIOLET
CYAN WHITE FUCSIA BLACK
GRAY BROWN PINK MAGENTA
The following SAS program is submitted:
data WORK.COLORS;
infile 'COLORS.TXT';
input @1 Var1 $ @8 Var2 $ @;
input @1 Var3 $ @8 Var4 $ @;
run;
What will the data set WORK.COLORS contain?
A
Var1 Var2 Var3 Var4
------ ------ ------ ------
RED ORANGE RED ORANGE
BLUE IND... 阅读全帖
e*******e
发帖数: 75
3
来自主题: Statistics版 - [急求助] survival analysis (SAS)
我再用survival analysis 作分析的时候,用了下面的程序却发现问题:
%macro eun5(var1,var2,var3,var4,var5,var1T,var2T,var3T,var4T,var5T);
PROC PHREG DATA=ONE;
MODEL SURV*CENSOR(1)= &VAR1 &VAR2 &VAR3 &VAR4 &VAR5 &VAR1T &VAR2T &VAR3T &
VAR4T &VAR5T;
&VAR1=VAR1*LOG(SURV);
&VAR2=VAR2*LOG(SURV);
&VAR3=VAR3*LOG(SURV);
&VAR4=VAR4*LOG(SURV);
&VAR5=VAR5*LOG(SURV);
PROPORTIONALITY_TEST: TEST &VAR1T, &VAR2T, &VAR3T, &VAR4T, &VAR5T;
%MEND;
%EUN5 (YR1,YR2,YR3,YR4,YR5,YR1T,YR2T,YR3T,YR4T,YR5T);
最后总是出现:
error: variable var5 is not found
h******e
发帖数: 1791
4
一个繁琐的方法:
data test;
input var1 $ var2 var3;
datalines;
a . 1.1
a 5 .
a 6 .
b 5 0
b 5 0
b 7 .
;
run;
data t1;
set test;
by var1;
if first.var1 then var4 = 1;
else if first.var1 = 0 and last.var1 = 0 then var4 = 2;
else if last.var1 then var4 = 3;
run;
proc transpose data = t1 out = t2;
by var1 var2;
id var4;
var var3;
run;
data t3;
set t2;
if _1 > 0 or _2 >0 or _3 >0 then do;
_1 = 1.1;
_2 = 1.1;
_3
t********m
发帖数: 939
5
来自主题: Statistics版 - 请教proc sql处理missing value的问题
原data set如下:
ID Session var1 var2 var3 var4
1 1 10 . .
1 1 . 20 .
1 1 . . 30
1 1 . . . black
1 2 11 . .
1 2 . 22 .
1 2 . . . white
想要得到的data set如下:
ID Session var1 var2 var3 var4
1 1 10 20 30 black
1 2 11 22 . white
所用的程序如下:
proc sql;
create table short as
select ID, Session,
max(var1) as var1,
max(var2) as var2,
max(var3) ... 阅读全帖
b********1
发帖数: 291
6
来自主题: Programming版 - A join B, spark里面怎么写?
你们都是聪明人,谁能帮忙写个例子。 就算是1对多的join.
a的变量假设是var1, var2,var3
b的变量假设是var4,var5,var6
假设var1,var4是primary key, foreign key的关系。
不管是用scala, python 还是rdd spark.
我打算先看懂哪个就学哪个.
本人编程零基础, 只会写query.
说穿了,我就是想要 create table c as
select a.*, b.var5, b.var6
from a
join b
on a.var1=b.var4
然后把c下载到excel里面看看.
网上看了半天教程, 都是天马行空的东西。
我就奇了怪了, 这么简单的事情,hadoop上怎么就这么难实现?
x*******u
发帖数: 500
7
来自主题: Statistics版 - 请问如果用SAS 解决这个问题
my data:
var1 var2 var3 var4
2 4 6 7
4 9 7 6
5 2 1 1
如何得到一个新的variable, 它的值是var1-var4中有最大值的那个variable的名字。
结果应该是
newvar
var4
var2
var1
谢谢
A*****s
发帖数: 813
8
来自主题: ChinaStock版 - 指标2:夺宝奇兵
希望大家能多一些指标制作的讨论
来源:MACD论坛 作者:林夕
主图指标,在大智慧里勾选主图叠加,否则字看不清楚
使用:白K买入。黄K加仓。绿K出局。笑脸买入。黄点出局。X3线向下不可买入,或以
抢反弹思路操做。m,K,R顶底提示背离状态。不做为操作主要依据。买入。卖出应结合
均线法则综合研判。粘合后向上发散为最佳。该指标缺少量元素。应配合成交量综合观
察。寻求多要素共振。
Var1:=EMA(C,3);
Var2:=EMA(C,5);
Var3:=EMA(C,10);
Var4:=EMA(C,20);
Var5:=EMA(C,30);
Var6:=(Var2+Var3+Var4+Var5)/4;
Var7:=(Var6-REF(Var6,15))/REF(Var6,15)*100;
Var8:=(Var6-REF(Var6,15))/REF(Var6, 15)*100;
Var9:=EMA(Var7,8);
STICKLINE(Var7<1*REF(Var7,1),h,l,0.5,0),COLORBLUE;{蓝-持币}
STICKLINE(Var7<1*REF(Var7,1),o,c
e****e
发帖数: 179
9
来自主题: Unix版 - read file help!
I have a data file like this:
A B C D
1 2 3 4
2 3 3 34
* * * *
I want to read these number and assign them to some variables, something like:
1st time:
var1=1, var2=2 var3=3, var4=4
then do something with these Var*
then 2nd time
var2=2, var2=3, var3=3 var4=34
then do something....
and so on.
How to do it in C shell script?
Thanks.
cat
p********a
发帖数: 5352
10
来自主题: Statistics版 - [合集] 一个SAS数据合并的问题
☆─────────────────────────────────────☆
Bighappy (快乐大大大) 于 (Fri Apr 6 14:47:46 2007) 提到:
大侠帮忙看看下面的程序:
data dataA;
input var1 var2;
datalines;
1.2 2.0
4.2 3.2
3.8 1.8
6.0 9.3
7.5 5.4
8.6 7.2
;;;;
data dataB;
input var3 var4;
datalines;
2.1 2.4
2.3 7.2
3.4 2.8
9.4 5.5
5.5 5.9
7.8 7.2
1.1 1.4
4.5 6.5
;;;;
data new;
merge dataA dataB;
run;
proc print; run;
产出的结果如下:
Obs var1 var2 var3 var4
1 1.2 2.0 2.1
a***r
发帖数: 420
11
来自主题: Statistics版 - 怎样用R定位变量的位置
抛砖引玉
#original matrix: A
#new matrix: X
#number of obs:n
#number of var:nvar
> A
var1 var2 var3 var4 var5
1 1 2 3 4 5
2 6 7 8 9 10
3 11 12 13 14 15
4 16 17 18 19 20
>n=4
>nvar=5
>value <-as.vector(t(A))
>varname <-rep(colnames(A),n)
>ID <-sort(rep((1:n),nvar))
>X <-data.frame(cbind(ID,varname,value))
ID var value
1 1 var1 1
2 1 var2 2
3 1 var3 3
4 1 var4 4
5 1 var5 5
6 2 var1 6
7 2 var2 7
8 2 var3
r*****g
发帖数: 99
12
来自主题: Statistics版 - How to change sas dataset column order
请教:
我有一个dataset 有一下variables:var1, var2, var4, var3
我想把var3 放到var4 前面,
除了把dataset export 到excel 然后借助excel 来switch order.有没有简便易行的
sas code可以解决这个问题呢?
谢谢啦!
h********o
发帖数: 103
13
来自主题: Statistics版 - 请教大家 这个SAS小程序怎么编
DATA ONE;
INPUT VAR $ @@;
CARDS;
A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14
;
DATA ONE;
SET ONE;
RETAIN ID ;
IF MOD(_N_, 5) = 1 THEN ID + 1;
RUN;
PROC TRANSPOSE DATA = ONE OUT = TWO (DROP = _NAME_ ID
RENAME = (COL1 = VAR1
COL2 = VAR2
COL3 = VAR3
COL4 = VAR4
C... 阅读全帖
l*********s
发帖数: 5409
14
来自主题: Statistics版 - 请问如果用SAS 解决这个问题
having baozi bu?
data result;
length name $8;
set A;
array aa{*} var1-var4;
do i=1 to dim(aa);
if aa{i}=max(of var1-var4) then name=vname(comp{i});
end;
drop i;
run;
l******o
发帖数: 3764
15
现在有一个dependent variable (dep1), 几个predictors (var1 var2 var3 var4)
var1是个categorical variable,求dep1在var1的几个level上的adjusted means
我以前都这么做(只会这一个)
proc glm data=xxx;
class var1;
model dep1=var1 var2 var3 var4;
lsmeans var1;
run;
但是这次我的var1是ordinary的(其实var1是我把一个continuous variable分成的
quintile),我这样用是不是就把var1的几个categories当成无序的处理了,会lose
power吧?
我记得老师讲过大概应该是先得出var1=0时dep1的值,然后var1=1时dep1的值就是加上
1 x beta of var1, 以此类推,是这样吗?
可是俺不会sas code 请好心的高手指教
多谢多谢
t********m
发帖数: 939
16
if var1 in ('x','y','z') or var2 in ('x','y','z') or var3 in ('x','y','z
') or var4 in ('x','y','z') then target=1; else target=0;
就是只要var1-var4里面任何一个变量含有x或y或z,目标变量就等于1,否则为0。
上述程序很繁琐,能不能用array来优化一下啊?多谢指教!
t*******t
发帖数: 633
17
这个可以啵?
data test;
input var1 $ var2 $ var3 $ var4 $ var5;
cards;
x 8 2 1 4
3 4 5 21 2
0 z 88 45 2
;
run;
data test2;
set test;
array var{4} var1-var4;
do i=1 to 4;
if var{i} in ('x','y','z') then target=1;
end;
if missing(target) then target=0;
run;
s******r
发帖数: 1524
18
if var1 in ('x','y','z') or var2 in ('x','y','z') or var3 in ('x','y','z
') or var4 in ('x','y','z')
does not mean var1-var4 is one-letter variable. It could be
'xag','x','yz'.
So only the second one meets LZ's requirement.
t********m
发帖数: 939
19
这个works,非常感谢!我自己写的时候,没用missing function,而是用了下面的if.
..else,所以逻辑怎么都搞不对,要么是不加output,只输出最后的var4满足条件的
records;要么就是加output,最后每个var满足的records都被输出了,其中难免有重
复的。Thanks again!
data test;
set test;
array var(4) var1-var4;
do i=1 to 4;
if drugid(i) in ('x','y','z') then steroid=1;
else steroid=0;
*output;
end;
run;
k*******a
发帖数: 772
20
来自主题: Statistics版 - help about initial value in retain statement
var4=var3 => var4=1
c**d
发帖数: 104
21
来自主题: Statistics版 - 包子问题请教( sas)
in the model: y = var1|var2|var3|var4 @2 /stepwise;
give you all 2-way interactions.
1. using proc contents output the variable name data
2: using proc sql to create a macro variable to paste your variables to be
var1|var2|var3|var4|.....
3: in the model y = &varlist. @2 /stepwise;
q**********9
发帖数: 711
22
来自主题: Statistics版 - 包子问题请教( sas)
proc glm 可以用 model y = var1|var2|var3|var4 @2;
但是option 里没有stepwise选项,
proc reg 有stepwise 选项,但是不能用 model y = var1|var2|var3|var4 @2这个命令,
我的sas 里没有proc glmselect 命令,现在该用哪个 proc 命令呢?
H*******r
发帖数: 98
23
来自主题: Statistics版 - 编程菜鸟问一个sas编程问题
one is...
data select;
set original;
where var1 in (value1 value2 value3 value4 value5 value6 value7 value8)
or
var1 between minvalue and maxvalue or
var2 in (number1 number2 number3) or
var3 in (number1 number2 number3) or
var4 in (number1 number2 number3) or
var5 in (number1 number2 number3) or
var6 in (number1 number2 number3) or
var7 in (number1 number2 number3) or
var8 in (number1 number2 number3) or
... 阅读全帖
a**t
发帖数: 57
24
来自主题: Statistics版 - 求SAS高手解题
菜鸟好不容易有个PHONE INTERVIEW,之后给了题让坐做完发回去,高手们其帮忙给个
解答,第9题以后开始就行了,也许其他人也可用上。
The test below is designed to gauge your level of SAS experience. Feel free
to reference any sources of help (SAS documentation, etc.) you would
normally use in the course of developing code. We are looking for your
general knowledge of concepts, so please DO NOT spend too much time trying
to perfect minor details of syntax. We understand that writing code without
the chance to run it to discover errors can be difficult.
The ... 阅读全帖
y*****l
发帖数: 5997
25
来自主题: _pennystock版 - 讨论:什么样的股适合抄底?
送你个抄底专用公式。
赚钱成功率90%的通达信公式源码-特别适合下跌中选股及反弹和上涨专用揭底专用
作者:admin 文章来源:百科原创 点击数:5620 更新时间:2008-7-6
一个普通指标:一个指标关键不是在好坏,而是看你怎么运用,怎么把握时机!简洁为上,
多验为准,且进出只能机械性进出,就更能减少错误操作!
YJD到-80以下进场,特别是下午进场特稳,90%第二天有赚,(跌停板勿去抢)
自己验证,注意,信号发生时第二根线买进,要是下行就在快收线时买进,要是上行就马
上抢进,如果前根线收下影线更要果断抢进,下50%资金,准确率可达95%,万一再下探
5%再进50%资金,想亏都难罗!! (本指标最适合下跌中选股了,还有反弹和上涨专用的
哦)
多验证哦,熟悉了再用!包你不怕大跌了,赚也别贪,快进快出!买的好不如卖的好!
名称:揭底专用
(用法:YJD<-80,S1>S2时择低进场!最好下半场找机会进场更无一失!)
正负100涵数是含未来的.不过没事放心用,无任何影响,因为指标极限只设到正负
100,超过了就钝化走平了,也就是指标躺在-100不动了,偶尔会在-95-... 阅读全帖
B*********L
发帖数: 700
26
来自主题: Database版 - 这个query怎么写?
谢谢了。
看来的确没有特别简洁的办法。俺不死磕了,现在比较罗嗦的设了4个variable, in (
@var1,@var2,@var3,@var4),凑合用了。
a**n
发帖数: 313
27
来自主题: Unix版 - read file help!
In Bourne shell..
#############################
#if you file is like "a b c d"
#!/bin/sh
while read var1 var2 var3 var4
do
: #the command you want
done < filename
##############################
w*****1
发帖数: 473
28
来自主题: Mathematics版 - 请教proc transpose 问题 (转载)
【 以下文字转载自 Statistics 讨论区 】
发信人: wz99331 (dotti), 信区: Statistics
标 题: 请教proc transpose 问题
发信站: BBS 未名空间站 (Wed Oct 25 15:16:10 2017, 美东)
我想用proc transpose 把long data 转化为wide data,但是转化以后的column name
变成了var1, var2 var3 var4....,而不是原来的probe_id。我用了profix=probe_id,
结果column name 变成了probe_id1, probe_id2...,而不是原来的PROBE_ID,我希望转
化以后的column name 是ILMN_1762337,ILMN_2055271......
下面是 long data的部分数据,从第三个变量开始是sample name,下面的数据是gene
expression level,一共有几百个sample, 几十万个probe.
PROBE_ID SYMBOL 5117-H471Fwk12-... 阅读全帖
w*****1
发帖数: 473
29
来自主题: Mathematics版 - 请教proc transpose 问题 (转载)
【 以下文字转载自 Statistics 讨论区 】
发信人: wz99331 (dotti), 信区: Statistics
标 题: 请教proc transpose 问题
发信站: BBS 未名空间站 (Wed Oct 25 15:16:10 2017, 美东)
我想用proc transpose 把long data 转化为wide data,但是转化以后的column name
变成了var1, var2 var3 var4....,而不是原来的probe_id。我用了profix=probe_id,
结果column name 变成了probe_id1, probe_id2...,而不是原来的PROBE_ID,我希望转
化以后的column name 是ILMN_1762337,ILMN_2055271......
下面是 long data的部分数据,从第三个变量开始是sample name,下面的数据是gene
expression level,一共有几百个sample, 几十万个probe.
PROBE_ID SYMBOL 5117-H471Fwk12-... 阅读全帖
s******r
发帖数: 1524
30
proc sort data=test;by var1 descending var3 ;run;
data t1;
set test;
by var1;
if first.var1 then do;
if var3>0 then varx=var3;else varx=.;
end;
var4=max(var3,varx);
retain varx;
drop varx;
run;
w********5
发帖数: 72
31
来自主题: Statistics版 - 请教一下SAS编程的一个问题
This is my answer. My codes are alway very long and not efficient. Please
help simlify.
data data1;
input var1;
cards;
5
6
;
run;
data data2;
input var2;
cards;
5
6
;
run;
data new;
infile datalines dlm=" ";
input name $ var $ ;
datalines;
data1 var1
data2 var2
data2 var2
data4 var4
;
run;
proc sql;
select name into:name1-:name&SYSMAXLONG
from new;
select var into:col1-:col&&SYSMAXLONG
from new;
quit;
%put _user_;
option mprint mlogic;
%macro mutiple;
%do i=1 %to &sqlobs;
proc so
z****n
发帖数: 67
32
对下面这个data set我想实现的是针对每一行检查相应的变量var1 到变量var6。 如果
值在0 到
50之间的话,就把每一个相应的变量名称存在一个macro variable,并且以空格隔开。
所以最终
我要的结果是:
根据第1行有个macro variable叫做list1, 在list1里面存有变量var6
根据第2行有个macro variable叫做list2, 在list2里面存有变量var5 var6
根据第3行有个macro variable叫做list3, 在list3里面存有变量var4 var6
根据第4行有个macro variable叫做list4, 在list4里面是空的
并且每一行的新建的宏变量名,都要以该行的行序数结尾,比如1到4行,宏变量名相应
的为list1到list4
关键难点在于实际工作中我有300多个变量,所以必须一开始就把满足条件的变量名存在宏变量里
面,因为宏变量不会有长度的问题。如果先建立一个string变量存储那些满足条件的变量名,然后
再放到宏变量里面结果会有问题。因为string变量的长度会不够(SAS字符变量最大长度是200
f*******e
发帖数: 51
33
try this:
data countmiss;
input var1 var2 var3 var4 var5 var6;
cards;
0 0 0 0 0 1.2
0 0 0 0 5.8 4.7
58.8 0 0 30 0 33.3
100 0 0 100 0 66.6
;
run;
data _null_;
set countmiss;
array var(*) var1-var6;
call symput("list"||strip(_N_),"");
do i=1 to dim(var);
if var(i)>0 and var(i) <50 then do;
call symput("list"||strip(_N_),symget("list"||strip(_N_))||" "||"var"||strip
(i));
end;
end;
run;
%put &list1 &list2 &list3 &list4;
z****n
发帖数: 67
34
多谢楼上提醒,把楼上的code改成下面的就可以运行啦!
data countmiss;
input var1 var2 var3 var4 var5 var6;
cards;
0 0 0 0 0 1.2
0 0 0 0 5.8 4.7
58.8 0 0 30 0 33.3
100 0 0 100 0 66.6
;
run;
data _null_;
set countmiss;
array v(*) var1-var6;
call symput("list"||compress(_N_),"");
do i=1 to dim(v);
if 0< v(i) <50 then do;
call
symput("list"||compress(_N_),left(trim(symget("list"||compress(_N_))||"
"||"
var"||compress(i))));
end;
end;
run;
%put list1=&list1 ;
%put list2=&list2 ;
%put list3=&list3 ;
%put list4=&lis
k*******a
发帖数: 772
35
来自主题: Statistics版 - How to change sas dataset column order
data step 不清楚, 用sql很容易啊
proc sql;
create table new as
select var1,var2,var4,var3
from a;
quit;
w*****e
发帖数: 806
36
来自主题: Statistics版 - How to change sas dataset column order
DATA RENEW;
RETAIN VAR1 VAR2 VAR3 VAR4;
SET OLD;
RUN;
y******6
发帖数: 47
37
来自主题: Statistics版 - mixed models
I have a question about mixed models too. For example, Var1 is location(
cities), Var2 is treatment, Var3 is Time (season) Var4 is Year(2008,2009,
2010). I want to make comparsions to see whether 2008,2009 and 2010 have the
same mean or not within each treatment.
proc mixed data= method=type3;
where treatment='Treatment1';
class Location Time Year;
Model counts=time year time*year;
random location;
run;
Type3 tests of fix effects: year, p-value<0.05
While if I change the random from location to ... 阅读全帖
k*******a
发帖数: 772
38
来自主题: Statistics版 - 请问如果用SAS 解决这个问题
你可以用array,也可以用proc transpose
如果用transpose你可以:
data b;
set a;
ID=_N_;
run;
proc transpose data=b out=c;
var var1-var4;
by ID;
run;
proc sort data=c;
by ID descending col1;
run;
data d(keep=newvar);
set c;
by ID descending col1;
if first.ID;
newvar=_name_;
run;
d******9
发帖数: 404
39
来自主题: Statistics版 - 请问如果用SAS 解决这个问题
I used array to do it, same results:
proc format;
value position
1='A'
2='B'
3='C'
4='D';
run;
data E(drop=I) ;
set A;
array X(4) A B C D;
do I=1 to 4;
if X(I)= max(A, B, C, D) then Position=I;
end;
Max_Var=put(position, position.);
run;
However, what if the values have ties? say:
var1 var2 var3 var4
9 9 3 4
9 2 9 8
9 9 9 9
????????
l****u
发帖数: 529
40
来自主题: Statistics版 - 请问如果用SAS 解决这个问题
with and w/o ties:
%macro new;
data new(drop=i max);
set yourdata;
max=max( of var1-var4);
length new $8.;
%do i=1 %to 4;
if var&i=max then do;
new="var&i";
output;
end;
%end;
run;
%mend;
%new
o****o
发帖数: 8077
41
来自主题: Statistics版 - 请问如果用SAS 解决这个问题
data _xxx;
input var1 var2 var3 var4;
cards;
2 4 6 7
4 9 7 6
5 2 1 1
7 3 7 3
;
run;
proc transpose data=_xxx out=_xxx2;
run;
proc means data=_xxx2 noprint;
var col1-col4;
output out=_xxx3(keep=v1-v4)
maxid(col1(_name_)
col2(_name_)
col3(_name_)
col4(_NAME_))= v1-v4/autoname;
run;
proc transpose data=_xxx3 out=_xxx3t;
var v1-v4;
run;
d... 阅读全帖
x*******u
发帖数: 500
42
来自主题: Statistics版 - help! 读CSV文件读得要崩溃了
我试了, 还是老样子。 能不能把你的code贴上来看看, 谢谢。
还有, 如果我ignore数据的形式, 计算 a=(hour*60+min)*60+sec;
error message is:
NOTE: Invalid numeric data, hour='.1.2.' , at line 663 column 8.
var1= 1 0 / 3 0 / 2 0 0 9 VAR2= 1 2 : 2 1 : 2 9 P M VAR3= 0 . 0 0 VAR4=
6 8 . 0 month= 1 0 day= 3 0 year= 2 0 0 9 AMPM= P M hour= 1 2 min= 2 1
sec= 2 9 var6= 1 2 : 2 1 : 2 9 a=. _ERROR_=1 _N_=2
c******n
发帖数: 380
43
if indexc(catx('',of var1-var4),'xyz')>0 then target=1;else target=0
s******r
发帖数: 1524
44
You assume var1-var4 is one-letter variable. It may not be true.
s******r
发帖数: 1524
45
Your code could work after a little change.
data test;
set test;
array drugid(4) var1-var4;
steroid=0;
do i=1 to 4;
if drugid(i) in ('x','y','z') then steroid=1;
end;
if steroid=0 then delete;
drop i;
run;

if.
m*****a
发帖数: 658
46
I mean why f indexc(of var1-var4,'xyz)>0 then target=1;else target=0 ,
doesnt work ?
d******9
发帖数: 404
47
来自主题: Statistics版 - SAS MACRO question (包子求教重金酬谢)
If you do NOT have so many variables, you can rename the variables manually,
the below MACRO will work.
Please send me your BAOZI, thank you.
-------------------------------------------------------------
libname A 'your physical path';
****Use SAS MACRO to read in external CSV files from storage library.****;
filename Raw 'your physical path';
data AAA (drop=RC);
length Memname In_Name Out_Name $30;
Did=dopen("Raw");
if did> 0 then do;
Num=dnum(did);
do J=1 to Num;
Memname=dread(did, J);
In_Na... 阅读全帖
c*****a
发帖数: 16
48
来自主题: Statistics版 - SAS MACRO question (包子求教重金酬谢)
I will single out those different files first.
Also, since I have 49 variables, could you pls help me with how to get them?
If it is not easy, that is OK - I will do it mannually. Thanks a lot.
proc import datafile=Mem&I out= A.&&OUT&I(rename=(var1=Date &#
160; var2=Tier &#
160;var3= Ccy var4= Doc var5=Sd1y &#
160; var6=Sd2y))
DBMS=CSV REPLACE;
b********r
发帖数: 764
49
来自主题: Statistics版 - 请教一个简单SAS问题
比如你的5个variable是var1,var2,。。,V5吧
data outdsn;
set indsn1(rename=(var1=new))
indsn2(rename=(var2=new))
indsn3(rename=(var3=new))
indsn4(rename=(var4=new))
indsn5(rename=(var5=new));
run;
y**i
发帖数: 1050
50
来自主题: Statistics版 - help!! help!! SAS help!! Urgent!!
how to know the exact number of one variable level within another variable
level.
how to know the number of level conditioning on another variable
for example the data as following:
VAR1 VAR2 VAR3 VAR4
A a &&& 34
A a %%% 35
A b *** 54
B a ((( 45
B a ### 45
B c ((( 45
B c &&& 76
B d ^^^ 43
C e !!! 12
How can I know there is 2 (&&&, %%%) levels condition on VAR2=a and VAR1=A,
there is 1(**... 阅读全帖
1 (共1页)