Excluding a large number of cases easily

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

Excluding a large number of cases easily

cysp
Hi,

I have a subjectID column and an exclusion column that includes all the subjectIDs that I want excluded. There is about 500 subjectIDs to be excluded. What would be the easiest way to exclude them without manually typing each subjectID as a conditional?

Thanks in advance
Reply | Threaded
Open this post in threaded view
|

Re: Excluding a large number of cases easily

David Marso
Administrator

Please define your situation a bit more clearly!
What do you mean by an "exclusion column"?
What is the relationship between this "exclusion column" wrt the cases/rows in your data file?
Maybe post a few cases with the subjectID and Exclusion column listed.
I will resist any temptations to attempt InterneTelepathy at the moment.
cysp wrote
Hi,

I have a subjectID column and an exclusion column that includes all the subjectIDs that I want excluded. There is about 500 subjectIDs to be excluded. What would be the easiest way to exclude them without manually typing each subjectID as a conditional?

Thanks in advance
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: Excluding a large number of cases easily

cysp
I'm not sure how to explain it any clearer. I'll paste a few rows:

subjectID                     exclude
206.80211.14:34          208.80211.14:34
207.80211.14:34          211.80211.14:34
208.80211.14:34                    .
209.80211.14:34                    .
210.80211.14:34                    .
211.80211.14:34                    .
            .                                .
            .                                .
            .                                .


What I want to do: If any subjectID is in the exclude column, delete that row. I'm aware of the problem that deleting a row will also delete a value that's in the exclusion column.
Reply | Threaded
Open this post in threaded view
|

Re: Excluding a large number of cases easily

David Marso
Administrator
Hmmm, ODD way to organize data!!!
Best to have your "exclude" field in a separate data file with the same name as the subjectID and sorted.
Then sort the main data file, MATCH and flag the cases in the exclude file.
Working from what you have:  Untested as I can't run SPSS from my Mac partition and too lazy to reboot!

SORT CASES BY exclude.
DO IF (NOT(MISSING(exclude))).
+  COMPUTE excluded=exclude.
+  XSAVE OUTFILE "temp.sav" / KEEP excluded.
END IF.

SORT CASES BY subjectID.
COMPUTE excluded=subjectID.
MATCH FILES / FILE * / TABLE "temp.sav" / IN=nukeme / BY excluded.
SELECT IF NOT(nukeme).
EXECUTE.
**Verify!!!.
** OPTIONAL!!!.
MATCH FILES / FILE * / DROP exclude excluded nukeme.
EXECUTE.
** SPSS might bitch about the next line ;-(
ERASE FILE "temp.sav".




cysp wrote
I'm not sure how to explain it any clearer. I'll paste a few rows:

subjectID                     exclude
206.80211.14:34          208.80211.14:34
207.80211.14:34          211.80211.14:34
208.80211.14:34                    .
209.80211.14:34                    .
210.80211.14:34                    .
211.80211.14:34                    .
            .                                .
            .                                .
            .                                .


What I want to do: If any subjectID is in the exclude column, delete that row. I'm aware of the problem that deleting a row will also delete a value that's in the exclusion column.
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"