|
Hello,
I am new with SPSS syntax scripting and I have a simple need but I can't seem to land on the proper conditional logic. I would like to specify a data value range in a numeric variable for the selection of cases. For instance: temp. select if (Var1 is in the range of 10 to 100). exe. I understand I can specify the range with ((var1 ge 10) and (var1 le 100)) this seems unnecessarily cumbersome and I'm thinking there has to be a simple one statement method. Is there anything a bit more concise than what I have above?
Thanks, Jim
|
|
Use Help to search for the RANGE function. From: SPSSX(r) Discussion
[mailto:[hidden email]] On Behalf Of Jim Arnold Hello, I am new with SPSS syntax scripting and I have a simple need
but I can't seem to land on the proper conditional logic. I would like
to specify a data value range in a numeric variable for the selection of cases.
For instance: temp. select if (Var1 is in the range of 10 to 100). exe. I understand I can specify the range with ((var1 ge 10) and
(var1 le 100)) this seems unnecessarily cumbersome and I'm thinking there
has to be a simple one statement method. Is there anything a bit more
concise than what I have above? Thanks, Jim |
|
In reply to this post by Jim Arnold-3
Yep, you're right, there is a more concise way:
* sample data. data list free (",") / var1 (f4). begin data 10 2 29 , 4 100 900 end data. *actual code. temporary. select if (range(var1, 10, 100)). fre var1. fre var1. Cheers!! Albert-Jan --- On Thu, 2/19/09, Jim Arnold <[hidden email]> wrote: > From: Jim Arnold <[hidden email]> > Subject: Conditional logic for a data range > To: [hidden email] > Date: Thursday, February 19, 2009, 5:28 PM > Hello, > I am new with SPSS syntax scripting and I have a simple > need but I can't > seem to land on the proper conditional logic. I would > like to specify a > data value range in a numeric variable for the selection of > cases. For > instance: > > temp. > select if (Var1 is in the range of 10 to 100). > exe. > > I understand I can specify the range with ((var1 ge 10) and > (var1 le 100)) > this seems unnecessarily cumbersome and I'm thinking > there has to be a > simple one statement method. Is there anything a bit more > concise than what > I have above? > > Thanks, > > Jim ===================== 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 |
| Free forum by Nabble | Edit this page |
