LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (January 1998, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Sun, 18 Jan 1998 12:21:21 -0700
Reply-To:   "Raymond V. Liedka" <liedka@UNM.EDU>
Sender:   "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:   "Raymond V. Liedka" <liedka@UNM.EDU>
Subject:   Re: help: category count
Comments:   To: Meijuan Xiong <mxiong@NEUROBIO.SUNYSB.EDU>
In-Reply-To:   <m0xtyNm-0000XHC@crux.unm.edu>
Content-Type:   TEXT/PLAIN; charset=US-ASCII

On Sun, 18 Jan 1998, Meijuan Xiong wrote:

> I need to come up with number of "yes", "n", "ni" (or for some variables, I > have six categories) for each patient. > For example, if I have the following dataset, how do I turn it into counts > of categories for patients. > > Rater patients answer > 1 AX Y > 1 AJ N > 1 DJ NI > 1 RR Y > 1 KK N > 2 AX N > 2 AJ N > 2 DJ NI > 2 RR Y > 2 KK N > . . . > . . . > . . . > > What I need is to generate the following from the above dataset > patients "y" "n" "ni" > AX 1 1 0 > AJ 0 2 0 > DJ 0 0 2 > RR 2 0 0 > KK 0 2 0 > > Thanks in advance. >

Try something like this:

proc sort data=yourdata; by patient; run;

proc freq data=yourdata; by patient; table answer; run;

This will produce a frequency table of the variable answer by patient.

ray

Raymond V. Liedka Department of Sociology University of New Mexico


Back to: Top of message | Previous page | Main SAS-L page