Distinct counts in tables

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Distinct counts in tables

Choncek, Chris
I'm trying to calculate a distinct count of id's within a variable. In
this case, I want the number of unique student id's under each major
program. My datafile is setup to have more than one row per student id,
so when I get a count of id's under each major, it's reporting a student
more than once.

 

 

 

Christopher E. Choncek

Dir. of Institutional Research

Point Park University

201 Wood Street

Pittsburgh, PA 15222

(412) 392-3905

 
Reply | Threaded
Open this post in threaded view
|

Re: Distinct counts in tables

Richard Ristow
At 12:57 PM 6/13/2007, Choncek, Chris wrote:

>I'm trying to calculate a distinct count of id's within a variable. In
>this case, I want the number of unique student id's under each major
>program. My datafile is setup to have more than one row per student
>id, so when I get a count of id's under each major, it's reporting a
>student more than once.

I'm assuming a student can appear under only one major program. If a
student can appear under more than one, both definition and computation
are more complicated.

You do it with a double AGGREGATE. This should be redundant to say, but
this >wipes the working file,< so make sure you have a saved copy.

(General note: I freely post solutions that will wipe the working
file.)

If you have variables Major and Student as keys, like this (not
tested):

AGGREGATE
   /OUTFILE=*
   /BREAK  =Major Student
   /NMention 'No. of times student is mentioned' = NU.

Then, for immediate display:

FREQUENCIES Major.

Or to have the value in an SPSS file:

AGGREGATE
   /OUTFILE=*
   /BREAK  = Major
   /NStudent 'No. of students per major'.
Reply | Threaded
Open this post in threaded view
|

Re:Distinct counts in tables

Jerabek Jindrich
In reply to this post by Choncek, Chris
Hi Chris,

you could aggregate the original data file by ID and Program type and then run frequency of program type.

(this replaces the original dataset, SAVE it before)
AGGREGATE
  /OUTFILE=*
  /BREAK=id program
  /N_BREAK=N.
FRE program.

regards
Jindra

> ------------ Původní zpráva ------------
> Od: Choncek, Chris <[hidden email]>
> Předmět: Distinct counts in tables
> Datum: 13.6.2007 18:59:33
> ----------------------------------------
> I'm trying to calculate a distinct count of id's within a variable. In
> this case, I want the number of unique student id's under each major
> program. My datafile is setup to have more than one row per student id,
> so when I get a count of id's under each major, it's reporting a student
> more than once.
>
>
>
>
>
>
>
> Christopher E. Choncek
>
> Dir. of Institutional Research
>
> Point Park University
>
> 201 Wood Street
>
> Pittsburgh, PA 15222
>
> (412) 392-3905
>
>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Re:Distinct counts in tables

donhatbang
Banned User
Dear Jindra!

In SPSS, how to calculate quickly unique ID the same distinct count in Pivot table in Excel

Bang Do

Ho Chi Minh City, VietNam