Select cases issues

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

Select cases issues

Allen Frommelt

I am trying to select cases based on back pain associated costs > $0.00 and other criteria, but keep bumping up against the issue that negative numbers still appear in the analysis when I compare the costs among groups.  I’m sure it is something I am doing in the order of the syntax, which I pasted from the select data function.  Here is the  code:

 

USE ALL.

COMPUTE filter_$=(hcondition='Back' and 18 > age < 65 and excluded=0 and

  bpclaims >= 1 and bpcosts>0).

VARIABLE LABEL filter_$ "hcondition='Back' and 18 > age < 65 and excluded=0"+

 " and bpclaims >= 1 and bpcosts>0 (FILTER)".

VALUE LABELS filter_$  0 'Not Selected' 1 'Selected'.

FORMAT filter_$ (f1.0).

FILTER BY filter_$.

EXECUTE .

 

Any guidance would be appreciated.  Thanks!

 

Regards,

 

Allen


 


This email and all attachments are confidential and intended solely
for the use of the individual or entity to which they are addressed.
If you have received this email in error please notify the sender
by replying to this message. If you are not the intended recipient,
please delete this message and all attachments immediately.  Do not
copy, disclose, use or act upon the information contained. Please
note that any views or opinions presented in this email are solely
those of the author and do not necessarily represent those of the
company. Finally, the recipient should check this email and any
attachments for the presence of viruses. While every attempt is made
to verify that the contents are safe, the company accepts no liability
for any damage caused by any virus transmitted by this email.
Reply | Threaded
Open this post in threaded view
|

Re: Select cases issues

Marta Garcia-Granero
Hi Allen

Allen Frommelt wrote:

>
> I am trying to select cases based on back pain associated costs >
> $0.00 and other criteria, but keep bumping up against the issue that
> negative numbers still appear in the analysis when I compare the costs
> among groups. I’m sure it is something I am doing in the order of the
> syntax, which I pasted from the select data function. Here is the code:
>
> USE ALL.
>
> COMPUTE filter_$=(hcondition='Back' and 18 > age < 65 and excluded=0 and
>
> bpclaims >= 1 and bpcosts>0).
>
> VARIABLE LABEL filter_$ "hcondition='Back' and 18 > age < 65 and
> excluded=0"+
>
> " and bpclaims >= 1 and bpcosts>0 (FILTER)".
>
> VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
>
> FORMAT filter_$ (f1.0).
>
> FILTER BY filter_$.
>
> EXECUTE .
>
>
Are you sure your filter is working at all? I don't think that "...18 >
age <65..." is correct. Do you mean that you want to select people with
age over 18 and under 85 years?

Maybe:

COMPUTE filter_$=((hcondition='Back') AND (age >=18) AND (age =< 65) AND
(excluded=0) AND (bpclaims >= 1) AND (bpcosts>0)).


Will work.

HTH,
Marta GG

--
For miscellaneous SPSS related statistical stuff, visit:
http://gjyp.nl/marta/

=====================
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: Select cases issues

Art Kendall
In reply to this post by Allen Frommelt

I do not have time to test these but see if something like one of these works as you would like.

COMPUTE filter_$=(hcondition eq 'Back' and (18 > age < 65)    and excluded eq 0 and

  bpclaims ge 1 and bpcosts gt 0).
or

COMPUTE filter_$=(hcondition eq 'Back'  and  range(age,18,65) and excluded eq 0 and

  bpclaims ge 1 and bpcosts gt 0).

Art Kendall
Social Research Consultants

On 2/15/2010 12:02 PM, Allen Frommelt wrote:

I am trying to select cases based on back pain associated costs > $0.00 and other criteria, but keep bumping up against the issue that negative numbers still appear in the analysis when I compare the costs among groups.  I’m sure it is something I am doing in the order of the syntax, which I pasted from the select data function.  Here is the  code:

 

USE ALL.

COMPUTE filter_$=(hcondition='Back' and 18 > age < 65 and excluded=0 and

  bpclaims >= 1 and bpcosts>0).

VARIABLE LABEL filter_$ "hcondition='Back' and 18 > age < 65 and excluded=0"+

 " and bpclaims >= 1 and bpcosts>0 (FILTER)".

VALUE LABELS filter_$  0 'Not Selected' 1 'Selected'.

FORMAT filter_$ (f1.0).

FILTER BY filter_$.

EXECUTE .

 

Any guidance would be appreciated.  Thanks!

 

Regards,

 

Allen


 

This email and all attachments are confidential and intended solely
for the use of the individual or entity to which they are addressed.
If you have received this email in error please notify the sender
by replying to this message. If you are not the intended recipient,
please delete this message and all attachments immediately.  Do not
copy, disclose, use or act upon the information contained. Please
note that any views or opinions presented in this email are solely
those of the author and do not necessarily represent those of the
company. Finally, the recipient should check this email and any
attachments for the presence of viruses. While every attempt is made
to verify that the contents are safe, the company accepts no liability
for any damage caused by any virus transmitted by this email.
  
===================== 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
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: Select cases issues

Art Kendall
OOps! should not have rushed.  Marta's version of the age range is what I should have put for the first option.

Art

On 2/15/2010 12:33 PM, Art Kendall wrote:

I do not have time to test these but see if something like one of these works as you would like.

COMPUTE filter_$=(hcondition eq 'Back' and (18 > age < 65)    and excluded eq 0 and

  bpclaims ge 1 and bpcosts gt 0).
or

COMPUTE filter_$=(hcondition eq 'Back'  and  range(age,18,65) and excluded eq 0 and

  bpclaims ge 1 and bpcosts gt 0).

Art Kendall
Social Research Consultants

On 2/15/2010 12:02 PM, Allen Frommelt wrote:

I am trying to select cases based on back pain associated costs > $0.00 and other criteria, but keep bumping up against the issue that negative numbers still appear in the analysis when I compare the costs among groups.  I’m sure it is something I am doing in the order of the syntax, which I pasted from the select data function.  Here is the  code:

 

USE ALL.

COMPUTE filter_$=(hcondition='Back' and 18 > age < 65 and excluded=0 and

  bpclaims >= 1 and bpcosts>0).

VARIABLE LABEL filter_$ "hcondition='Back' and 18 > age < 65 and excluded=0"+

 " and bpclaims >= 1 and bpcosts>0 (FILTER)".

VALUE LABELS filter_$  0 'Not Selected' 1 'Selected'.

FORMAT filter_$ (f1.0).

FILTER BY filter_$.

EXECUTE .

 

Any guidance would be appreciated.  Thanks!

 

Regards,

 

Allen


 

This email and all attachments are confidential and intended solely
for the use of the individual or entity to which they are addressed.
If you have received this email in error please notify the sender
by replying to this message. If you are not the intended recipient,
please delete this message and all attachments immediately.  Do not
copy, disclose, use or act upon the information contained. Please
note that any views or opinions presented in this email are solely
those of the author and do not necessarily represent those of the
company. Finally, the recipient should check this email and any
attachments for the presence of viruses. While every attempt is made
to verify that the contents are safe, the company accepts no liability
for any damage caused by any virus transmitted by this email.
  
===================== 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
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Two New IBM SPSS Statistics Extension Commands

Jon K Peck

I have posted beta versions of two new extension commands to SPSS Developer Central (www.spss.com/devcentral in the Downloads section).  They require at least Version 17 and the Python programmability plug-in, but no Python knowledge is required to use them.  They are packaged as a single download, since they would often be used together.

SPSSINC SPLIT DATASET divides the active dataset into a set of SAV files according to the values of a splitting variable.  It does not require any sorting, and there is no limit on how many files can be created.  The output datasets can be named by the split value, the label of that value, or a sequential number. It can produce a file that lists the sav files produced.  Apart from whatever general use it has, SPLIT DATASET is intended to work smoothly with the next command.
 
SPSSINC PROCESS FILES applies the contents of a syntax file to each of its inputs.  The inputs would typically be SAV files, but you can do anything you want in the syntax.  PROCESS FILES  defines file handles and macros for the inputs and the output parameters.  

You could use this command, for example, to process all the SAV files or all the XLS files in a directory (or a wildcarded selection of them).  In particular, combining this command with the previous one provides a way to put a collection of transformations and procedures in a loop over groups.  While SPLIT FILES lets a procedure iterate over groups, SPSSINC PROCESS FILES lets you iterate whole blocks of arbitrary syntax over groups without having a complete list of the groups in advance.

It can produce a log documenting what actions were taken by PROCESS FILES and whether any serious errors occurred, and it can save the Viewer contents on a per-input basis or all as a single output.  Per-input Viewer files are named according to the input names.

For any of you who saw my Directions presentation last Spring that included an example Python function, applySyntaxToFiles, this is the grown-up version.

This is a beta version - it turned out to be rather more complicated than I originally expected.  Please post comments to the Python programmability forum on Developer Central.

I hope you find this useful.


Jon Peck
SPSS, an IBM Company
[hidden email]
312-651-3435
Reply | Threaded
Open this post in threaded view
|

Re: Select cases issues

Richard Ristow
In reply to this post by Art Kendall
At 12:33 PM 2/15/2010, Art Kendall wrote, including code that was also in earlier postings:

COMPUTE filter_$=(hcondition eq 'Back' and (18 > age < 65)    and excluded eq 0 and
  bpclaims ge 1 and bpcosts gt 0).

"18 > age < 65" is a numeric expression. It is evaluated as if it were written
"(18 > age) < 65"

The test "18 > age" has value 0 or 1, depending on "age";
so "(18 > age) < 65" becomes either "0 < 65" or "1 < 65", and is always "true" (value 1).



===================== 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