determining the number of duplicates which vary

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

determining the number of duplicates which vary

msherman
Dear list; I have a data set that has each respondent having a different number of rows but the same variables (but maybe different values for the same variables-at the moment I am not interested in the potential different values for the same variable-this will be address later). I need to determine the number of rows for each respondent. Is there a quick way of doing this.
For instance
01 2345
01 2348
01 2345
02 4212
02 4221
02 4222
02 4121
02 4212

I now want to create a variable (named numberofrows). In the above case
numberofrows would be for 01  =3 , while for 02 =5.  thanks,  martin

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: determining the number of duplicates which vary

ViAnn Beadle
Use Aggregate and break on respondent id. You can save the number of records
per id as a variable. If you want to maintain this structure use
mode=addvariables and the number of records per id will be saved as a
variable on each row.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Martin Sherman
Sent: Saturday, January 17, 2009 7:22 AM
To: [hidden email]
Subject: determining the number of duplicates which vary

Dear list; I have a data set that has each respondent having a different
number of rows but the same variables (but maybe different values for the
same variables-at the moment I am not interested in the potential different
values for the same variable-this will be address later). I need to
determine the number of rows for each respondent. Is there a quick way of
doing this.
For instance
01 2345
01 2348
01 2345
02 4212
02 4221
02 4222
02 4121
02 4212

I now want to create a variable (named numberofrows). In the above case
numberofrows would be for 01  =3 , while for 02 =5.  thanks,  martin

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: determining the number of duplicates which vary

Arthur Burke
In reply to this post by msherman
Martin ... Custom tables does this nicely.  The following demonstration
names your first variable ID and the second V1.

Data List FREE /ID V1.
BEGIN DATA
01 2345
01 2348
01 2345
02 4212
02 4221
02 4222
02 4121
02 4212
02 ,
02 ,
End Data.

CTABLES
  /VLABELS VARIABLES=ID V1 DISPLAY=LABEL
  /TABLE ID BY V1 [S][VALIDN 'NumberofRows' F40.0, COUNT
'NIncludingMissing' F40.0]
  /CATEGORIES VARIABLES=ID ORDER=A KEY=VALUE EMPTY=EXCLUDE.

Art
_______________________________________________
Art Burke
Northwest Regional Educational Laboratory
101 SW Main St, Suite 500
Portland, OR 97204-3213


-----Original Message-----
From: Martin Sherman [mailto:[hidden email]]
Sent: Saturday, January 17, 2009 6:22 AM
To: [hidden email]
Subject: determining the number of duplicates which vary

Dear list; I have a data set that has each respondent having a different
number of rows but the same variables (but maybe different values for
the same variables-at the moment I am not interested in the potential
different values for the same variable-this will be address later). I
need to determine the number of rows for each respondent. Is there a
quick way of doing this.
For instance
01 2345
01 2348
01 2345
02 4212
02 4221
02 4222
02 4121
02 4212

I now want to create a variable (named numberofrows). In the above case
numberofrows would be for 01  =3 , while for 02 =5.  thanks,  martin

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command SIGNOFF SPSSX-L For a list
of commands to manage subscriptions, send the command INFO REFCARD

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD