|Date: ||Tue, 27 Jan 1998 16:59:09 -0500|
|Sender: ||"SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>|
|From: ||Ron Coleman <rcoleman@WORLDNET.ATT.NET>|
|Organization: ||Links Analytical, Inc.|
|Subject: ||Re: proc tabulate and multiple response variables|
|Content-Type: ||text/plain; charset=us-ascii|
Ralph Brands wrote:
> I recently asked a question about analysis of multiple response data
> in SAS.
> Having digested a lot of very helpful information from several
> and tried to understand Proc Freq, I now understand some situations
> (referred to in SPSS as multiple-dichotomy groups), but am still stuck
> this type (which SPSS calls a multiple-response groups):
> Respondents are asked to list which of 5 states they have visited. The
> data are entered as follows: (each state can appear in ANY column)
> case state1 state2 state3
> 1 NY CAL .
> 2 MASS . .
> 3 CAL MASS .
> 4 MI WA MASS
> 5 WA . .
> We want to know what percentage of respondents reported visiting NY,
> percentage reported visiting CAL etc, ie the desired output gives the
> following information:
> NY 1 20%
> CAL 2 40%
> MASS 3 60%
> MI 1 20%
> WA 2 40%
> I have the feeling that this CAN be done in Proc Tabulate but haven't
> it yet. Can someone provide a suggestion please?
> Ralph Brands
PROC TABULATE will handle multiple response variables but only one at a
time. My suggestion is that you create a temporary dataset with only 1
multiple response (categorical) variable:
DATA TEMP / VIEW=TEMP;
ARRAY ST(5) STATE1-STATE5
DO I = 1 TO DIM(ST);
IF ST(I) NE ' ' THEN DO;
STATE = ST(I);
PROC TABULATE DATA=TEMP;
TABLE STATE, PCTN;
Ron Coleman A SAS Quality Partner.
Links Analytical, Inc. Linking your data to your business!
3545-1 St. Johns Bluff Rd. Suite 300
Jacksonville FL 32224 mailto:firstname.lastname@example.org