由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - 如何用SAS找几个单词?
相关主题
新手学R的困惑。question about creating dummy variables in SAS
SAS问题请教一道SAS面试题,关于dummy variable
SAS help:产生个文件列表(双黄包给workable solution)哪里可以学到Visual Basic in Excel
请教一个SAS Macro问题。谢谢请教一个SAS选择性输出数据的问题,急,有包子
Please recommend a good book for SQLSAS question: assigning dummy variable
幼儿园分水果的SAS问题考SAS BASE需要看什么书啊!
大家工作之后都是怎么提高sas的求助:SAS结果显示model is not full rank
What is R equivalent to SAS format?[合集] 用SAS生成表格,怎么弄比较好?
相关话题的讨论汇总
话题: dummy话题: fruit话题: lowcase话题: grape
进入Statistics版参与讨论
1 (共1页)
t**********r
发帖数: 182
1
一段descriptions中,如果有“apple ”, 或 "orange",或 "grape", 就让fruit_
dummy =1; otherwise, fruit_dummy=0。
I tried the following codes; but these codes can only identify ONE word. How
can I identify multiple similar words??? thanks.
if index(lowcase(descriptions),'apple')>0 then fruit_dummy=1;
else fruit_dummy=0; run;
d*******o
发帖数: 493
2
加起来如何?
if (index(lowcase(descriptions),'apple')+index(lowcase(descriptions),'orange
'+index(lowcase(descriptions),'grape'))>0 then fruit_dummy=1;
else fruit_dummy=0; run;
t**********r
发帖数: 182
3
tried. not workable, as all obs are identified.
g*****d
发帖数: 526
4
我大概会这么写。
index('apple orange grape',lowercase(descriptions)) then fruit_dummy=1;
else fruit_dummy=0;
a***e
发帖数: 102
5
Maybe you can try this:
if indexc(upcase(descriptions), "APPLE", "ORANGE", "GRAPE")>0 THEN fruit_
dummy=1;else fruit_dummy=0;
y*m
发帖数: 102
6
this won't work as indexc searches for individual characters, not patters

【在 a***e 的大作中提到】
: Maybe you can try this:
: if indexc(upcase(descriptions), "APPLE", "ORANGE", "GRAPE")>0 THEN fruit_
: dummy=1;else fruit_dummy=0;

a***e
发帖数: 102
7
yeah,I think u are right.
R******d
发帖数: 1436
8
这个比较婉转,不过可以用
data _null_;
length a b $20;
gt_re = prxparse('s/apple|orange|grape//');
a="xxxxorangeeeee";
b=a;
call prxchange(gt_re, -1, b);
if length(b) put a= b= dummy=;
run;
t*********g
发帖数: 71
9
How about this?
if (index(lowcase(descriptions),'apple')
or index(lowcase(descriptions),'orange')
or index(lowcase(descriptions),'grape') )
then fruit_dummy=1;
else fruit_dummy=0; run;
1 (共1页)
进入Statistics版参与讨论
相关主题
[合集] 用SAS生成表格,怎么弄比较好?Please recommend a good book for SQL
[合集] use SAS to generate descriptive statistics for variable幼儿园分水果的SAS问题
[合集] 医疗保险公司的STATISTICIAN职位,电面有可能问什么呢?大家工作之后都是怎么提高sas的
SAS developer 和Programmer 差别很大吗?What is R equivalent to SAS format?
新手学R的困惑。question about creating dummy variables in SAS
SAS问题请教一道SAS面试题,关于dummy variable
SAS help:产生个文件列表(双黄包给workable solution)哪里可以学到Visual Basic in Excel
请教一个SAS Macro问题。谢谢请教一个SAS选择性输出数据的问题,急,有包子
相关话题的讨论汇总
话题: dummy话题: fruit话题: lowcase话题: grape