select if not working as expected

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

select if not working as expected

mpirritano

All,

 

I’ve seen this before, I have a workaround, and reading the manual I don’t see why this happens. When I run the following select if, at least one part of it doesn’t work:

 

SELECT IF ((paid <> 0 ) &  (adjcode = "#C")) & (not_paid = 0).

Exe.

 

These are medical claims. The variable not_paid equals 1 if it is not paid. I only want to include paid. What happens is I still have claims in the data with paid = 0 after running this. There should only be claims that are either not equal to zero (could be positive or negative) or they could be paid = 0 so long as adjcode = “#C” indicating that they are paid at a capitated rate. But there are still claims that are just flat out paid = 0, and are not capped claims.

 

If I run a compute statement and then select based on that compute statement it works. That looks like so:

 

Compute finalized = ((paid <> 0 ) &  (adjcode = "#C")) & (not_paid = 0).

Exe.

 

And then

 

Select if (finalized = 1).

Exe.

 

So why doesn’t the select if do the same thing as the compute?

 

Thanks

Matt

 

Matthew Pirritano, Ph.D.

Research Analyst IV

Medical Services Initiative (MSI)

Orange County Health Care Agency

(714) 568-5648

 

Reply | Threaded
Open this post in threaded view
|

Automatic reply: select if not working as expected

Allum, Jeff
I will be out of the office from Friday, October 28 through Monday, October 31 and I will not have access to e-mail. I will reply to your e-mail after I return on Tuesday, November 1.

Jeff
____________________________
Jeff Allum
Research Associate
Council of Graduate Schools
One Dupont Circle, NW, Suite 230
Washington, DC 20036-1173
(202) 461-3878 (direct)
(202) 223-3791 (main)
(202) 461-3879 (fax)
[hidden email]<mailto:[hidden email]>
www.cgsnet.org<http://www.cgsnet.org/>

=====================
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 if not working as expected

Maguin, Eugene
In reply to this post by mpirritano

Matt, what happens if you crosstab out paid, not_paid and adjcode? I just wonder if there might be some unexpected inconsistencies.  Gene Maguin

 

 

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Pirritano, Matthew
Sent: Thursday, October 27, 2011 5:05 PM
To: [hidden email]
Subject: select if not working as expected

 

All,

 

I’ve seen this before, I have a workaround, and reading the manual I don’t see why this happens. When I run the following select if, at least one part of it doesn’t work:

 

SELECT IF ((paid <> 0 ) &  (adjcode = "#C")) & (not_paid = 0).

Exe.

 

These are medical claims. The variable not_paid equals 1 if it is not paid. I only want to include paid. What happens is I still have claims in the data with paid = 0 after running this. There should only be claims that are either not equal to zero (could be positive or negative) or they could be paid = 0 so long as adjcode = “#C” indicating that they are paid at a capitated rate. But there are still claims that are just flat out paid = 0, and are not capped claims.

 

If I run a compute statement and then select based on that compute statement it works. That looks like so:

 

Compute finalized = ((paid <> 0 ) &  (adjcode = "#C")) & (not_paid = 0).

Exe.

 

And then

 

Select if (finalized = 1).

Exe.

 

So why doesn’t the select if do the same thing as the compute?

 

Thanks

Matt

 

Matthew Pirritano, Ph.D.

Research Analyst IV

Medical Services Initiative (MSI)

Orange County Health Care Agency

(714) 568-5648

 

Reply | Threaded
Open this post in threaded view
|

Re: select if not working as expected

David Marso
Administrator
In reply to this post by mpirritano
Do any of these values depend on LAGged logic ( probably definitely)?
Maybe something funny with Missing values (probably irrelevant)?
I bet if you remove the exe  Before the select on your "compute version" you will end up with the same thing as the "select version".
Reread the thread re LAG you started a month ago ;-(.
--
mpirritano wrote
All,

 

I've seen this before, I have a workaround, and reading the manual I
don't see why this happens. When I run the following select if, at least
one part of it doesn't work:

 

SELECT IF ((paid <> 0 ) &  (adjcode = "#C")) & (not_paid = 0).

Exe.

 

These are medical claims. The variable not_paid equals 1 if it is not
paid. I only want to include paid. What happens is I still have claims
in the data with paid = 0 after running this. There should only be
claims that are either not equal to zero (could be positive or negative)
or they could be paid = 0 so long as adjcode = "#C" indicating that they
are paid at a capitated rate. But there are still claims that are just
flat out paid = 0, and are not capped claims.

 

If I run a compute statement and then select based on that compute
statement it works. That looks like so:

 

Compute finalized = ((paid <> 0 ) &  (adjcode = "#C")) & (not_paid = 0).

Exe.

 

And then

 

Select if (finalized = 1).

Exe.

 

So why doesn't the select if do the same thing as the compute?

 

Thanks

Matt

 

Matthew Pirritano, Ph.D.

Research Analyst IV

Medical Services Initiative (MSI)

Orange County Health Care Agency

(714) 568-5648
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
|

Automatic reply: select if not working as expected

Matthew Fuller-Tyszkiewicz


Hi,

I'm away on leave until Monday 28th November. I will not have access to my email account while away, and willl endeavour to return your emails shortly after my return.

Cheers,
Matt.


 

Reply | Threaded
Open this post in threaded view
|

Re: select if not working as expected

Art Kendall
In reply to this post by mpirritano
can you cobble together a small set of syntax that has a few cases and demonstrates the problem?

Art Kendall
Social Research Consultants

On 10/27/2011 5:04 PM, Pirritano, Matthew wrote:

All,

 

I’ve seen this before, I have a workaround, and reading the manual I don’t see why this happens. When I run the following select if, at least one part of it doesn’t work:

 

SELECT IF ((paid <> 0 ) &  (adjcode = "#C")) & (not_paid = 0).

Exe.

 

These are medical claims. The variable not_paid equals 1 if it is not paid. I only want to include paid. What happens is I still have claims in the data with paid = 0 after running this. There should only be claims that are either not equal to zero (could be positive or negative) or they could be paid = 0 so long as adjcode = “#C” indicating that they are paid at a capitated rate. But there are still claims that are just flat out paid = 0, and are not capped claims.

 

If I run a compute statement and then select based on that compute statement it works. That looks like so:

 

Compute finalized = ((paid <> 0 ) &  (adjcode = "#C")) & (not_paid = 0).

Exe.

 

And then

 

Select if (finalized = 1).

Exe.

 

So why doesn’t the select if do the same thing as the compute?

 

Thanks

Matt

 

Matthew Pirritano, Ph.D.

Research Analyst IV

Medical Services Initiative (MSI)

Orange County Health Care Agency

(714) 568-5648

 

===================== 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 if not working as expected

Melissa Ives
In reply to this post by Maguin, Eugene

Matt, Based on your stated desire (and untested) “either not equal to zero (could be positive or negative) or they could be paid = 0 so long as adjcode = “#C””

 

It seems that your parens and & are not quite the way you want them.

 

SELECT IF ((paid <>0) or (paid=0 & adjcode = "#C"))

 

I am not certain how not_paid=0 would differ from/relates to paid <>0, but the code above would be

either not equal to zero (could be positive or negative) or they could be paid = 0 so long as adjcode = “#C””.

If you want to ALSO include any where paid and adjcode can be anything as long as not_paid=0, then add

 

SELECT IF ((paid <>0) or (paid=0 & adjcode = "#C") or not_paid=0)

 

I am not sure why your finalized variable works since the syntax says that all three conditions need to be satisfied to get at finalized=1, but from your note, it does not seem that all three should be possible together.

 

Maybe I am missing something.

 

HTH,

Melissa

From: SPSSX(r) Discussion [hidden email] On Behalf Of Pirritano, Matthew
Sent: Thursday, October 27, 2011 5:05 PM
To: [hidden email]
Subject: select if not working as expected

 

All,

 

I’ve seen this before, I have a workaround, and reading the manual I don’t see why this happens. When I run the following select if, at least one part of it doesn’t work:

 

SELECT IF ((paid <> 0 ) &  (adjcode = "#C")) & (not_paid = 0).

Exe.

 

These are medical claims. The variable not_paid equals 1 if it is not paid. I only want to include paid. What happens is I still have claims in the data with paid = 0 after running this. There should only be claims that are either not equal to zero (could be positive or negative) or they could be paid = 0 so long as adjcode = “#C” indicating that they are paid at a capitated rate. But there are still claims that are just flat out paid = 0, and are not capped claims.

 

If I run a compute statement and then select based on that compute statement it works. That looks like so:

 

Compute finalized = ((paid <> 0 ) &  (adjcode = "#C")) & (not_paid = 0).

Exe.

 

And then

 

Select if (finalized = 1).

Exe.

 

So why doesn’t the select if do the same thing as the compute?

 

Thanks

Matt

 

Matthew Pirritano, Ph.D.

Research Analyst IV

Medical Services Initiative (MSI)

Orange County Health Care Agency

(714) 568-5648

 



PRIVILEGED AND CONFIDENTIAL INFORMATION
This transmittal and any attachments may contain PRIVILEGED AND
CONFIDENTIAL information and is intended only for the use of the
addressee. If you are not the designated recipient, or an employee
or agent authorized to deliver such transmittals to the designated
recipient, you are hereby notified that any dissemination,
copying or publication of this transmittal is strictly prohibited. If
you have received this transmittal in error, please notify us
immediately by replying to the sender and delete this copy from your
system. You may also call us at (309) 827-6026 for assistance.
Reply | Threaded
Open this post in threaded view
|

Re: select if not working as expected

mpirritano

Just to close the thread.

 

The syntax did work. It appears that I had not run it on part of the data. The file was the result of a merge of two files.

 

There was no lag issue.

 

Thanks

Matt

 

Matthew Pirritano, Ph.D.

Research Analyst IV

Medical Services Initiative (MSI)

Orange County Health Care Agency

(714) 568-5648


From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Melissa Ives
Sent: Friday, October 28, 2011 6:59 AM
To: [hidden email]
Subject: Re: select if not working as expected

 

Matt, Based on your stated desire (and untested) “either not equal to zero (could be positive or negative) or they could be paid = 0 so long as adjcode = “#C””

 

It seems that your parens and & are not quite the way you want them.

 

SELECT IF ((paid <>0) or (paid=0 & adjcode = "#C"))

 

I am not certain how not_paid=0 would differ from/relates to paid <>0, but the code above would be

either not equal to zero (could be positive or negative) or they could be paid = 0 so long as adjcode = “#C””.

If you want to ALSO include any where paid and adjcode can be anything as long as not_paid=0, then add

 

SELECT IF ((paid <>0) or (paid=0 & adjcode = "#C") or not_paid=0)

 

I am not sure why your finalized variable works since the syntax says that all three conditions need to be satisfied to get at finalized=1, but from your note, it does not seem that all three should be possible together.

 

Maybe I am missing something.

 

HTH,

Melissa

From: SPSSX(r) Discussion [hidden email] On Behalf Of Pirritano, Matthew
Sent: Thursday, October 27, 2011 5:05 PM
To: [hidden email]
Subject: select if not working as expected

 

All,

 

I’ve seen this before, I have a workaround, and reading the manual I don’t see why this happens. When I run the following select if, at least one part of it doesn’t work:

 

SELECT IF ((paid <> 0 ) &  (adjcode = "#C")) & (not_paid = 0).

Exe.

 

These are medical claims. The variable not_paid equals 1 if it is not paid. I only want to include paid. What happens is I still have claims in the data with paid = 0 after running this. There should only be claims that are either not equal to zero (could be positive or negative) or they could be paid = 0 so long as adjcode = “#C” indicating that they are paid at a capitated rate. But there are still claims that are just flat out paid = 0, and are not capped claims.

 

If I run a compute statement and then select based on that compute statement it works. That looks like so:

 

Compute finalized = ((paid <> 0 ) &  (adjcode = "#C")) & (not_paid = 0).

Exe.

 

And then

 

Select if (finalized = 1).

Exe.

 

So why doesn’t the select if do the same thing as the compute?

 

Thanks

Matt

 

Matthew Pirritano, Ph.D.

Research Analyst IV

Medical Services Initiative (MSI)

Orange County Health Care Agency

(714) 568-5648

 

 


PRIVILEGED AND CONFIDENTIAL INFORMATION
This transmittal and any attachments may contain PRIVILEGED AND
CONFIDENTIAL information and is intended only for the use of the
addressee. If you are not the designated recipient, or an employee
or agent authorized to deliver such transmittals to the designated
recipient, you are hereby notified that any dissemination,
copying or publication of this transmittal is strictly prohibited. If
you have received this transmittal in error, please notify us
immediately by replying to the sender and delete this copy from your
system. You may also call us at (309) 827-6026 for assistance.