a simple thing, but making me nuts

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

a simple thing, but making me nuts

Jean Campbell
I have a new variable (v1) that is a subset of a larger number of cases
(part_id) and I want to match cases that share the common numeric variable
value.  In other words, if v1=part_id, then I want to simply keep those
cases (a subset of 89) and get rid of all the others.



Please help!



Jean Campbell, MPA

University of Arizona

Family and Community Medicine

Tucson, AZ 85719

520/626-1085
Reply | Threaded
Open this post in threaded view
|

Re: a simple thing, but making me nuts

Maguin, Eugene
Jean,

Do this.

Select if (v1=part_id).


Gene Maguin
Reply | Threaded
Open this post in threaded view
|

Re: a simple thing, but making me nuts

Edward Boadi
In reply to this post by Jean Campbell
Jean ,
If  you want to keep cases for which  v1=part_id :
Try this ;

IF  (v1=part_id) NewVar = 1.
SELECT IF (NewVar = 1).
EXE.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]]On Behalf Of
Jean Campbell
Sent: Thursday, June 29, 2006 4:54 PM
To: [hidden email]
Subject: a simple thing, but making me nuts


I have a new variable (v1) that is a subset of a larger number of cases
(part_id) and I want to match cases that share the common numeric variable
value.  In other words, if v1=part_id, then I want to simply keep those
cases (a subset of 89) and get rid of all the others.



Please help!



Jean Campbell, MPA

University of Arizona

Family and Community Medicine

Tucson, AZ 85719

520/626-1085
Reply | Threaded
Open this post in threaded view
|

Re: a simple thing, but making me nuts

Marks, Jim
In reply to this post by Jean Campbell
If v1 has the part_id you are interested in, and you want to PERMANENTLY
remove them from the working file:

SELECT IF v1 = #####.

Where "#####" is the value.

If v1 has the part_id you are interested in, and you want to limit the
analysis to the 89 cases in the data file:

COMPUTE filt_v1 = v1 EQ #####.
FILTER BY filt_v1.

In either case, the select or the filter will take effect on the next
data pass. The code you like should be pasted into the active syntax
window. (You can walk thru the same procedure using Data/ Select cases
from the GUI.

--jim

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Jean Campbell
Sent: Thursday, June 29, 2006 3:54 PM
To: [hidden email]
Subject: a simple thing, but making me nuts

I have a new variable (v1) that is a subset of a larger number of cases
(part_id) and I want to match cases that share the common numeric
variable value.  In other words, if v1=part_id, then I want to simply
keep those cases (a subset of 89) and get rid of all the others.



Please help!



Jean Campbell, MPA

University of Arizona

Family and Community Medicine

Tucson, AZ 85719

520/626-1085