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 2003)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 24 Sep 2003 08:16:13 -0500
Reply-To:     "Marks, Jim" <Jim.Marks@lodgenet.com>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         "Marks, Jim" <Jim.Marks@lodgenet.com>
Subject:      Re: should be real simple... counting unique cases
Content-Type: text/plain; charset="us-ascii"

Nico:

There are many ways to skin this cat. I like AUTORECODE:

DATA LIST FREE /vara (A1). BEGIN DATA 1 1 1 1 2 2 3 3 4 4 5 5 5 6 6 6 7 7 7 7 7 8 9 9 END DATA.

AUTORECODE vara /INTO varnbr. DESCRIPTIVES varnbr /STAT=max.

The maximum value of varnbr is the number of unique values.

For numeric variables, you can use

RANK varnbr /RANK INTO varcnt /TIES=CONDENSE.

Cheers

Jim Marks Senior Market Analyst LodgeNet Entertainment Corporation

-----Original Message----- From: Nico Peruzzi, Ph.D. [mailto:nperuzzi@yahoo.com] Sent: Tuesday, September 23, 2003 5:28 PM To: SPSSX-L@LISTSERV.UGA.EDU Subject: should be real simple... counting unique cases

SPSSers,

I know I'm missing something real simple here, but how does one count the number of unique cases in a variable as follows:

String variable A: 1 1 1 2 2 2 3 3 4 4 5 6 7 7 7 7 8 8 9 9

I want to know how many unique numbers are in this variable.

Thanks in advance, Nico

__________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com


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