I think I ran into a new missunderstanding of an SPSS-concept.
btw: In the example below I am sorry for a missing BEGIN DATA - block. But it doesn't work like I expected so I put in the sample data manually. 'v15' can have 5 values including -9 as missing value. Now I want to transform that into a new yes/no-variable. 'v15b' can have say yes (1), no (0) and no value (-9). v15=6 means v15b=no. Quite simple I thought. But in the example below the case with v15=-9 is not transformed into v15b=-9. v15b is '.' Why? The other values are correct transformed. But what is this '.' about? Do I have to use a constant instead of -9? Something like v15b=MISSING. NUMERIC v15 (F2.0). VAR LEVEL v15 (NOMINAL). MISSING VALUES v15 (-9). VALUE LABELS v15 0 'yes aaa' 1 'yes bbb' 2 'yes ccc' 6 'no xxx' -9 '(no value)'. * Values (v15): 0 1 2 6 -9. NUMERIC v15b (F2.0). VAR LEVEL v15b (NOMINAL). MISSING VALUES v15b (-9). VALUE LABELS v15b -9 '(no value)' 0 'no' 1 'yes'. DO IF v15 EQ -9. COMPUTE v15b = -9. ELSE IF v15 EQ 6. COMPUTE v15b = 0. ELSE. COMPUTE v15b = 1. END IF. EXECUTE. LIST v15, v15b. = the output of LIST = v15 v15b 0 1 1 1 2 1 6 0 -9 . ===================== 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 |
Hi,
check the VALUE function, http://pic.dhe.ibm.com/infocenter/spssstat/v20r0m0/index.jsp?topic=%2Fcom.ibm.spss.statistics.help%2Fsyn_transformation_expressions_missing-value_functions.htm Regards, Albert-Jan ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a fresh water system, and public health, what have the Romans ever done for us? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ----- Original Message ----- > From: Moon Kid <[hidden email]> > To: [hidden email] > Cc: > Sent: Friday, April 4, 2014 1:08 PM > Subject: [SPSSX-L] '.' is not -9 > > I think I ran into a new missunderstanding of an SPSS-concept. > > btw: In the example below I am sorry for a missing BEGIN DATA - block. > But it doesn't work like I expected so I put in the sample data > manually. > > 'v15' can have 5 values including -9 as missing value. > Now I want to transform that into a new yes/no-variable. > 'v15b' can have say yes (1), no (0) and no value (-9). > v15=6 means v15b=no. > > Quite simple I thought. > > But in the example below the case with v15=-9 is not transformed into > v15b=-9. v15b is '.' > Why? > > The other values are correct transformed. But what is this '.' about? > Do I have to use a constant instead of -9? Something like v15b=MISSING. > > NUMERIC v15 (F2.0). > VAR LEVEL v15 (NOMINAL). > MISSING VALUES v15 (-9). > VALUE LABELS v15 > 0 'yes aaa' > 1 'yes bbb' > 2 'yes ccc' > 6 'no xxx' > -9 '(no value)'. > > * Values (v15): 0 1 2 6 -9. > > NUMERIC v15b (F2.0). > VAR LEVEL v15b (NOMINAL). > MISSING VALUES v15b (-9). > VALUE LABELS v15b > -9 '(no value)' > 0 'no' > 1 'yes'. > > DO IF v15 EQ -9. > COMPUTE v15b = -9. > ELSE IF v15 EQ 6. > COMPUTE v15b = 0. > ELSE. > COMPUTE v15b = 1. > END IF. > > EXECUTE. > LIST v15, v15b. > > = the output of LIST = > v15 v15b > > 0 1 > 1 1 > 2 1 > 6 0 > -9 . > > ===================== > 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 |
On 2014-04-04 04:19 Albert-Jan Roskam <[hidden email]> wrote:
> check the VALUE function, > <http://pic.dhe.ibm.com/infocenter/spssstat/v20r0m0/index.jsp?topic=%2Fcom.ibm.spss.statistics.help2Fsyn_transformation_expressions_missing-value_functions.htm> Ok, I read the section and changed my code to this. DO IF MISSING(v15). COMPUTE v15b = -9. ELSE IF v15 EQ 6. COMPUTE v15b = 0. ELSE. COMPUTE v15b = 1. END IF. But I am not sure about it. You told me to look vor VALUE. How could this be help me here? The docu tells me that VALUE return valid values but ingore the userdefined (in my case -9) missing ones. But what happen if there is a missing value? What does VALUE then return? And why is there a difference between system- and userdefined missing values? And what is the difference? ===================== 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 |
In reply to this post by Moon Kid
Use
DO IF value(v15) EQ -9. Missing values do not match other values because they are, well, missing. The value function extracts the value regardless of missing status. Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] phone: 720-342-5621 From: Moon Kid <[hidden email]> To: [hidden email], Date: 04/04/2014 05:09 AM Subject: [SPSSX-L] '.' is not -9 Sent by: "SPSSX(r) Discussion" <[hidden email]> I think I ran into a new missunderstanding of an SPSS-concept. btw: In the example below I am sorry for a missing BEGIN DATA - block. But it doesn't work like I expected so I put in the sample data manually. 'v15' can have 5 values including -9 as missing value. Now I want to transform that into a new yes/no-variable. 'v15b' can have say yes (1), no (0) and no value (-9). v15=6 means v15b=no. Quite simple I thought. But in the example below the case with v15=-9 is not transformed into v15b=-9. v15b is '.' Why? The other values are correct transformed. But what is this '.' about? Do I have to use a constant instead of -9? Something like v15b=MISSING. NUMERIC v15 (F2.0). VAR LEVEL v15 (NOMINAL). MISSING VALUES v15 (-9). VALUE LABELS v15 0 'yes aaa' 1 'yes bbb' 2 'yes ccc' 6 'no xxx' -9 '(no value)'. * Values (v15): 0 1 2 6 -9. NUMERIC v15b (F2.0). VAR LEVEL v15b (NOMINAL). MISSING VALUES v15b (-9). VALUE LABELS v15b -9 '(no value)' 0 'no' 1 'yes'. DO IF v15 EQ -9. COMPUTE v15b = -9. ELSE IF v15 EQ 6. COMPUTE v15b = 0. ELSE. COMPUTE v15b = 1. END IF. EXECUTE. LIST v15, v15b. = the output of LIST = v15 v15b 0 1 1 1 2 1 6 0 -9 . ===================== 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 |
Administrator
|
In reply to this post by Moon Kid
You could use one RECODE to create new variable v15b, and THEN make -9 a missing value. And when one recodes an existing variable into a new one, a cross-tabulation of the two variables provides a nice way to check that things have worked as intended. Note that if you assign missing values before the CROSSTABS command, the missing values will not appear in the table. So I prefer to assign the missing values AFTER the CROSSTABS command. E.g.,
* Create a small data set to illustrate. DATA LIST free / v15 (f2.0). BEGIN DATA 0 1 2 6 -9 END DATA. MISSING VALUES v15(-9). * Now RECODE v15 into v15b. * Note that RECODE can handle the fact that -9 is defined as missing. RECODE v15 (-9 = -9) (6 = 0) (ELSE = 1) into v15b. FORMATS v15b(f2.0). VARIABLE LEVEL v15b (NOMINAL). VALUE LABELS v15b -9 '(no value)' 0 'no' 1 'yes'. * Check that the RECODE has worked. MISSING VALUES v15 v15b (). /* No missing values for either. CROSSTABS v15 by v15b. MISSING VALUES v15 v15b (-9). /* -9 defined as missing for both.
--
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/). |
In reply to this post by Moon Kid
---- Original Message -----
> From: Moon Kid <[hidden email]> > To: [hidden email] > Cc: > Sent: Friday, April 4, 2014 2:37 PM > Subject: Re: [SPSSX-L] '.' is not -9 > > On 2014-04-04 04:19 Albert-Jan Roskam <[hidden email]> wrote: >> check the VALUE function, >> > <http://pic.dhe.ibm.com/infocenter/spssstat/v20r0m0/index.jsp?topic=%2Fcom.ibm.spss.statistics.help2Fsyn_transformation_expressions_missing-value_functions.htm> > > Ok, I read the section and changed my code to this. > > DO IF MISSING(v15). > COMPUTE v15b = -9. > ELSE IF v15 EQ 6. > COMPUTE v15b = 0. > ELSE. > COMPUTE v15b = 1. > END IF. > > But I am not sure about it. > > > You told me to look vor VALUE. How could this be help me here? > The docu tells me that VALUE return valid values but ingore the > userdefined (in my case -9) missing ones. >But what happen if there is a > missing value? What does VALUE then return? $symis, aka NULL, NA compute is_user_missing = not missing(value(x)) and missing(x). > And why is there a difference between system- and userdefined missing > values? And what is the difference? User missing values are excluded from most statistical calculations, yet the underlying info (-9 = 'don't know', -99 'person died during survey', etc.) is not lost. System missing values ($sysmis) are really empty values. Sysmis stands for 'any value'. ===================== 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 |
In reply to this post by Moon Kid
From the CSR:
MISSING VALUES declares values user-missing. These values can then receive special treatment in data transformations, statistical calculations, and case selection. By default, user-missing values are treated the same as the system-missing values. System-missing values are automatically assigned by the program when no legal value can be produced, such as when an alphabetical character is encountered in the data for a numeric variable, or when an illegal calculation, such as division by 0, is requested in a data transformation. In practice, user missing values are used for things like no answer, does not apply, etc. You can have up to three values (or a range) declared for a variable, so sometimes you want to analyze these together with valid values. The VALUE function returns the actual value such as -9, but if it is system missing value, VALUE will return $SYSMIS. The MISSING and related functions abstract from the particular missing value codes. Note that $SYSMIS does not compare equal to itself just like in mathematics an infinity value is not equal to another infinity value. Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] phone: 720-342-5621 From: Moon Kid <[hidden email]> To: [hidden email], Date: 04/04/2014 06:38 AM Subject: Re: [SPSSX-L] '.' is not -9 Sent by: "SPSSX(r) Discussion" <[hidden email]> On 2014-04-04 04:19 Albert-Jan Roskam <[hidden email]> wrote: > check the VALUE function, > <http://pic.dhe.ibm.com/infocenter/spssstat/v20r0m0/index.jsp?topic=%2Fcom.ibm.spss.statistics.help2Fsyn_transformation_expressions_missing-value_functions.htm> Ok, I read the section and changed my code to this. DO IF MISSING(v15). COMPUTE v15b = -9. ELSE IF v15 EQ 6. COMPUTE v15b = 0. ELSE. COMPUTE v15b = 1. END IF. But I am not sure about it. You told me to look vor VALUE. How could this be help me here? The docu tells me that VALUE return valid values but ingore the userdefined (in my case -9) missing ones. But what happen if there is a missing value? What does VALUE then return? And why is there a difference between system- and userdefined missing values? And what is the difference? ===================== 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 |
In reply to this post by Albert-Jan Roskam
From the Help system, installed with the
product and available from the Help menu:
VALUE. VALUE(variable). Numeric. Returns the value of variable, ignoring user missing-value definitions for variable, which must be a numeric variable name or a vector reference to a variable name. If you search for "missing values" in the Help system, installed with the product and available on the Help menu, you might find more information that will provide additional insights. Rick Oliver Senior Information Developer IBM Business Analytics (SPSS) E-mail: [hidden email] From: Albert-Jan Roskam <[hidden email]> To: [hidden email], Date: 04/04/2014 08:40 AM Subject: Re: '.' is not -9 Sent by: "SPSSX(r) Discussion" <[hidden email]> ---- Original Message ----- > From: Moon Kid <[hidden email]> > To: [hidden email] > Cc: > Sent: Friday, April 4, 2014 2:37 PM > Subject: Re: [SPSSX-L] '.' is not -9 > > On 2014-04-04 04:19 Albert-Jan Roskam <[hidden email]> wrote: >> check the VALUE function, >> > <http://pic.dhe.ibm.com/infocenter/spssstat/v20r0m0/index.jsp?topic=%2Fcom.ibm.spss.statistics.help2Fsyn_transformation_expressions_missing-value_functions.htm> > > Ok, I read the section and changed my code to this. > > DO IF MISSING(v15). > COMPUTE v15b = -9. > ELSE IF v15 EQ 6. > COMPUTE v15b = 0. > ELSE. > COMPUTE v15b = 1. > END IF. > > But I am not sure about it. > > > You told me to look vor VALUE. How could this be help me here? > The docu tells me that VALUE return valid values but ingore the > userdefined (in my case -9) missing ones. >But what happen if there is a > missing value? What does VALUE then return? $symis, aka NULL, NA compute is_user_missing = not missing(value(x)) and missing(x). > And why is there a difference between system- and userdefined missing > values? And what is the difference? User missing values are excluded from most statistical calculations, yet the underlying info (-9 = 'don't know', -99 'person died during survey', etc.) is not lost. System missing values ($sysmis) are really empty values. Sysmis stands for 'any value'. ===================== 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 |
In reply to this post by Jon K Peck
On 2014-04-04 07:52 Jon K Peck <[hidden email]> wrote:
> The VALUE function returns the actual value such as -9, but if it is > system missing value, VALUE will return $SYSMIS. So I misinterpreted the words "VALUE ignores missing values". Thx for explanation. ===================== 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 |
In reply to this post by Rick Oliver-3
Despite Moon Kid’s long and convoluted speech about coming from different systems and trying so hard to learn, I still think that he is a lazy bum pumping us
for the most obvious and tedious tutoring. My two cents. Bozena
From: SPSSX(r) Discussion [mailto:[hidden email]]
On Behalf Of Rick Oliver From the Help system, installed with the product and available from the Help menu:
|
I apologize for assuming that Moon Kid is a “he”. I actually do not know that... Bozena
From: Zdaniuk, Bozena
Despite Moon Kid’s long and convoluted speech about coming from different systems and trying so hard to learn, I still think that he is a lazy bum pumping us
for the most obvious and tedious tutoring. My two cents. Bozena
From: SPSSX(r) Discussion [[hidden email]]
On Behalf Of Rick Oliver From the Help system, installed with the product and available from the Help menu:
|
In reply to this post by Zdaniuk, Bozena-3
My impression is different. I think
Moon Kid is trying to do a complicated project in a big hurry and is starting
from knowing nothing about SPSS. And whatever you think about his
communication style, I wouldn't call him lazy. In fact, I think he
has learned a lot about SPSS, including some rather advanced topics, in
a very short period of time with help from this group and reading of the
manuals without much local while not working in his native language.
So put him in your kill file if you like, but cut him some slack. My two cents. Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] phone: 720-342-5621 From: "Zdaniuk, Bozena" <[hidden email]> To: [hidden email], Date: 04/04/2014 10:44 AM Subject: [SPSSX-L] moon kid and laziness Sent by: "SPSSX(r) Discussion" <[hidden email]> Despite Moon Kid’s long and convoluted speech about coming from different systems and trying so hard to learn, I still think that he is a lazy bum pumping us for the most obvious and tedious tutoring. My two cents. Bozena From: SPSSX(r) Discussion [[hidden email]] On Behalf Of Rick Oliver Sent: April 4, 2014 6:57 AM To: [hidden email] Subject: Re: '.' is not -9 From the Help system, installed with the product and available from the Help menu: VALUE. VALUE(variable). Numeric. Returns the value of variable, ignoring user missing-value definitions for variable, which must be a numeric variable name or a vector reference to a variable name. If you search for "missing values" in the Help system, installed with the product and available on the Help menu, you might find more information that will provide additional insights. Rick Oliver Senior Information Developer IBM Business Analytics (SPSS) E-mail: oliverr@... From: Albert-Jan Roskam <fomcl@...> To: [hidden email], Date: 04/04/2014 08:40 AM Subject: Re: '.' is not -9 Sent by: "SPSSX(r) Discussion" <[hidden email]> ---- Original Message ----- > From: Moon Kid <moonkid@...> > To: [hidden email] > Cc: > Sent: Friday, April 4, 2014 2:37 PM > Subject: Re: [SPSSX-L] '.' is not -9 > > On 2014-04-04 04:19 Albert-Jan Roskam <fomcl@...> wrote: >> check the VALUE function, >> > <http://pic.dhe.ibm.com/infocenter/spssstat/v20r0m0/index.jsp?topic=%2Fcom.ibm.spss.statistics.help2Fsyn_transformation_expressions_missing-value_functions.htm> > > Ok, I read the section and changed my code to this. > > DO IF MISSING(v15). > COMPUTE v15b = -9. > ELSE IF v15 EQ 6. > COMPUTE v15b = 0. > ELSE. > COMPUTE v15b = 1. > END IF. > > But I am not sure about it. > > > You told me to look vor VALUE. How could this be help me here? > The docu tells me that VALUE return valid values but ingore the > userdefined (in my case -9) missing ones. >But what happen if there is a > missing value? What does VALUE then return? $symis, aka NULL, NA compute is_user_missing = not missing(value(x)) and missing(x). > And why is there a difference between system- and userdefined missing > values? And what is the difference? User missing values are excluded from most statistical calculations, yet the underlying info (-9 = 'don't know', -99 'person died during survey', etc.) is not lost. System missing values ($sysmis) are really empty values. Sysmis stands for 'any value'. ===================== To manage your subscription to SPSSX-L, send a message to LISTSERV@... (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 |
In reply to this post by Zdaniuk, Bozena-3
In addition to the documentation installed
with the application, there is also the programming and data management
book:
https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/We70df3195ec8_4f95_9773_42e448fa9029/page/Books%20and%20Articles It contains many detailed examples, and some of them illustrate basic concepts. There is also the tried and true method: when in doubt, try it out. For example, to see what the value function does with missing values, you could try something like this: data list free/var1. begin data 1 2 3 4 5 end data. missing values var1 (5). compute var2=var1. compute var3=value(var1). list. Rick Oliver Senior Information Developer IBM Business Analytics (SPSS) E-mail: [hidden email] From: "Zdaniuk, Bozena" <[hidden email]> To: [hidden email], Date: 04/04/2014 11:48 AM Subject: moon kid and laziness Sent by: "SPSSX(r) Discussion" <[hidden email]> Despite Moon Kid’s long and convoluted speech about coming from different systems and trying so hard to learn, I still think that he is a lazy bum pumping us for the most obvious and tedious tutoring. My two cents. Bozena From: SPSSX(r) Discussion [[hidden email]] On Behalf Of Rick Oliver Sent: April 4, 2014 6:57 AM To: [hidden email] Subject: Re: '.' is not -9 From the Help system, installed with the product and available from the Help menu: VALUE. VALUE(variable). Numeric. Returns the value of variable, ignoring user missing-value definitions for variable, which must be a numeric variable name or a vector reference to a variable name. If you search for "missing values" in the Help system, installed with the product and available on the Help menu, you might find more information that will provide additional insights. Rick Oliver Senior Information Developer IBM Business Analytics (SPSS) E-mail: oliverr@... From: Albert-Jan Roskam <fomcl@...> To: [hidden email], Date: 04/04/2014 08:40 AM Subject: Re: '.' is not -9 Sent by: "SPSSX(r) Discussion" <[hidden email]> ---- Original Message ----- > From: Moon Kid <moonkid@...> > To: [hidden email] > Cc: > Sent: Friday, April 4, 2014 2:37 PM > Subject: Re: [SPSSX-L] '.' is not -9 > > On 2014-04-04 04:19 Albert-Jan Roskam <fomcl@...> wrote: >> check the VALUE function, >> > <http://pic.dhe.ibm.com/infocenter/spssstat/v20r0m0/index.jsp?topic=%2Fcom.ibm.spss.statistics.help2Fsyn_transformation_expressions_missing-value_functions.htm> > > Ok, I read the section and changed my code to this. > > DO IF MISSING(v15). > COMPUTE v15b = -9. > ELSE IF v15 EQ 6. > COMPUTE v15b = 0. > ELSE. > COMPUTE v15b = 1. > END IF. > > But I am not sure about it. > > > You told me to look vor VALUE. How could this be help me here? > The docu tells me that VALUE return valid values but ingore the > userdefined (in my case -9) missing ones. >But what happen if there is a > missing value? What does VALUE then return? $symis, aka NULL, NA compute is_user_missing = not missing(value(x)) and missing(x). > And why is there a difference between system- and userdefined missing > values? And what is the difference? User missing values are excluded from most statistical calculations, yet the underlying info (-9 = 'don't know', -99 'person died during survey', etc.) is not lost. System missing values ($sysmis) are really empty values. Sysmis stands for 'any value'. ===================== To manage your subscription to SPSSX-L, send a message to LISTSERV@... (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 |
In reply to this post by Zdaniuk, Bozena-3
I greatly appreciate the cross fertilization that SHOULD occur in forums such
as this. But at the same time, this forum SHOULD NOT supplant one's own responsibility for their learning, or self-performing their homework. The frequency and granularity of the innumerable questions from Moon Kid certainly suggest that he/she is relying on the collective experience, knowledge and wisdom of the primary contributors to this listserv to do for him/her what he/she appears unable or unwilling to do. Cheers, ===================== 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 |
In reply to this post by Moon Kid
A system missing value
means that the software is unable to do what you are telling it
to do.
On input it means that the input cannot be read by the format you specified. In transformations it means that there is something about the data or the operations so that the software cannot do as you tell it to. IMO good practice is to redraft your syntax so that there are no SYSTEM missing values. i.e., all missing values are labelled, e.g., (untested) COMPUTE Validitems = NVALID(Item01 to Item10). COMPUTE MeanScore = MEAN.5 (ITEM01 TO ITEM10). RECODE MeanScore (SYSMIS = -999)(ELSE=COPY). IF ValidItems eq 0 MeanScore = -998). MISSING VALUES MeanScore (-999 thru -990). VALUE LABELS MeanScore -999 'answered some but not 5 or more items' -998 'answered no items'. A user missing value means that the user knows why the value is missing. E.g., the data is not applicable such as number of pregnancies for a male, the respondent refused to answer, the case was not chosen in sampling for more detailed followup, coffee spilled on answer sheet, ran out of time, etc. It is often necessary to assess whether values can be treated as missing or random, or if it is necessary to see whether non-response rates are plausibly due to what true response would be. P.S. You have mentioned that English is not your first language. However IMO good practice (aka due diligence) means that your syntax should be readable by people. The kind of variable names you are using are syntactically okay, but do not relate to the substantive meaning of your variables. Art Kendall Social Research ConsultantsOn 4/4/2014 8:50 AM, Moon Kid [via SPSSX Discussion] wrote: And why is there a difference between system- and userdefined missing
Art Kendall
Social Research Consultants |
In reply to this post by Bruce Weaver
At 09:16 AM 4/4/2014, Bruce Weaver wrote:
>And when one recodes an existing variable into a new one, a >cross-tabulation of the two variables provides a nice way to check >that things have worked as intended. Note that if you assign >missing values before the CROSSTABS command, the missing values will >not appear in the table. So I prefer to assign the missing values >AFTER the CROSSTABS command. Or, you can specify option /MISSING=INCLUDE on the CROSSTABS command, which will give you the CROSSTABS you'd get if the variables had no user-missing values set. ===================== 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 |
In reply to this post by Moon Kid
At 07:08 AM 4/4/2014, Moon Kid posted the following syntax, noting
that it when -9 is a user-missing value for v15, it doesn't give the desired result: >DO IF v15 EQ -9. > COMPUTE v15b = -9. >ELSE IF v15 EQ 6. > COMPUTE v15b = 0. >ELSE. > COMPUTE v15b = 1. >END IF. You've had responses about why this isn't working, and what to do about it. Bruce Weaver suggested RECODE instead of a DO IF chain. I'd like to emphasize that; RECODE is both very powerful and very fast (and, if written with care, very readable), and should be used wherever it's applicable. In your case, RECODE v15 (-9 = -9) ( 6 = 0) (ELSE = 1) INTO v15b. This can also be improved, to be more robust against data errors: You have, VALUE LABELS v15 0 'yes aaa' 1 'yes bbb' 2 'yes ccc' 6 'no xxx' -9 '(no value)'. so you might write RECODE v15 (0,1 = 1) (6 = 0) (-9 = -9) (ELSE = -8) INTO v15b. MISSING VALUES v15b (-8,-9). VALUE LABELS v15b -8 'Mis-code' -9 '(no value)' 0 'no' 1 'yes'. ===================== 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 |