Hello all:
I am trying to filter some cases out of a sample. I am using a filter variable that has 6 categories (1-6) and I want to keep all the cases with codes 1-5 and the SYSMIS cases, but delete the cases with a code of 6. When I use this syntax, SELECT IF(var<6), I lose all the SYSMIS cases. Is there a way that I can keep the SYSMIS cases? Thanks, Lyndon |
Hi Lyndon,
(Untested syntax): SELECT IF ((var LT 6) OR (MISSING(var)). * (LT: Lower Than). Or... SELECT IF (var NE 6). * (NE: Not Equal). LR> I am trying to filter some cases out of a sample. I am using a filter LR> variable that has 6 categories (1-6) and I want to keep all the cases with LR> codes 1-5 and the SYSMIS cases, but delete the cases with a code of 6. When LR> I use this syntax, SELECT IF(var<6), I lose all the SYSMIS cases. Is there LR> a way that I can keep the SYSMIS cases? Regards, Marta mailto:[hidden email] |
In reply to this post by Lyndon Riviere
Try this
Select if (sysmis(var) or var<6). -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Lyndon Riviere Sent: Thursday, July 20, 2006 10:43 AM To: [hidden email] Subject: Filter cases but keep SYSMIS cases Hello all: I am trying to filter some cases out of a sample. I am using a filter variable that has 6 categories (1-6) and I want to keep all the cases with codes 1-5 and the SYSMIS cases, but delete the cases with a code of 6. When I use this syntax, SELECT IF(var<6), I lose all the SYSMIS cases. Is there a way that I can keep the SYSMIS cases? Thanks, Lyndon |
In reply to this post by Marta García-Granero
Hi,
I'm wondering if somebody has a script to perform v-fold cross-validation with SPSS. Thanks, /Chrisitian |
In reply to this post by Marta García-Granero
A simpler way is to select all cases with values other than 6:
COMPUTE FLAG=1. IF (VARX =6) FLAG=0. SELECT IF FLAG=1. Hector -----Mensaje original----- De: SPSSX(r) Discussion [mailto:[hidden email]] En nombre de Marta García-Granero Enviado el: Thursday, July 20, 2006 11:59 AM Para: [hidden email] Asunto: Re: Filter cases but keep SYSMIS cases Hi Lyndon, (Untested syntax): SELECT IF ((var LT 6) OR (MISSING(var)). * (LT: Lower Than). Or... SELECT IF (var NE 6). * (NE: Not Equal). LR> I am trying to filter some cases out of a sample. I am using a filter LR> variable that has 6 categories (1-6) and I want to keep all the cases with LR> codes 1-5 and the SYSMIS cases, but delete the cases with a code of 6. When LR> I use this syntax, SELECT IF(var<6), I lose all the SYSMIS cases. Is there LR> a way that I can keep the SYSMIS cases? Regards, Marta mailto:[hidden email] |
In reply to this post by Lyndon Riviere
Yet another way:
RECODE VAR (SYSMIS=7)(6=8). RECODE VAR (7=6). SELECT IF VAR LE 7. Recoding the sysmis cases to 7 and then back to 6 is not necessary, indeed. But recoding them to 6 in the first RECODE may cause an error because at the same time the old 6 values are recoded to 8 (though I believe it will not cause any error, because recoding works from right to left), and leaving them at 7 after the first RECODE will leave the variable with a discontinuous sequence of values (1,2,3,4,5,7) which an obsessive-compulsive worker may not like. Hector -----Mensaje original----- De: Hector Maletta [mailto:[hidden email]] Enviado el: Thursday, July 20, 2006 6:02 PM Para: 'Marta García-Granero'; '[hidden email]' Asunto: RE: Filter cases but keep SYSMIS cases A simpler way is to select all cases with values other than 6: COMPUTE FLAG=1. IF (VARX =6) FLAG=0. SELECT IF FLAG=1. Hector -----Mensaje original----- De: SPSSX(r) Discussion [mailto:[hidden email]] En nombre de Marta García-Granero Enviado el: Thursday, July 20, 2006 11:59 AM Para: [hidden email] Asunto: Re: Filter cases but keep SYSMIS cases Hi Lyndon, (Untested syntax): SELECT IF ((var LT 6) OR (MISSING(var)). * (LT: Lower Than). Or... SELECT IF (var NE 6). * (NE: Not Equal). LR> I am trying to filter some cases out of a sample. I am using a filter LR> variable that has 6 categories (1-6) and I want to keep all the cases with LR> codes 1-5 and the SYSMIS cases, but delete the cases with a code of 6. When LR> I use this syntax, SELECT IF(var<6), I lose all the SYSMIS cases. Is there LR> a way that I can keep the SYSMIS cases? Regards, Marta mailto:[hidden email] |
I want to unsubscribe from the group thanks
jeff >From: Hector Maletta <[hidden email]> >Reply-To: Hector Maletta <[hidden email]> >To: [hidden email] >Subject: Re: Filter cases but keep SYSMIS cases >Date: Thu, 20 Jul 2006 18:07:20 -0300 > >Yet another way: >RECODE VAR (SYSMIS=7)(6=8). >RECODE VAR (7=6). >SELECT IF VAR LE 7. >Recoding the sysmis cases to 7 and then back to 6 is not necessary, indeed. >But recoding them to 6 in the first RECODE may cause an error because at >the >same time the old 6 values are recoded to 8 (though I believe it will not >cause any error, because recoding works from right to left), and leaving >them at 7 after the first RECODE will leave the variable with a >discontinuous sequence of values (1,2,3,4,5,7) which an >obsessive-compulsive >worker may not like. >Hector > >-----Mensaje original----- >De: Hector Maletta [mailto:[hidden email]] >Enviado el: Thursday, July 20, 2006 6:02 PM >Para: 'Marta García-Granero'; '[hidden email]' >Asunto: RE: Filter cases but keep SYSMIS cases > >A simpler way is to select all cases with values other than 6: >COMPUTE FLAG=1. >IF (VARX =6) FLAG=0. >SELECT IF FLAG=1. >Hector > > >-----Mensaje original----- >De: SPSSX(r) Discussion [mailto:[hidden email]] En nombre de >Marta >García-Granero >Enviado el: Thursday, July 20, 2006 11:59 AM >Para: [hidden email] >Asunto: Re: Filter cases but keep SYSMIS cases > >Hi Lyndon, > >(Untested syntax): > >SELECT IF ((var LT 6) OR (MISSING(var)). > >* (LT: Lower Than). > > >Or... > >SELECT IF (var NE 6). > >* (NE: Not Equal). > >LR> I am trying to filter some cases out of a sample. I am using a filter >LR> variable that has 6 categories (1-6) and I want to keep all the cases >with >LR> codes 1-5 and the SYSMIS cases, but delete the cases with a code of 6. >When >LR> I use this syntax, SELECT IF(var<6), I lose all the SYSMIS cases. Is >there >LR> a way that I can keep the SYSMIS cases? > >Regards, > Marta mailto:[hidden email] |
Free forum by Nabble | Edit this page |