| Date: | Thu, 16 May 2002 08:31:34 -0400 |
| Reply-To: | Edward Heaton <HEATONE@WESTAT.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
|
| From: | Edward Heaton <HEATONE@WESTAT.COM> |
| Subject: | Re: Percent one or four |
|
| Content-Type: | text/plain; charset="iso-8859-1" |
|---|
Jet,
countOneOrFour = 0 ;
Array qx [*] q1-q20 ;
Do i=1 to dim(qx) ;
countOneOrFour = countOneOrFour + ( qx[i] in (1,4) ) ;
End ;
pctOneOrFour = ( countOneOrFour / (i-1) ) * 100 ;
Drop i countOneOrFour ;
Ed
Edward Heaton, Senior Systems Analyst,
Westat (An Employee-Owned Research Corporation),
1550 Research Boulevard, Room 2018, Rockville, MD 20850-3195
Voice: (301) 610-4818 Fax: (301) 294-3992
mailto:EdwardHeaton@westat.com http://www.westat.com
-----Original Message-----
From: Jet Li [mailto:jet_li@SOFTHOME.NET]
Sent: Wednesday, May 15, 2002 5:22 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject:
Hi all,
I have 100 patients answering 20 questions on each of their visit. Their
answers are scored as 1,2,3&4
I want to find the percentage of each patients on each visit who's answers
were either 1 or 4
I tried creating a flag for each of the question and i think that is not the
real solution. Can anyone provide me with a simpler solution?
Thanks a lot.
|