LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2006, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Sat, 23 Sep 2006 20:53:09 +0000
Reply-To:     iw1junk@COMCAST.NET
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Ian Whitlock <iw1junk@COMCAST.NET>
Subject:      Re: Problem with PROC FREQ
Comments: cc: Zach Peery <zpeery@NATURE.BERKELEY.EDU>

Summary: Problem with SPARSE option in PROC FREQ #iw-value=1

Zach,

Take a look at PROC SUMMARY (MEANS). There are options to specify the class values to count. One option depends on formats and one on a specification data set.

Ian Whitlock ============= Date: Fri, 22 Sep 2006 16:03:43 -0400 Reply-To: Zach Peery <zpeery@NATURE.BERKELEY.EDU> Sender: "SAS(r) Discussion" From: Zach Peery <zpeery@NATURE.BERKELEY.EDU> Subject: Problem with PROC FREQ Hi All, I have a dataset setup to try and estimate the frequency of occurrence of variables states for all possible PAIRWISE comparisons of variables. (e.g., State I and J of Variable 1 vs State P and R of Variable 2). EZ, except that I need to include combinations of States in the output dataset for which there are zero occurrences. In the example input dataset at the bottom there were no observations with State J for variable 1 and State Q for variable 2 so the output dataset should have a row that looks like this: VarA VarB StateOfVarA StateOfVarB COUNT var1 var2 J Q 0 I've tried: proc freq data=data noprint; tables VarA*VarB*StateOfVarA*StateOfVarB / out=Frequencies sparse; but the problem with this approach is that it outputs states that dont exist (e.g. State Z for Variable 1). Example input data set: VarA VarB StateOfVarA StateOfVarB var1 var2 I P var1 var2 I Q var1 var2 J P var1 var3 I Y var1 var3 I Z var1 var3 J Y var1 var3 J Z var2 var3 etc... etc....

In reality there are many variables and many states per variable...Many thanks for any help. Zach


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