The data wasn't entered that way, it was coded that way by the automated system that the data collectors used to do the phone interviews . I had simplified things a bit for my question. Each participant was responding to a different vignette, and each vignette represented a different DSM-IV diagnosis. The question (paraphrased) was "How likely is it that the vignette character was experiencing ILLNESS" where ILLNESS was replaced by the vignette diagnosis (i.e., schizophrenia, PTSD, major depressive disorder, etc.). Since these were technically different questions the people collecting the data coded them as different variables in their automated interview system, and we received the data set resulting from that process, which had the answers to that question in 12 different variables, each representing the answers to a vignette.
The data set includes lots of different questions, all coded as one variable with the vignette variable indicating which vignette the participant was responding to. This one question was an exception because it included a reference to the diagnostic label (ILLNESS), which differed for every vignette. -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of David Marso Sent: Tuesday, December 10, 2013 11:10 PM To: [hidden email] Subject: Re: Simplify this syntax? OK. I see. Wonder why anyone would enter data that way rather than 2 vars vignette_number score? Richard Ristow wrote > At 06:50 PM 12/10/2013, David Marso wrote: >>>I think all this code will do is set diagnostic to the last variable >>>specified that has a non-missing value. >> >>I don't think it will. I KNOW IT WILL! >>OP needs to create correct syntax before attempting to simplify >>defective syntax! > > But it may not be defective. In the original posting, at 05:07 PM > 12/10/2013, Michelle Hendricks asked: > >>We did [a survey] in which each participant each responded to one of >>12 vignettes. [Each was] asked the same question about [their] >>vignette, but [the answers were] coded into 12 different variables. I >>simply want to combine them into one variable. > > As I understand this, there should be exactly one non-missing value > among those twelve (C01Q12.rev TO C01Q23.rev); as long as that's true, > setting 'Diagnostic' to the first, or last, non-missing value will > pick up that single non-missing value. > > As I noted above, it's well to put in a test to assure that there > *is* exactly one, or at most one, non-missing value. > > ===================== > 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 ----- 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?" -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Simplify-this-syntax-tp5723556p5723576.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 ===================== 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 |
Michelle,
Can you provide an example (in the email body...the listserv doesn't accept attachments) so that we can see the data setup? Brian -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Hendricks, Michelle A. Sent: Wednesday, December 11, 2013 10:46 AM To: [hidden email] Subject: Re: Simplify this syntax? The data wasn't entered that way, it was coded that way by the automated system that the data collectors used to do the phone interviews . I had simplified things a bit for my question. Each participant was responding to a different vignette, and each vignette represented a different DSM-IV diagnosis. The question (paraphrased) was "How likely is it that the vignette character was experiencing ILLNESS" where ILLNESS was replaced by the vignette diagnosis (i.e., schizophrenia, PTSD, major depressive disorder, etc.). Since these were technically different questions the people collecting the data coded them as different variables in their automated interview system, and we received the data set resulting from that process, which had the answers to that question in 12 different variables, each representing the answers to a vignette. The data set includes lots of different questions, all coded as one variable with the vignette variable indicating which vignette the participant was responding to. This one question was an exception because it included a reference to the diagnostic label (ILLNESS), which differed for every vignette. -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of David Marso Sent: Tuesday, December 10, 2013 11:10 PM To: [hidden email] Subject: Re: Simplify this syntax? OK. I see. Wonder why anyone would enter data that way rather than 2 vars vignette_number score? Richard Ristow wrote > At 06:50 PM 12/10/2013, David Marso wrote: >>>I think all this code will do is set diagnostic to the last variable >>>specified that has a non-missing value. >> >>I don't think it will. I KNOW IT WILL! >>OP needs to create correct syntax before attempting to simplify >>defective syntax! > > But it may not be defective. In the original posting, at 05:07 PM > 12/10/2013, Michelle Hendricks asked: > >>We did [a survey] in which each participant each responded to one of >>12 vignettes. [Each was] asked the same question about [their] >>vignette, but [the answers were] coded into 12 different variables. I >>simply want to combine them into one variable. > > As I understand this, there should be exactly one non-missing value > among those twelve (C01Q12.rev TO C01Q23.rev); as long as that's true, > setting 'Diagnostic' to the first, or last, non-missing value will > pick up that single non-missing value. > > As I noted above, it's well to put in a test to assure that there > *is* exactly one, or at most one, non-missing value. > > ===================== > 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 ----- 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?" -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Simplify-this-syntax-tp5723556p5723576.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 ===================== 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 |
Hi Brian,
I had provided an example a while back, but I think it got buried! Though I think I've been offered some good solutions. Vignette C01Q12 C01Q13 C01Q14 Diagnostic 1 2 2 1 3 3 1 4 4 2 1 1 2 4 4 2 2 2 3 4 4 3 4 4 3 1 1 -----Original Message----- From: Dates, Brian [mailto:[hidden email]] Sent: Wednesday, December 11, 2013 9:49 AM To: Hendricks, Michelle A.; [hidden email] Subject: RE: Simplify this syntax? Michelle, Can you provide an example (in the email body...the listserv doesn't accept attachments) so that we can see the data setup? Brian -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Hendricks, Michelle A. Sent: Wednesday, December 11, 2013 10:46 AM To: [hidden email] Subject: Re: Simplify this syntax? The data wasn't entered that way, it was coded that way by the automated system that the data collectors used to do the phone interviews . I had simplified things a bit for my question. Each participant was responding to a different vignette, and each vignette represented a different DSM-IV diagnosis. The question (paraphrased) was "How likely is it that the vignette character was experiencing ILLNESS" where ILLNESS was replaced by the vignette diagnosis (i.e., schizophrenia, PTSD, major depressive disorder, etc.). Since these were technically different questions the people collecting the data coded them as different variables in their automated interview system, and we received the data set resulting from that process, which had the answers to that question in 12 different variables, each representing the answers to a vignette. The data set includes lots of different questions, all coded as one variable with the vignette variable indicating which vignette the participant was responding to. This one question was an exception because it included a reference to the diagnostic label (ILLNESS), which differed for every vignette. -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of David Marso Sent: Tuesday, December 10, 2013 11:10 PM To: [hidden email] Subject: Re: Simplify this syntax? OK. I see. Wonder why anyone would enter data that way rather than 2 vars vignette_number score? Richard Ristow wrote > At 06:50 PM 12/10/2013, David Marso wrote: >>>I think all this code will do is set diagnostic to the last variable >>>specified that has a non-missing value. >> >>I don't think it will. I KNOW IT WILL! >>OP needs to create correct syntax before attempting to simplify >>defective syntax! > > But it may not be defective. In the original posting, at 05:07 PM > 12/10/2013, Michelle Hendricks asked: > >>We did [a survey] in which each participant each responded to one of >>12 vignettes. [Each was] asked the same question about [their] >>vignette, but [the answers were] coded into 12 different variables. I >>simply want to combine them into one variable. > > As I understand this, there should be exactly one non-missing value > among those twelve (C01Q12.rev TO C01Q23.rev); as long as that's true, > setting 'Diagnostic' to the first, or last, non-missing value will > pick up that single non-missing value. > > As I noted above, it's well to put in a test to assure that there > *is* exactly one, or at most one, non-missing value. > > ===================== > 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 ----- 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?" -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Simplify-this-syntax-tp5723556p5723576.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 ===================== 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 |
Administrator
|
Previously others have mentioned the SUM and MAX functions which will work.
If the data are arrayed as described (one can use the Vignette code to index into the position of the desired value) then the following goes straight for the jugular. DATA LIST FREE /Vignette C01Q12 C01Q13 C01Q14 . BEGIN DATA. 1 2 . . 1 3 . . 1 4 . . 2 . 1 . 2 . 4 . 2 . 2 . 3 . . 4 3 . . 4 3 . . 1 end data. VECTOR V=C01Q12 TO C01Q14. COMPUTE diagnosis=V(Vignette). LIST.
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?" |
In reply to this post by Michelle Hendricks-2
Michelle,
The DO REPEAT code isn't working because you can't list your variables as you did because they do not end in sequential numbers (the TO syntax functions differently here than in VALUE LABELS or KEEP). Listing out each variable should fix your original code. DO repeat y = C01Q12.rev C01Q13.rev C01Q14.rev C01Q15.rev C01Q16.rev C01Q17.rev C01Q18.rev C01Q19.rev C01Q20.rev C01Q21.rev C01Q22.rev C01Q23.rev. DO IF (Missing(y) = 0). compute Diagnostic = y. end if. END REPEAT. I have been tripped up by this one before! In the end, I learned a few slicker ideas reading through some of the other responses. Aaron Weis Horizon Research, Inc. Chapel Hill, NC 27514 -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Michelle Hendricks Sent: Tuesday, December 10, 2013 5:07 PM To: [hidden email] Subject: Simplify this syntax? Hi, I'm new at working with SPSS syntax, and since subscribing to this list I realize that a lot of syntax I write can be made much simpler. The below syntax is for a survey we did in which each participant each responded to one of 12 vignettes. They were asked the same question about each vignette, but this was coded into 12 different variables. I simply want to combine them into one variable. The below syntax does the job, but I'm looking for a simpler way. IF (Missing(C01Q12.rev) = 0) Diagnostic = C01Q12.rev. IF (Missing(C01Q13.rev) = 0) Diagnostic = C01Q13.rev. IF (Missing(C01Q14.rev) = 0) Diagnostic = C01Q14.rev. IF (Missing(C01Q15.rev) = 0) Diagnostic = C01Q15.rev. IF (Missing(C01Q16.rev) = 0) Diagnostic = C01Q16.rev. IF (Missing(C01Q17.rev) = 0) Diagnostic = C01Q17.rev. IF (Missing(C01Q18.rev) = 0) Diagnostic = C01Q18.rev. IF (Missing(C01Q19.rev) = 0) Diagnostic = C01Q19.rev. IF (Missing(C01Q20.rev) = 0) Diagnostic = C01Q20.rev. IF (Missing(C01Q21.rev) = 0) Diagnostic = C01Q21.rev. IF (Missing(C01Q22.rev) = 0) Diagnostic = C01Q22.rev. IF (Missing(C01Q23.rev) = 0) Diagnostic = C01Q23.rev. execute. I've played around with the DO REPEAT command (my attempt posted below), but I just can't get it to work correctly and I was hoping someone could tell me what I'm doing wrong! DO repeat y = C01Q12.rev TO C01Q23.rev . DO IF (Missing(y) = 0). compute Diagnostic = y. end if. END REPEAT. Thanks, Michelle ===================== 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 |
Administrator
|
"The DO REPEAT code isn't working because you can't list your variables as you did because they do not end in sequential numbers ".
Aaron, That is simply false! That statement would apply only if one were creating NEW variables on another DO REPEAT token list . Demo: DATA LIST LIST / A B C. BEGIN DATA 1 2 3 2 3 4 END DATA. NUMERIC D E F. DO REPEAT v=A TO C /w= D TO F. COMPUTE w=v**2. END REPEAT. LIST. A B C D E F 1.00 2.00 3.00 1.00 4.00 9.00 2.00 3.00 4.00 4.00 9.00 16.00 Number of cases read: 2 Number of cases listed: 2
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?" |
Correct. When referring to existing variables,
the TO keyword refers to file order. If the file order is A, C, D, B, then
A TO B includes all four variables from A to B inclusive.
Rick Oliver Senior Information Developer IBM Business Analytics (SPSS) E-mail: [hidden email] From: David Marso <[hidden email]> To: [hidden email], Date: 12/11/2013 12:22 PM Subject: Re: Simplify this syntax? Sent by: "SPSSX(r) Discussion" <[hidden email]> "The DO REPEAT code isn't working because you can't list your variables as you did because they do not end in sequential numbers ". Aaron, That is simply false! That statement would apply only if one were creating NEW variables on another DO REPEAT token list . Demo: DATA LIST LIST / A B C. BEGIN DATA 1 2 3 2 3 4 END DATA. NUMERIC D E F. DO REPEAT v=A TO C /w= D TO F. COMPUTE w=v**2. END REPEAT. LIST. A B C D E F 1.00 2.00 3.00 1.00 4.00 9.00 2.00 3.00 4.00 4.00 9.00 16.00 Number of cases read: 2 Number of cases listed: 2 Aaron Weis wrote > Michelle, > > The DO REPEAT code isn't working because you can't list your variables as > you did because they do not end in sequential numbers (the TO syntax > functions differently here than in VALUE LABELS or KEEP). Listing out > each variable should fix your original code. > > DO repeat y = C01Q12.rev C01Q13.rev C01Q14.rev C01Q15.rev C01Q16.rev > C01Q17.rev C01Q18.rev C01Q19.rev C01Q20.rev C01Q21.rev C01Q22.rev > C01Q23.rev. > DO IF (Missing(y) = 0). > compute Diagnostic = y. > end if. > END REPEAT. > > > I have been tripped up by this one before! In the end, I learned a few > slicker ideas reading through some of the other responses. > > Aaron Weis > Horizon Research, Inc. > Chapel Hill, NC 27514 > > > > -----Original Message----- > From: SPSSX(r) Discussion [mailto: > SPSSX-L@.UGA > ] On Behalf Of Michelle Hendricks > Sent: Tuesday, December 10, 2013 5:07 PM > To: > SPSSX-L@.UGA > Subject: Simplify this syntax? > > Hi, > > I'm new at working with SPSS syntax, and since subscribing to this list I > realize that a lot of syntax I write can be made much simpler. The below > syntax is for a survey we did in which each participant each responded to > one of 12 vignettes. They were asked the same question about each > vignette, but this was coded into 12 different variables. I simply want > to combine them into one variable. The below syntax does the job, but I'm > looking for a simpler way. > > IF (Missing(C01Q12.rev) = 0) Diagnostic = C01Q12.rev. > IF (Missing(C01Q13.rev) = 0) Diagnostic = C01Q13.rev. > IF (Missing(C01Q14.rev) = 0) Diagnostic = C01Q14.rev. > IF (Missing(C01Q15.rev) = 0) Diagnostic = C01Q15.rev. > IF (Missing(C01Q16.rev) = 0) Diagnostic = C01Q16.rev. > IF (Missing(C01Q17.rev) = 0) Diagnostic = C01Q17.rev. > IF (Missing(C01Q18.rev) = 0) Diagnostic = C01Q18.rev. > IF (Missing(C01Q19.rev) = 0) Diagnostic = C01Q19.rev. > IF (Missing(C01Q20.rev) = 0) Diagnostic = C01Q20.rev. > IF (Missing(C01Q21.rev) = 0) Diagnostic = C01Q21.rev. > IF (Missing(C01Q22.rev) = 0) Diagnostic = C01Q22.rev. > IF (Missing(C01Q23.rev) = 0) Diagnostic = C01Q23.rev. > execute. > > I've played around with the DO REPEAT command (my attempt posted below), > but I just can't get it to work correctly and I was hoping someone could > tell me what I'm doing wrong! > > > DO repeat y = C01Q12.rev TO C01Q23.rev . > DO IF (Missing(y) = 0). > compute Diagnostic = y. > end if. > END REPEAT. > > Thanks, > Michelle > > ===================== > 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 > > ===================== > 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 ----- 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?" -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Simplify-this-syntax-tp5723556p5723602.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 |
In reply to this post by David Marso
Ah, my apologies. Indeed I was thinking of this issue in the context of creating new variables. Thanks for pointing this out.
-----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of David Marso Sent: Wednesday, December 11, 2013 1:22 PM To: [hidden email] Subject: Re: Simplify this syntax? "The DO REPEAT code isn't working because you can't list your variables as you did because they do not end in sequential numbers ". Aaron, That is simply false! That statement would apply only if one were creating NEW variables on another DO REPEAT token list . Demo: DATA LIST LIST / A B C. BEGIN DATA 1 2 3 2 3 4 END DATA. NUMERIC D E F. DO REPEAT v=A TO C /w= D TO F. COMPUTE w=v**2. END REPEAT. LIST. A B C D E F 1.00 2.00 3.00 1.00 4.00 9.00 2.00 3.00 4.00 4.00 9.00 16.00 Number of cases read: 2 Number of cases listed: 2 Aaron Weis wrote > Michelle, > > The DO REPEAT code isn't working because you can't list your variables > as you did because they do not end in sequential numbers (the TO > syntax functions differently here than in VALUE LABELS or KEEP). > Listing out each variable should fix your original code. > > DO repeat y = C01Q12.rev C01Q13.rev C01Q14.rev C01Q15.rev C01Q16.rev > C01Q17.rev C01Q18.rev C01Q19.rev C01Q20.rev C01Q21.rev C01Q22.rev > C01Q23.rev. > DO IF (Missing(y) = 0). > compute Diagnostic = y. > end if. > END REPEAT. > > > I have been tripped up by this one before! In the end, I learned a > few slicker ideas reading through some of the other responses. > > Aaron Weis > Horizon Research, Inc. > Chapel Hill, NC 27514 > > > > -----Original Message----- > From: SPSSX(r) Discussion [mailto: > SPSSX-L@.UGA > ] On Behalf Of Michelle Hendricks > Sent: Tuesday, December 10, 2013 5:07 PM > To: > SPSSX-L@.UGA > Subject: Simplify this syntax? > > Hi, > > I'm new at working with SPSS syntax, and since subscribing to this > list I realize that a lot of syntax I write can be made much simpler. > The below syntax is for a survey we did in which each participant each > responded to one of 12 vignettes. They were asked the same question > about each vignette, but this was coded into 12 different variables. > I simply want to combine them into one variable. The below syntax does > the job, but I'm looking for a simpler way. > > IF (Missing(C01Q12.rev) = 0) Diagnostic = C01Q12.rev. > IF (Missing(C01Q13.rev) = 0) Diagnostic = C01Q13.rev. > IF (Missing(C01Q14.rev) = 0) Diagnostic = C01Q14.rev. > IF (Missing(C01Q15.rev) = 0) Diagnostic = C01Q15.rev. > IF (Missing(C01Q16.rev) = 0) Diagnostic = C01Q16.rev. > IF (Missing(C01Q17.rev) = 0) Diagnostic = C01Q17.rev. > IF (Missing(C01Q18.rev) = 0) Diagnostic = C01Q18.rev. > IF (Missing(C01Q19.rev) = 0) Diagnostic = C01Q19.rev. > IF (Missing(C01Q20.rev) = 0) Diagnostic = C01Q20.rev. > IF (Missing(C01Q21.rev) = 0) Diagnostic = C01Q21.rev. > IF (Missing(C01Q22.rev) = 0) Diagnostic = C01Q22.rev. > IF (Missing(C01Q23.rev) = 0) Diagnostic = C01Q23.rev. > execute. > > I've played around with the DO REPEAT command (my attempt posted > below), but I just can't get it to work correctly and I was hoping > someone could tell me what I'm doing wrong! > > > DO repeat y = C01Q12.rev TO C01Q23.rev . > DO IF (Missing(y) = 0). > compute Diagnostic = y. > end if. > END REPEAT. > > Thanks, > Michelle > > ===================== > 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 > > ===================== > 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 ----- 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?" -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Simplify-this-syntax-tp5723556p5723602.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 ===================== 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 |