```Date: Mon, 26 Nov 2001 20:12:22 -0500 Reply-To: Raynald Levesque Sender: "SPSSX(r) Discussion" From: Raynald Levesque Subject: Re: Combinations of Numbers In-Reply-To: Content-Type: text/plain; charset="iso-8859-1" Hi Jessica and listmembers, what you describe can be done using a macro or a script. However I wonder if the following simple (2 lines) solution would not meet your needs: * Create some date for illustration purposes. INPUT PROGRAM. LOOP #=1 TO 100. COMPUTE v84=TRUNC(UNIFORM(3)). COMPUTE v89=TRUNC(UNIFORM(3)). COMPUTE v94=TRUNC(UNIFORM(3)). COMPUTE v99=TRUNC(UNIFORM(3)). END CASE. END LOOP. END FILE. END INPUT PROGRAM. * Next 2 lines are a solution. COMPUTE test1=v84*1000 + v89*100 + v94*10 + v99. AUTORECODE test1 /INTO test. The variable "test" then contains values ranging from 1 to the number of existing combinations (of the 3 values times 4 variables) in the data file. Moreover, the value labels of the test variable contain the corresponding value of test1. HTH Raynald Levesque rlevesque@videotron.ca Visit My SPSS Pages: http://pages.infinit.net/rlevesqu/index.htm -----Original Message----- From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]On Behalf Of Jessica Kenty Sent: Friday, November 23, 2001 4:26 PM To: SPSSX-L@LISTSERV.UGA.EDU Subject: Combinations of Numbers Hello All, I am trying to come up with a fast way to find all possible combinations of values for each case using the following: Variable Name Variable Values v84 0, 1, or 2 v89 0, 1, or 2 v94 0, 1, or 2 v99 0, 1, or 2 For example, one possible case might have: 0, 0, 0, 1. Another case might have: 1, 0, 0, 1. And so on... To do this by hand is extremely time consuming. Anyone know a program to use or website in which you can punch in this info. and get some 4 digit combinations back? Or can SPSS do this? The end result for me is to come up with a series of IF statements to use in a COMPUTE command. Basically, COMPUTE test=0. If (v84=0 AND v89=0 AND v94=0 AND v99=0) test=1. If (v84=0 AND v89=1 AND v94=0 AND V99=1) test=2. . . . EXECUTE. If someone knows how to do this in SPSS also, that would be prefered! Thanks in advance. Jessica ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Jessica Kenty Research Assistant Assets & Educational Inequality Project Northeastern University Boston, MA ```

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