Hello Everyone, I am computing a segment variable consisting of two segments. The code is as follows… Compute segment=0. If (cell=1 or cell=2 or cell=3 or cell=4 or cell=5 or cell=6 or cell=7 or cell=8 or cell=9 or cell=10 or cell=11 or cell=12 or cell=13 or cell=14 or cell=15 or cell=16 or cell=17 or cell=18 or cell=19 or cell=20) and (segmentm=mc or segmentm=md) and segmentp=p3 and segmentc=cy segment=1. If (cell=21 or cell=22 or cell=23 or cell=24) and (segmentm=me or segmentm=mg) and (segmentp=p1 or segmentp=p2) segment=2. The problem I’m running into is that SPSS won’t let me use string variables for this. Is there any way I can carry out this syntax with the string variables or a workaround for using string variables that anyone may know? Thank you in advance for all of your help, Colin Colin M. Valdiserri Informed Decisions Group, Inc. 8854 Jordan Court | North Ridgeville, Ohio | 44039 cvaldiserri@... Follow us on LinkedIn The information and attachments contained in this e-mail message is intended for the use of the recipient(s) named above and is privileged and confidential. If you are not the intended recipient, you are formally notified that you have received this message in error and that any review, dissemination, distribution, or copying of the message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the original message. |
Put quotes around the string values: If (cell=21 or cell=22 or cell=23 or cell=24) and (segmentm=”me” or segmentm=”mg”) and (segmentp=”p1”
or segmentp=”p2”) segment=2. Matthew J Poes Research Data Specialist Center for Prevention Research and Development University of Illinois From: SPSSX(r) Discussion [mailto:[hidden email]]
On Behalf Of Colin Valdiserri Hello Everyone, I am computing a segment variable consisting of two segments. The code is as follows… Compute segment=0. If (cell=1 or cell=2 or cell=3 or cell=4 or cell=5 or cell=6 or cell=7 or cell=8 or cell=9 or cell=10 or cell=11 or cell=12 or cell=13 or cell=14 or cell=15 or cell=16 or cell=17 or cell=18 or cell=19 or cell=20) and (segmentm=mc or segmentm=md)
and segmentp=p3 and segmentc=cy segment=1. If (cell=21 or cell=22 or cell=23 or cell=24) and (segmentm=me or segmentm=mg) and (segmentp=p1 or segmentp=p2) segment=2. The problem I’m running into is that SPSS won’t let me use string variables for this. Is there any way I can carry out this syntax with the string variables or a workaround for using string variables that anyone may know?
Thank you in advance for all of your help, Colin Colin M. Valdiserri
Informed Decisions Group, Inc. 8854 Jordan Court | North Ridgeville, Ohio | 44039 cvaldiserri@... Follow us on
LinkedIn The information and attachments contained in this e-mail message is intended for the use of the recipient(s) named above and is privileged and confidential. If you are not the intended recipient, you are formally
notified that you have received this message in error and that any review, dissemination, distribution, or copying of the message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the
original message. |
In reply to this post by Colin Valdiserri
*=================.... if range(cell, 1, 20) and any(segmentm, 'mc', 'md') and
segmentp='p3' and segmentc='cy'
segment=1. If range(cell, 21, 24) and any(segmentm, 'me', 'mg') and any(segmentp, 'p1', 'p2') segment=2. exe. *==================....
2011/12/22 Colin Valdiserri <[hidden email]>
|
In reply to this post by Poes, Matthew Joseph
Thank you very much! Colin M. Valdiserri Co-Founder & CEO Informed Decisions Group, Inc. 8854 Jordan Court | North Ridgeville, Ohio | 44039 cvaldiserri@... Follow us on LinkedIn The information and attachments contained in this e-mail message is intended for the use of the recipient(s) named above and is privileged and confidential. If you are not the intended recipient, you are formally notified that you have received this message in error and that any review, dissemination, distribution, or copying of the message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the original message. From: Poes, Matthew Joseph [mailto:[hidden email]] Put quotes around the string values: If (cell=21 or cell=22 or cell=23 or cell=24) and (segmentm=”me” or segmentm=”mg”) and (segmentp=”p1” or segmentp=”p2”) segment=2. Matthew J Poes Research Data Specialist Center for Prevention Research and Development University of Illinois From: SPSSX(r) Discussion [hidden email] On Behalf Of Colin Valdiserri Hello Everyone, I am computing a segment variable consisting of two segments. The code is as follows… Compute segment=0. If (cell=1 or cell=2 or cell=3 or cell=4 or cell=5 or cell=6 or cell=7 or cell=8 or cell=9 or cell=10 or cell=11 or cell=12 or cell=13 or cell=14 or cell=15 or cell=16 or cell=17 or cell=18 or cell=19 or cell=20) and (segmentm=mc or segmentm=md) and segmentp=p3 and segmentc=cy segment=1. If (cell=21 or cell=22 or cell=23 or cell=24) and (segmentm=me or segmentm=mg) and (segmentp=p1 or segmentp=p2) segment=2. The problem I’m running into is that SPSS won’t let me use string variables for this. Is there any way I can carry out this syntax with the string variables or a workaround for using string variables that anyone may know? Thank you in advance for all of your help, Colin Colin M. Valdiserri Informed Decisions Group, Inc. 8854 Jordan Court | North Ridgeville, Ohio | 44039 cvaldiserri@... Follow us on LinkedIn The information and attachments contained in this e-mail message is intended for the use of the recipient(s) named above and is privileged and confidential. If you are not the intended recipient, you are formally notified that you have received this message in error and that any review, dissemination, distribution, or copying of the message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the original message. |
In reply to this post by Poes, Matthew Joseph
I am currently out of the office and will return on Tues Jan 3. I will have limited email access during that time. I look forward to responding to your email when I return. Thank You! |
Administrator
|
In reply to this post by Colin Valdiserri
COMPUTE segment=0. IF RANGE(cell, 1,20) AND ANY(segmentm,"mc",md") AND (segmentp EQ "p3") AND (segmentc EQ"cy") segment=1. IF RANGE (cell,21,24) AND ANY(segmentm,"me","mg") AND ANY(segmentp,"p1", "p2s") segment=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?" |
I will be out of the office until January 3rd. I will respond to your email upon my return.
Sincerely, Resha ===================== 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
Hello, Temple University will be closed starting at the end of business on Thursday, December 22, 2011 through Monday, January 2, 2012. We will reopen on Tuesday, January 3, 2012. If you are still in the process of submitting your online application, we will monitor emails for problems with the system and try to address them as quickly as possible. Other questions will be answered once the University reopens. Thank you for your understanding, and we wish you success in the New Year. Michael Toner |
Free forum by Nabble | Edit this page |