|
Dear all,
I have three variables (V1,V2,V3) which are all in date format (MOYR8 ie. mmm yyyy). For each case, 0 up to 3 of these variables can have missing values. I'd like to compute the min of these 3 vars : COMPUTE min_ER=MIN(V1,V2,V3). /* var min_ER is still in numeric format*/ EXE. At this stage, when I look in the data view, the variable is set to the min date when there are 2 or 3 non-missing arguments but to value '8' when there is only one non-missing argument. Obviously when converting min_er into a date, I get missing values for the '8'. Can anyone help me on this? Many Thanks, Erwan ===================== 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 |
|
Erwan,
Would using "min_ER=min.1(V1,V2,B3)" followed by a format statement for min_ER to set it as a date do what you want? Adding the .1 means that there must be at least one valid value for v1-3. If you want to require valid values (non-missing) for all you would use min.3 instead. (Why is the value being set to 8?) Melissa -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Erwan LE DÛ Sent: Thursday, January 24, 2008 7:39 AM To: [hidden email] Subject: [SPSSX-L] Dates, Dates, Dates ... Dear all, I have three variables (V1,V2,V3) which are all in date format (MOYR8 ie. mmm yyyy). For each case, 0 up to 3 of these variables can have missing values. I'd like to compute the min of these 3 vars : COMPUTE min_ER=MIN(V1,V2,V3). /* var min_ER is still in numeric format*/ EXE. At this stage, when I look in the data view, the variable is set to the min date when there are 2 or 3 non-missing arguments but to value '8' when there is only one non-missing argument. Obviously when converting min_er into a date, I get missing values for the '8'. Can anyone help me on this? Many Thanks, Erwan ===================== 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 |
|
In reply to this post by Erwan LE DÛ
That is min_ER=min.1(V1,V2,V3) not min_ER=min.1(V1,V2,B3)
Melissa -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Melissa Ives Sent: Thursday, January 24, 2008 1:38 PM To: [hidden email] Subject: Re: [SPSSX-L] Dates, Dates, Dates ... Erwan, Would using "min_ER=min.1(V1,V2,B3)" followed by a format statement for min_ER to set it as a date do what you want? Adding the .1 means that there must be at least one valid value for v1-3. If you want to require valid values (non-missing) for all you would use min.3 instead. (Why is the value being set to 8?) Melissa -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Erwan LE DÛ Sent: Thursday, January 24, 2008 7:39 AM To: [hidden email] Subject: [SPSSX-L] Dates, Dates, Dates ... Dear all, I have three variables (V1,V2,V3) which are all in date format (MOYR8 ie. mmm yyyy). For each case, 0 up to 3 of these variables can have missing values. I'd like to compute the min of these 3 vars : COMPUTE min_ER=MIN(V1,V2,V3). /* var min_ER is still in numeric format*/ EXE. At this stage, when I look in the data view, the variable is set to the min date when there are 2 or 3 non-missing arguments but to value '8' when there is only one non-missing argument. Obviously when converting min_er into a date, I get missing values for the '8'. Can anyone help me on this? Many Thanks, Erwan ===================== 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 ===================== 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 |
