Retain user-missing item values in calculated scales

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

Retain user-missing item values in calculated scales

Melissa Ives

I suspect this is not difficult, but I have not been able to find a simple solution

I have searched the archives and did not find anything related to my question(s) (in bold below).

 

Is there a simple way to retain the user-missing value of items used to calculate an index or scale?

In my dataset I calculate >100 scales rnd(mean.3(varlist)*k) and indices sum.k(varlist) -- where k is the number of items in the scale/index.

 

However, this leaves the scale/index as sysmis if the right number of items are user- missing. 

We have a series of consistency codes in the items (-3 optional item not asked, -4 bad data/didn’t ask item -7 Refused, -8 DK, -9 legit skip) that I want retained in the calculated scale. 

As shown below:

DESIRED Result

Indx  B4a  B4b  B4c  B4d  B4e  B4f  B4g  B4h      

 -8  .00  .00 1.00  .00  .00 1.00  .00 -8.0     

 -8  .00  .00 1.00  .00 1.00 1.00  .00 -8.0     

 -8  .00  .00 1.00  .00  .00  .00  .00 -8.0     

 -8  .00  .00  .00  .00  .00 1.00  .00 -8.0     

 -4  .00  .00  .00 -4.0 1.00  .00  .00 1.00     

 -8 -8.0 -8.0 -8.0 -8.0 -8.0 -8.0 -8.0 -8.0     

 -9 -9.0 -9.0 -9.0 -9.0 -9.0 -9.0 -9.0 -9.0 ß all will be -9 if any are.

-7  .00  .00 1.00  .00  .00 1.00  .00 -7.0 ß -4 and/or -8 could also be in this row    

 -3 -3.0 -3.0 -3.0 -3.0 -3.0 -3.0 -3.0 -3.0 ß all will be -3 if any are.

-8  .00  .00  .00 -4.0 1.00 -8.0  .00 1.00 ß this is possible (-8 and -4 in the same row)    

 

This is the general format of the current syntax.

missing values b4a to b4h (lo thru -3).

compute Indx =sum.8(B4a to B4h). ßis there a way to say ‘or take the lowest user missing value’ instead of the next statements?

freq Indx.                                 ßa command that reads the data is required before the next step or the new missing values take effect before the Indx is calculated.

missing values b4a to b4h ().

IF sysmis(Indx) Indx =min(B4a to B4h). LßAlternatively, is there a way to ask for  the min(value(B4a)….value(B4h)) without needing to set missing values off?                                                          

freq Indx.                                    ßa command that reads the data is required before the next step or the new missing values take effect before the Indx is updated.

missing values Indx b4a to b4h (lo thru -3).

 

Melissa Ives
[hidden email]

voice: 309-451-7819
 
Young people have an optimism and ability to think broadly about how we can create a better world. Older generations have an obligation to teach us how it came to be this way. Somewhere in the middle, we find ways to become better.  Jesse McDermeit 2012
<>< <><

 



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: Retain user-missing item values in calculated scales

Jon K Peck
Setting missing values off isn't so painful if you do it TEMPORARY.

TEMPORARY.
MISSING VALUES ALL ().
IF ...

You can also wrap the reference to a variable in the VALUE function, which takes away the missingness.

Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        Melissa Ives <[hidden email]>
To:        [hidden email],
Date:        04/03/2013 04:21 PM
Subject:        [SPSSX-L] Retain user-missing item values in calculated scales
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




I suspect this is not difficult, but I have not been able to find a simple solution
I have searched the archives and did not find anything related to my question(s) (in bold below).
 
Is there a simple way to retain the user-missing value of items used to calculate an index or scale?
In my dataset I calculate >100 scales rnd(mean.3(varlist)*k) and indices sum.k(varlist) -- where k is the number of items in the scale/index.
 
However, this leaves the scale/index as sysmis if the right number of items are user- missing.  
We have a series of consistency codes in the items (-3 optional item not asked, -4 bad data/didn’t ask item -7 Refused, -8 DK, -9 legit skip) that I want retained in the calculated scale.  
As shown below:
DESIRED Result
Indx  B4a  B4b  B4c  B4d  B4e  B4f  B4g  B4h      
 -8  .00  .00 1.00  .00  .00 1.00  .00 -8.0      
 -8  .00  .00 1.00  .00 1.00 1.00  .00 -8.0      
 -8  .00  .00 1.00  .00  .00  .00  .00 -8.0      
 -8  .00  .00  .00  .00  .00 1.00  .00 -8.0      
 -4  .00  .00  .00 -4.0 1.00  .00  .00 1.00      
 -8 -8.0 -8.0 -8.0 -8.0 -8.0 -8.0 -8.0 -8.0      
 -9 -9.0 -9.0 -9.0 -9.0 -9.0 -9.0 -9.0 -9.0 ß all will be -9 if any are.
-7  .00  .00 1.00  .00  .00 1.00  .00 -7.0 ß -4 and/or -8 could also be in this row    
 -3 -3.0 -3.0 -3.0 -3.0 -3.0 -3.0 -3.0 -3.0 ß all will be -3 if any are.
-8  .00  .00  .00 -4.0 1.00 -8.0  .00 1.00 ß this is possible (-8 and -4 in the same row)    
 
This is the general format of the current syntax.
missing values b4a to b4h (lo thru -3).
compute Indx =sum.8(B4a to B4h). ßis there a way to say ‘or take the lowest user missing value’ instead of the next statements?
freq Indx.                                 ßa command that reads the data is required before the next step or the new missing values take effect before the Indx is calculated.
missing values b4a to b4h ().
IF sysmis(Indx) Indx =min(B4a to B4h). LßAlternatively, is there a way to ask for  the min(value(B4a)….value(B4h)) without needing to set missing values off?                                                          
freq Indx.                                    ßa command that reads the data is required before the next step or the new missing values take effect before the Indx is updated.
missing values Indx b4a to b4h (lo thru -3).
 
Melissa Ives
mives@...
voice: 309-451-7819


Young people have an optimism and ability to think broadly about how we can create a better world. Older generations have an obligation to teach us how it came to be this way. Somewhere in the middle, we find ways to become better.  Jesse McDermeit 2012
<>< <><

 



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: Retain user-missing item values in calculated scales

Melissa Ives

Jon,

 

Thanks,

I didn’t know Missing could be within temporary.  Good to know!  That may actually be the answer here.

 

I have used value frequently but couldn’t find a way to make it work simply with the ‘to’ convention..

e.g. IF sysmis(Indx) Indx =min(value(B4a) to value(B4h)).  doesn’t work (although I suspect typing out each variable might, but that’s not happening since there are too many to do.

nor does IF sysmis(Indx) Indx =value(min(B4a to B4h)). which didn’t’ seem like it should work-but I did try it JIC.

 

Melissa

 

From: Jon K Peck [mailto:[hidden email]]
Sent: Wednesday, April 03, 2013 10:13 PM
To: Melissa Ives
Cc: [hidden email]
Subject: Re: [SPSSX-L] Retain user-missing item values in calculated scales

 

Setting missing values off isn't so painful if you do it TEMPORARY.

TEMPORARY.
MISSING VALUES ALL ().
IF ...

You can also wrap the reference to a variable in the VALUE function, which takes away the missingness.

Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        Melissa Ives <[hidden email]>
To:        [hidden email],
Date:        04/03/2013 04:21 PM
Subject:        [SPSSX-L] Retain user-missing item values in calculated scales
Sent by:        "SPSSX(r) Discussion" <[hidden email]>





I suspect this is not difficult, but I have not been able to find a simple solution
I have searched the archives and did not find anything related to my question(s) (in bold below).
 
Is there a simple way to retain the user-missing value of items used to calculate an index or scale?
In my dataset I calculate >100 scales rnd(mean.3(varlist)*k) and indices sum.k(varlist) -- where k is the number of items in the scale/index.
 
However, this leaves the scale/index as sysmis if the right number of items are user- missing.  
We have a series of consistency codes in the items (-3 optional item not asked, -4 bad data/didn’t ask item -7 Refused, -8 DK, -9 legit skip) that I want retained in the calculated scale.  
As shown below:
DESIRED Result
Indx  B4a  B4b  B4c  B4d  B4e  B4f  B4g  B4h      
 -8  .00  .00 1.00  .00  .00 1.00  .00 -8.0      
 -8  .00  .00 1.00  .00 1.00 1.00  .00 -8.0      
 -8  .00  .00 1.00  .00  .00  .00  .00 -8.0      
 -8  .00  .00  .00  .00  .00 1.00  .00 -8.0      
 -4  .00  .00  .00 -4.0 1.00  .00  .00 1.00      
 -8 -8.0 -8.0 -8.0 -8.0 -8.0 -8.0 -8.0 -8.0      
 -9 -9.0 -9.0 -9.0 -9.0 -9.0 -9.0 -9.0 -9.0 ß all will be -9 if any are.
-7  .00  .00 1.00  .00  .00 1.00  .00 -7.0 ß -4 and/or -8 could also be in this row    
 -3 -3.0 -3.0 -3.0 -3.0 -3.0 -3.0 -3.0 -3.0 ß all will be -3 if any are.
-8  .00  .00  .00 -4.0 1.00 -8.0  .00 1.00 ß this is possible (-8 and -4 in the same row)    
 
This is the general format of the current syntax.
missing values b4a to b4h (lo thru -3).
compute Indx =sum.8(B4a to B4h). ßis there a way to say ‘or take the lowest user missing value’ instead of the next statements?
freq Indx.                                 ßa command that reads the data is required before the next step or the new missing values take effect before the Indx is calculated.
missing values b4a to b4h ().
IF sysmis(Indx) Indx =min(B4a to B4h). LßAlternatively, is there a way to ask for  the min(value(B4a)….value(B4h)) without needing to set missing values off?                                                          
freq Indx.                                    ßa command that reads the data is required before the next step or the new missing values take effect before the Indx is updated.
missing values Indx b4a to b4h (lo thru -3).
 
Melissa Ives
[hidden email]
voice: 309-451-7819


Young people have an optimism and ability to think broadly about how we can create a better world. Older generations have an obligation to teach us how it came to be this way. Somewhere in the middle, we find ways to become better.  Jesse McDermeit 2012
<>< <><

 

 


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: Retain user-missing item values in calculated scales

Melissa Ives
In reply to this post by Melissa Ives

I am seeing some odd behavior—since refused (-7) is not quite the minimum missing value, I need to reset missing to -7 if there are any in the response for missing values.

When I run this syntax (thanks Jon for using temp before missing), the first section works correctly, but the second reverts all previously missing to sysmis. (Same thing happens with do if any(-7…) and Recode PAI (lo thru -3, missing= -7).  What am I missing?

 

temp.

missing values b2e to b2j ().

If (sysmis(PAI)) PAI=min(b2e to b2j).

freq pai.

 

temp.

missing values b2e to b2j ().

If any(-7, b2e to b2j) PAI=-7.  /** 2011 data had no -7s for this.

freq pai.

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Melissa Ives
Sent: Wednesday, April 03, 2013 5:18 PM
To: [hidden email]
Subject: [SPSSX-L] Retain user-missing item values in calculated scales

 

I suspect this is not difficult, but I have not been able to find a simple solution

I have searched the archives and did not find anything related to my question(s) (in bold below).

 

Is there a simple way to retain the user-missing value of items used to calculate an index or scale?

In my dataset I calculate >100 scales rnd(mean.3(varlist)*k) and indices sum.k(varlist) -- where k is the number of items in the scale/index.

 

However, this leaves the scale/index as sysmis if the right number of items are user- missing. 

We have a series of consistency codes in the items (-3 optional item not asked, -4 bad data/didn’t ask item -7 Refused, -8 DK, -9 legit skip) that I want retained in the calculated scale. 

As shown below:

DESIRED Result

Indx  B4a  B4b  B4c  B4d  B4e  B4f  B4g  B4h      

 -8  .00  .00 1.00  .00  .00 1.00  .00 -8.0     

 -8  .00  .00 1.00  .00 1.00 1.00  .00 -8.0     

 -8  .00  .00 1.00  .00  .00  .00  .00 -8.0     

 -8  .00  .00  .00  .00  .00 1.00  .00 -8.0     

 -4  .00  .00  .00 -4.0 1.00  .00  .00 1.00     

 -8 -8.0 -8.0 -8.0 -8.0 -8.0 -8.0 -8.0 -8.0     

 -9 -9.0 -9.0 -9.0 -9.0 -9.0 -9.0 -9.0 -9.0 ß all will be -9 if any are.

-7  .00  .00 1.00  .00  .00 1.00  .00 -7.0 ß -4 and/or -8 could also be in this row    

 -3 -3.0 -3.0 -3.0 -3.0 -3.0 -3.0 -3.0 -3.0 ß all will be -3 if any are.

-8  .00  .00  .00 -4.0 1.00 -8.0  .00 1.00 ß this is possible (-8 and -4 in the same row)    

 

This is the general format of the current syntax.

missing values b4a to b4h (lo thru -3).

compute Indx =sum.8(B4a to B4h). ßis there a way to say ‘or take the lowest user missing value’ instead of the next statements?

freq Indx.                                 ßa command that reads the data is required before the next step or the new missing values take effect before the Indx is calculated.

missing values b4a to b4h ().

IF sysmis(Indx) Indx =min(B4a to B4h). LßAlternatively, is there a way to ask for  the min(value(B4a)….value(B4h)) without needing to set missing values off?                                                          

freq Indx.                                    ßa command that reads the data is required before the next step or the new missing values take effect before the Indx is updated.

missing values Indx b4a to b4h (lo thru -3).

 

Melissa Ives
[hidden email]

voice: 309-451-7819
 
Young people have an optimism and ability to think broadly about how we can create a better world. Older generations have an obligation to teach us how it came to be this way. Somewhere in the middle, we find ways to become better.  Jesse McDermeit 2012
<>< <><

 

 


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: Retain user-missing item values in calculated scales

Bruce Weaver
Administrator
Melissa, I don't remember seeing PAI before in this thread -- you were computing Indx earlier.  How is PAI computed?  And what is the range of user-defined missing values when the computation is done?  Thanks for clarifying.



Melissa Ives wrote
I am seeing some odd behavior-since refused (-7) is not quite the minimum missing value, I need to reset missing to -7 if there are any in the response for missing values.
When I run this syntax (thanks Jon for using temp before missing), the first section works correctly, but the second reverts all previously missing to sysmis. (Same thing happens with do if any(-7...) and Recode PAI (lo thru -3, missing= -7).  What am I missing?

temp.
missing values b2e to b2j ().
If (sysmis(PAI)) PAI=min(b2e to b2j).
freq pai.

temp.
missing values b2e to b2j ().
If any(-7, b2e to b2j) PAI=-7.  /** 2011 data had no -7s for this.
freq pai.

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Melissa Ives
Sent: Wednesday, April 03, 2013 5:18 PM
To: [hidden email]
Subject: [SPSSX-L] Retain user-missing item values in calculated scales

I suspect this is not difficult, but I have not been able to find a simple solution
I have searched the archives and did not find anything related to my question(s) (in bold below).

Is there a simple way to retain the user-missing value of items used to calculate an index or scale?
In my dataset I calculate >100 scales rnd(mean.3(varlist)*k) and indices sum.k(varlist) -- where k is the number of items in the scale/index.

However, this leaves the scale/index as sysmis if the right number of items are user- missing.
We have a series of consistency codes in the items (-3 optional item not asked, -4 bad data/didn't ask item -7 Refused, -8 DK, -9 legit skip) that I want retained in the calculated scale.
As shown below:
DESIRED Result
Indx  B4a  B4b  B4c  B4d  B4e  B4f  B4g  B4h
 -8  .00  .00 1.00  .00  .00 1.00  .00 -8.0
 -8  .00  .00 1.00  .00 1.00 1.00  .00 -8.0
 -8  .00  .00 1.00  .00  .00  .00  .00 -8.0
 -8  .00  .00  .00  .00  .00 1.00  .00 -8.0
 -4  .00  .00  .00 -4.0 1.00  .00  .00 1.00
 -8 -8.0 -8.0 -8.0 -8.0 -8.0 -8.0 -8.0 -8.0
 -9 -9.0 -9.0 -9.0 -9.0 -9.0 -9.0 -9.0 -9.0 <-- all will be -9 if any are.
-7  .00  .00 1.00  .00  .00 1.00  .00 -7.0 <-- -4 and/or -8 could also be in this row
 -3 -3.0 -3.0 -3.0 -3.0 -3.0 -3.0 -3.0 -3.0 <-- all will be -3 if any are.
-8  .00  .00  .00 -4.0 1.00 -8.0  .00 1.00 <-- this is possible (-8 and -4 in the same row)

This is the general format of the current syntax.
missing values b4a to b4h (lo thru -3).
compute Indx =sum.8(B4a to B4h). <--is there a way to say 'or take the lowest user missing value' instead of the next statements?
freq Indx.                                 <--a command that reads the data is required before the next step or the new missing values take effect before the Indx is calculated.
missing values b4a to b4h ().
IF sysmis(Indx) Indx =min(B4a to B4h). L<--Alternatively, is there a way to ask for  the min(value(B4a)....value(B4h)) without needing to set missing values off?
freq Indx.                                    <--a command that reads the data is required before the next step or the new missing values take effect before the Indx is updated.
missing values Indx b4a to b4h (lo thru -3).

Melissa Ives
[hidden email]<mailto:[hidden email]>
voice: 309-451-7819

Young people have an optimism and ability to think broadly about how we can create a better world. Older generations have an obligation to teach us how it came to be this way. Somewhere in the middle, we find ways to become better.  Jesse McDermeit 2012
<>< <><


________________________________
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.
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: Retain user-missing item values in calculated scales

Melissa Ives
Bruce,
I'm looking more for the principle as I have several indices and scales that follow the same basic format for calculation.
To answer your questions:
The missing values are the same as below for Indx items (-3 optional item not asked, -4 bad data/didn't ask item -7 Refused, -8 DK, -9 legit skip (if the item CAN be skipped - not true for PAI or Indx)
--the same thing happens for that calculation using a similar syntax but replacing the varnames for PAI with those for Indx.
--PAI is calculated similarly to Indx: PAI=sum.5(B2e to B2j).  (Yes there are only 5 values for B2e to B2j since B2i is not used).

It seems that the missing values are only in effect for the frequency run (which is fine) AND the calculated values for PAI are NOT retained (which is NOT fine).

Melissa
-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Bruce Weaver
Sent: Friday, April 05, 2013 10:09 AM
To: [hidden email]
Subject: Re: [SPSSX-L] Retain user-missing item values in calculated scales

Melissa, I don't remember seeing PAI before in this thread -- you were computing Indx earlier.  How is PAI computed?  And what is the range of user-defined missing values when the computation is done?  Thanks for clarifying.




Melissa Ives wrote

> I am seeing some odd behavior-since refused (-7) is not quite the
> minimum missing value, I need to reset missing to -7 if there are any
> in the response for missing values.
> When I run this syntax (thanks Jon for using temp before missing), the
> first section works correctly, but the second reverts all previously
> missing to sysmis. (Same thing happens with do if any(-7...) and
> Recode PAI (lo thru -3, missing= -7).  What am I missing?
>
> temp.
> missing values b2e to b2j ().
> If (sysmis(PAI)) PAI=min(b2e to b2j).
> freq pai.
>
> temp.
> missing values b2e to b2j ().
> If any(-7, b2e to b2j) PAI=-7.  /** 2011 data had no -7s for this.
> freq pai.
>
> From: SPSSX(r) Discussion [mailto:

> SPSSX-L@.UGA

> ] On Behalf Of Melissa Ives
> Sent: Wednesday, April 03, 2013 5:18 PM
> To:

> SPSSX-L@.UGA

> Subject: [SPSSX-L] Retain user-missing item values in calculated
> scales
>
> I suspect this is not difficult, but I have not been able to find a
> simple solution I have searched the archives and did not find anything
> related to my
> question(s) (in bold below).
>
> Is there a simple way to retain the user-missing value of items used
> to calculate an index or scale?
> In my dataset I calculate >100 scales rnd(mean.3(varlist)*k) and
> indices
> sum.k(varlist) -- where k is the number of items in the scale/index.
>
> However, this leaves the scale/index as sysmis if the right number of
> items are user- missing.
> We have a series of consistency codes in the items (-3 optional item
> not asked, -4 bad data/didn't ask item -7 Refused, -8 DK, -9 legit
> skip) that I want retained in the calculated scale.
> As shown below:
> DESIRED Result
> Indx  B4a  B4b  B4c  B4d  B4e  B4f  B4g  B4h
>  -8  .00  .00 1.00  .00  .00 1.00  .00 -8.0
>  -8  .00  .00 1.00  .00 1.00 1.00  .00 -8.0
>  -8  .00  .00 1.00  .00  .00  .00  .00 -8.0
>  -8  .00  .00  .00  .00  .00 1.00  .00 -8.0
>  -4  .00  .00  .00 -4.0 1.00  .00  .00 1.00
>  -8 -8.0 -8.0 -8.0 -8.0 -8.0 -8.0 -8.0 -8.0
>  -9 -9.0 -9.0 -9.0 -9.0 -9.0 -9.0 -9.0 -9.0 <-- all will be -9 if any are.
> -7  .00  .00 1.00  .00  .00 1.00  .00 -7.0 <-- -4 and/or -8 could also
> be in this row
>  -3 -3.0 -3.0 -3.0 -3.0 -3.0 -3.0 -3.0 -3.0 <-- all will be -3 if any are.
> -8  .00  .00  .00 -4.0 1.00 -8.0  .00 1.00 <-- this is possible (-8
> and -4 in the same row)
>
> This is the general format of the current syntax.
> missing values b4a to b4h (lo thru -3).
> compute Indx =sum.8(B4a to B4h). <--is there a way to say 'or take the
> lowest user missing value' instead of the next statements?
> freq Indx.                                 <--a command that reads the
> data is required before the next step or the new missing values take
> effect before the Indx is calculated.
> missing values b4a to b4h ().
> IF sysmis(Indx) Indx =min(B4a to B4h). L<--Alternatively, is there a
> way to ask for  the min(value(B4a)....value(B4h)) without needing to
> set missing values off?
> freq Indx.                                    <--a command that reads the
> data is required before the next step or the new missing values take
> effect before the Indx is updated.
> missing values Indx b4a to b4h (lo thru -3).
>
> Melissa Ives

> mives@

> &lt;mailto:

> mives@

> &gt;
> voice: 309-451-7819
>
> Young people have an optimism and ability to think broadly about how
> we can create a better world. Older generations have an obligation to
> teach us how it came to be this way. Somewhere in the middle, we find
> ways to become better.  Jesse McDermeit 2012 <>< <><
>
>
> ________________________________
> 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.





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Retain-user-missing-item-values-in-calculated-scales-tp5719254p5719284.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

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

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.

=====================
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: Retain user-missing item values in calculated scales

Bruce Weaver
Administrator
"It seems that the missing values are only in effect for the frequency run (which is fine) AND the calculated values for PAI are NOT retained (which is NOT fine)."

Aha, got it.  But I think TEMPORARY is working exactly as documented, right?  

What you are looking for is something equivalent to PRESERVE - RESTORE, but for missing values rather than SET options.  I don't think there is any such beast.  You may have to revert to your original method:

missing values {varlist} ().
computations...
missing values {varlist} (lo thru -3).



Melissa Ives wrote
Bruce,
I'm looking more for the principle as I have several indices and scales that follow the same basic format for calculation.
To answer your questions:
The missing values are the same as below for Indx items (-3 optional item not asked, -4 bad data/didn't ask item -7 Refused, -8 DK, -9 legit skip (if the item CAN be skipped - not true for PAI or Indx)
--the same thing happens for that calculation using a similar syntax but replacing the varnames for PAI with those for Indx.
--PAI is calculated similarly to Indx: PAI=sum.5(B2e to B2j).  (Yes there are only 5 values for B2e to B2j since B2i is not used).

It seems that the missing values are only in effect for the frequency run (which is fine) AND the calculated values for PAI are NOT retained (which is NOT fine).

Melissa
-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Bruce Weaver
Sent: Friday, April 05, 2013 10:09 AM
To: [hidden email]
Subject: Re: [SPSSX-L] Retain user-missing item values in calculated scales

Melissa, I don't remember seeing PAI before in this thread -- you were computing Indx earlier.  How is PAI computed?  And what is the range of user-defined missing values when the computation is done?  Thanks for clarifying.




Melissa Ives wrote
> I am seeing some odd behavior-since refused (-7) is not quite the
> minimum missing value, I need to reset missing to -7 if there are any
> in the response for missing values.
> When I run this syntax (thanks Jon for using temp before missing), the
> first section works correctly, but the second reverts all previously
> missing to sysmis. (Same thing happens with do if any(-7...) and
> Recode PAI (lo thru -3, missing= -7).  What am I missing?
>
> temp.
> missing values b2e to b2j ().
> If (sysmis(PAI)) PAI=min(b2e to b2j).
> freq pai.
>
> temp.
> missing values b2e to b2j ().
> If any(-7, b2e to b2j) PAI=-7.  /** 2011 data had no -7s for this.
> freq pai.
>
> From: SPSSX(r) Discussion [mailto:

> SPSSX-L@.UGA

> ] On Behalf Of Melissa Ives
> Sent: Wednesday, April 03, 2013 5:18 PM
> To:

> SPSSX-L@.UGA

> Subject: [SPSSX-L] Retain user-missing item values in calculated
> scales
>
> I suspect this is not difficult, but I have not been able to find a
> simple solution I have searched the archives and did not find anything
> related to my
> question(s) (in bold below).
>
> Is there a simple way to retain the user-missing value of items used
> to calculate an index or scale?
> In my dataset I calculate >100 scales rnd(mean.3(varlist)*k) and
> indices
> sum.k(varlist) -- where k is the number of items in the scale/index.
>
> However, this leaves the scale/index as sysmis if the right number of
> items are user- missing.
> We have a series of consistency codes in the items (-3 optional item
> not asked, -4 bad data/didn't ask item -7 Refused, -8 DK, -9 legit
> skip) that I want retained in the calculated scale.
> As shown below:
> DESIRED Result
> Indx  B4a  B4b  B4c  B4d  B4e  B4f  B4g  B4h
>  -8  .00  .00 1.00  .00  .00 1.00  .00 -8.0
>  -8  .00  .00 1.00  .00 1.00 1.00  .00 -8.0
>  -8  .00  .00 1.00  .00  .00  .00  .00 -8.0
>  -8  .00  .00  .00  .00  .00 1.00  .00 -8.0
>  -4  .00  .00  .00 -4.0 1.00  .00  .00 1.00
>  -8 -8.0 -8.0 -8.0 -8.0 -8.0 -8.0 -8.0 -8.0
>  -9 -9.0 -9.0 -9.0 -9.0 -9.0 -9.0 -9.0 -9.0 <-- all will be -9 if any are.
> -7  .00  .00 1.00  .00  .00 1.00  .00 -7.0 <-- -4 and/or -8 could also
> be in this row
>  -3 -3.0 -3.0 -3.0 -3.0 -3.0 -3.0 -3.0 -3.0 <-- all will be -3 if any are.
> -8  .00  .00  .00 -4.0 1.00 -8.0  .00 1.00 <-- this is possible (-8
> and -4 in the same row)
>
> This is the general format of the current syntax.
> missing values b4a to b4h (lo thru -3).
> compute Indx =sum.8(B4a to B4h). <--is there a way to say 'or take the
> lowest user missing value' instead of the next statements?
> freq Indx.                                 <--a command that reads the
> data is required before the next step or the new missing values take
> effect before the Indx is calculated.
> missing values b4a to b4h ().
> IF sysmis(Indx) Indx =min(B4a to B4h). L<--Alternatively, is there a
> way to ask for  the min(value(B4a)....value(B4h)) without needing to
> set missing values off?
> freq Indx.                                    <--a command that reads the
> data is required before the next step or the new missing values take
> effect before the Indx is updated.
> missing values Indx b4a to b4h (lo thru -3).
>
> Melissa Ives

> mives@

> <mailto:

> mives@

> >
> voice: 309-451-7819
>
> Young people have an optimism and ability to think broadly about how
> we can create a better world. Older generations have an obligation to
> teach us how it came to be this way. Somewhere in the middle, we find
> ways to become better.  Jesse McDermeit 2012 <>< <><
>
>
> ________________________________
> 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.





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Retain-user-missing-item-values-in-calculated-scales-tp5719254p5719284.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

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

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.

=====================
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
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: Retain user-missing item values in calculated scales

Jon K Peck
All data and metadata changes done under TEMPORARY scope are reverted when temporary expires, but since XSAVE is a transformation command, it could record the values for the new variable, and you could then use that as your dataset.  The problem that leaves is that the nulled out missing value action would go along with the new dataset, which defeats the purpose of the temporary state.

So here's another approach without temporary.
1) kill all the missing values
2) run your calculation
3) use APPLY DICTIONARY to restore the missing values (or all the metadata) from the original dataset.


Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        Bruce Weaver <[hidden email]>
To:        [hidden email],
Date:        04/05/2013 09:51 AM
Subject:        Re: [SPSSX-L] Retain user-missing item values in calculated scales
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




"It seems that the missing values are only in effect for the frequency run
(which is fine) AND the calculated values for PAI are NOT retained (which is
NOT fine)."

Aha, got it.  But I /think/ TEMPORARY is working exactly as documented,
right?

What you are looking for is something equivalent to PRESERVE - RESTORE, but
for missing values rather than SET options.  I don't think there is any such
beast.  You may have to revert to your original method:

missing values {varlist} ().
computations...
missing values {varlist} (lo thru -3).




Melissa Ives wrote
> Bruce,
> I'm looking more for the principle as I have several indices and scales
> that follow the same basic format for calculation.
> To answer your questions:
> The missing values are the same as below for Indx items (-3 optional item
> not asked, -4 bad data/didn't ask item -7 Refused, -8 DK, -9 legit skip
> (if the item CAN be skipped - not true for PAI or Indx)
> --the same thing happens for that calculation using a similar syntax but
> replacing the varnames for PAI with those for Indx.
> --PAI is calculated similarly to Indx: PAI=sum.5(B2e to B2j).  (Yes there
> are only 5 values for B2e to B2j since B2i is not used).
>
> It seems that the missing values are only in effect for the frequency run
> (which is fine) AND the calculated values for PAI are NOT retained (which
> is NOT fine).
>
> Melissa
> -----Original Message-----
> From: SPSSX(r) Discussion [mailto:

> SPSSX-L@.UGA

> ] On Behalf Of Bruce Weaver
> Sent: Friday, April 05, 2013 10:09 AM
> To:

> SPSSX-L@.UGA

> Subject: Re: [SPSSX-L] Retain user-missing item values in calculated
> scales
>
> Melissa, I don't remember seeing PAI before in this thread -- you were
> computing Indx earlier.  How is PAI computed?  And what is the range of
> user-defined missing values when the computation is done?  Thanks for
> clarifying.
>
>
>
>
> Melissa Ives wrote
>> I am seeing some odd behavior-since refused (-7) is not quite the
>> minimum missing value, I need to reset missing to -7 if there are any
>> in the response for missing values.
>> When I run this syntax (thanks Jon for using temp before missing), the
>> first section works correctly, but the second reverts all previously
>> missing to sysmis. (Same thing happens with do if any(-7...) and
>> Recode PAI (lo thru -3, missing= -7).  What am I missing?
>>
>> temp.
>> missing values b2e to b2j ().
>> If (sysmis(PAI)) PAI=min(b2e to b2j).
>> freq pai.
>>
>> temp.
>> missing values b2e to b2j ().
>> If any(-7, b2e to b2j) PAI=-7.  /** 2011 data had no -7s for this.
>> freq pai.
>>
>> From: SPSSX(r) Discussion [mailto:
>
>> SPSSX-L@.UGA
>
>> ] On Behalf Of Melissa Ives
>> Sent: Wednesday, April 03, 2013 5:18 PM
>> To:
>
>> SPSSX-L@.UGA
>
>> Subject: [SPSSX-L] Retain user-missing item values in calculated
>> scales
>>
>> I suspect this is not difficult, but I have not been able to find a
>> simple solution I have searched the archives and did not find anything
>> related to my
>> question(s) (in bold below).
>>
>> Is there a simple way to retain the user-missing value of items used
>> to calculate an index or scale?
>> In my dataset I calculate >100 scales rnd(mean.3(varlist)*k) and
>> indices
>> sum.k(varlist) -- where k is the number of items in the scale/index.
>>
>> However, this leaves the scale/index as sysmis if the right number of
>> items are user- missing.
>> We have a series of consistency codes in the items (-3 optional item
>> not asked, -4 bad data/didn't ask item -7 Refused, -8 DK, -9 legit
>> skip) that I want retained in the calculated scale.
>> As shown below:
>> DESIRED Result
>> Indx  B4a  B4b  B4c  B4d  B4e  B4f  B4g  B4h
>>  -8  .00  .00 1.00  .00  .00 1.00  .00 -8.0
>>  -8  .00  .00 1.00  .00 1.00 1.00  .00 -8.0
>>  -8  .00  .00 1.00  .00  .00  .00  .00 -8.0
>>  -8  .00  .00  .00  .00  .00 1.00  .00 -8.0
>>  -4  .00  .00  .00 -4.0 1.00  .00  .00 1.00
>>  -8 -8.0 -8.0 -8.0 -8.0 -8.0 -8.0 -8.0 -8.0
>>  -9 -9.0 -9.0 -9.0 -9.0 -9.0 -9.0 -9.0 -9.0 <-- all will be -9 if any
>> are.
>> -7  .00  .00 1.00  .00  .00 1.00  .00 -7.0 <-- -4 and/or -8 could also
>> be in this row
>>  -3 -3.0 -3.0 -3.0 -3.0 -3.0 -3.0 -3.0 -3.0 <-- all will be -3 if any
>> are.
>> -8  .00  .00  .00 -4.0 1.00 -8.0  .00 1.00 <-- this is possible (-8
>> and -4 in the same row)
>>
>> This is the general format of the current syntax.
>> missing values b4a to b4h (lo thru -3).
>> compute Indx =sum.8(B4a to B4h). <--is there a way to say 'or take the
>> lowest user missing value' instead of the next statements?
>> freq Indx.                                 <--a command that reads the
>> data is required before the next step or the new missing values take
>> effect before the Indx is calculated.
>> missing values b4a to b4h ().
>> IF sysmis(Indx) Indx =min(B4a to B4h). L<--Alternatively, is there a
>> way to ask for  the min(value(B4a)....value(B4h)) without needing to
>> set missing values off?
>> freq Indx.                                    <--a command that reads the
>> data is required before the next step or the new missing values take
>> effect before the Indx is updated.
>> missing values Indx b4a to b4h (lo thru -3).
>>
>> Melissa Ives
>
>> mives@
>
>> &lt;mailto:
>
>> mives@
>
>> &gt;
>> voice: 309-451-7819
>>
>> Young people have an optimism and ability to think broadly about how
>> we can create a better world. Older generations have an obligation to
>> teach us how it came to be this way. Somewhere in the middle, we find
>> ways to become better.  Jesse McDermeit 2012 <>< <><
>>
>>
>> ________________________________
>> 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.
>
>
>
>
>
> -----
> --
> Bruce Weaver

> bweaver@

>
http://sites.google.com/a/lakeheadu.ca/bweaver/
>
> "When all else fails, RTFM."
>
> NOTE: My Hotmail account is not monitored regularly.
> To send me an e-mail, please use the address shown above.
>
> --
> View this message in context:
>
http://spssx-discussion.1045642.n5.nabble.com/Retain-user-missing-item-values-in-calculated-scales-tp5719254p5719284.html
> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

>  (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
>
> 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.
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

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





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/Retain-user-missing-item-values-in-calculated-scales-tp5719254p5719287.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

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