|
|
楼主

楼主 |
发表于 2010-9-23 09:43:30
|
只看该作者
发个SAS讨论邮件列表,信狂多,看不完!
好像是来自Georgia大学,下面是历史邮件:
<!-- m --><a class="postlink" href="http://www.listserv.uga.edu/archives/sas-l.html">http://www.listserv.uga.edu/archives/sas-l.html</a><!-- m -->
加入邮件讨论:
<!-- m --><a class="postlink" href="http://www.listserv.uga.edu/cgi-bin/wa?SUBED1=sas-l&A=1">http://www.listserv.uga.edu/cgi-bin/wa?SUBED1=sas-l&A=1</a><!-- m -->
------------------------------------------------------------
大家加入要慎重啊,每天10-20封提问邮件,加上回信大概每天40/50封邮件吧。有一段日子没看了,现在已经900多未读了。
[img:c6ed5n19]http://files.myopera.com/zuojunjie/files/sendpix0.jpg[/img:c6ed5n19]
------------------------------------------------------------
拿个邮件出来内容给大家看看(倒序的):
Jack
Might I guess that if it did not exclude automatic variables, then it would
include the value of _N_ in calculations that included the "special variable
list name" _NUMERIC_ as in the following code.
Nat
Data Jack;
input A _1 _2;
R = max( of _numeric_);
N = N ( of _numeric_);
put _all_;
cards;
-1 -2 -3
run;
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Jack
Hamilton
Sent: Saturday, September 18, 2010 3:50 PM
To: <!-- e --><a href="mailto:SAS-L@LISTSERV.UGA.EDU">SAS-L@LISTSERV.UGA.EDU</a><!-- e -->
Subject: Re: A data step question: comparison of values of multiple
variables
What I find interesting about this is how _ automatic variables are treated
- they are not included in _: .
_error_ = 1;
_a = 0;
r = range(of _:);
put r=;
That could have been predicted from the behavior of
put (_all_)(=);
but that would require thinking about it, and thinking is hard work.
Are there any circumstances under which an automatic variable might be
included in _: ?
--
Jack Hamilton
<!-- e --><a href="mailto:jfh@alumni.stanford.org">jfh@alumni.stanford.org</a><!-- e -->
Vous finirez tous par crever du confort
On Sep 18, 2010, at 11:54 , Mike Rhoads wrote:
> Yep -- I had the same suggestion in a private reply.
>
> I have a hard time imagining any further reduction -- any takers? <!-- s;-) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";-)" title="Wink" /><!-- s;-) -->
>
>
> Mike Rhoads
> <!-- e --><a href="mailto:RhoadsM1@Westat.com">RhoadsM1@Westat.com</a><!-- e -->
>
>
> -----Original Message-----
> From: Arthur Tabachneck [mailto:art297@NETSCAPE.NET]
> Sent: Saturday, September 18, 2010 1:03 PM
> To: <!-- e --><a href="mailto:SAS-L@LISTSERV.UGA.EDU">SAS-L@LISTSERV.UGA.EDU</a><!-- e -->; Mike Rhoads
> Subject: Re: A data step question: comparison of values of multiple
variables
>
> Mike,
>
> I agree that it would be hard to get "much" simpler, but easy to get a
> little simpler. How about:
>
> data UnequalValues;
> set sample;
> if range(of _:) ;
> run;
>
> Art
> --------
> On Fri, 17 Sep 2010 16:13:30 -0400, Mike Rhoads <RHOADSM1@WESTAT.COM>
> wrote:
>
>> I received a private reply that contained the following improvement:
>>
>> if range(of _01-_09) ;
>>
>> Hard to get much simpler than that!
>>
>>
>> Mike
>>
>> -----Original Message-----
>> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Mike
> Rhoads
>> Sent: Friday, September 17, 2010 1:01 PM
>> To: <!-- e --><a href="mailto:SAS-L@LISTSERV.UGA.EDU">SAS-L@LISTSERV.UGA.EDU</a><!-- e -->
>> Subject: Re: A data step question: comparison of values of multiple
> variables
>>
>> I'm getting to this thread belatedly, but how about simply:
>>
>> data UnequalValues;
>> set sample;
>> if min(of _01-_09) ^= max(of _01-_09);
>> run;
>>
>>
>> Mike Rhoads
>> <!-- e --><a href="mailto:RhoadsM1@Westat.com">RhoadsM1@Westat.com</a><!-- e -->
>>
>>
>>
>>
>> -----Original Message-----
>> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Mike
> Zdeb
>> Sent: Wednesday, September 15, 2010 4:58 PM
>> To: <!-- e --><a href="mailto:SAS-L@LISTSERV.UGA.EDU">SAS-L@LISTSERV.UGA.EDU</a><!-- e -->
>> Subject: Re: A data step question: comparison of values of multiple
> variables
>>
>> hi ... here's another idea
>> I think it should work with any similar data
>> <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> ...
>>
>>
>>
>> data sample;
>> infile cards missover;
>> input PATIENT_ID _01-_09;
>> cards;
>> 001 8310
>> 002 3510 8310
>> 003 7500
>> 004 1010
>> 005 6910 8310
>> 006 . 8310
>> 007 0600
>> 008 2100 2100
>> 009 8000 8000 8000
>> 010 . 3500
>> ;
>> run;
>>
>> options missing = '';
>>
>> data new;
>> set sample;
>> if verify(tranwrd( catx(' ', of _:) , cats(coalesce(of _:)) , '*' ), '
> *' );
>> run;
>>
>> options missing = '.';
>>
>> proc print data=new noobs;
>> run;
>>
>> PATIENT_
>> ID _01 _02 _03 _04 _05 _06 _07 _08 _09
>> 2 3510 8310 . . . . . . .
>> 5 6910 8310 . . . . . . .
>>
>> --
>> Mike Zdeb
>> U@Albany School of Public Health
>> One University Place (Room 119)
>> Rensselaer, New York 12144-3456
>> P/518-402-6479 F/630-604-1475
>>
>>> Hi there,
>>> I have a quesion about comparing values of multiple variables within an
>>> observation.
>>>
>>> Here's how my dataset looks like:
>>> PATIENT_ID _01 _02 _03 _04 _00 _05 _07 _60 _06 _08 _09
>>> -----------------------------------------------------------------------
>>> 001 8310
>>> 002 3510 8310
>>> 003 7500
>>> 004 1010
>>> 005 6910 8310
>>> 006 8310
>>> 007 0600
>>> 008 2100 2100
>>> 009 8000 8000 8000
>>> 010 3500
>>>
>>> Each observation has at least one non-missing value in variable _00 to
>>> _60. I want to identify observations that had unequal values in variable
>>> _00 to _60, such as PATIENT_ID 002 and 005 in the above sample dataset.
>>>
>>> I believe that there must be more than one easy and efficient way to do.
>>> Thanks for your help!!
>>>
------------------------------------------------------------
顺便发点入门资料下载:
<!-- m --><a class="postlink" href="http://www.douban.com/group/topic/13698454/">http://www.douban.com/group/topic/13698454/</a><!-- m -->
------------------------------------------------------------ |
|