Using String Variables in Recode Syntax

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

Using String Variables in Recode Syntax

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
P: 440.935.5414
F: 440.353.0621

cvaldiserri@...
www.idg-consulting.com

 

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.

 

Reply | Threaded
Open this post in threaded view
|

Re: Using String Variables in Recode Syntax

Poes, Matthew Joseph

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=p1or 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
Sent: Thursday, December 22, 2011 11:43 AM
To: [hidden email]
Subject: Using String Variables in Recode Syntax

 

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
P: 440.935.5414
F: 440.353.0621

cvaldiserri@...
www.idg-consulting.com

 

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.

 

Reply | Threaded
Open this post in threaded view
|

Re: Using String Variables in Recode Syntax

taras koniukhov
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]>

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
P: <a href="tel:440.935.5414" value="+14409355414" target="_blank">440.935.5414
F: <a href="tel:440.353.0621" value="+14403530621" target="_blank">440.353.0621

cvaldiserri@...
www.idg-consulting.com

 

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.

 


Reply | Threaded
Open this post in threaded view
|

Re: Using String Variables in Recode Syntax

Colin Valdiserri
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
P: 440.935.5414
F: 440.353.0621

cvaldiserri@...
www.idg-consulting.com

 

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]]
Sent: Thursday, December 22, 2011 12:51 PM
To: Colin Valdiserri; [hidden email]
Subject: RE: Using String Variables in Recode Syntax

 

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=p1or 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
Sent: Thursday, December 22, 2011 11:43 AM
To: [hidden email]
Subject: Using String Variables in Recode Syntax

 

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
P: 440.935.5414
F: 440.353.0621

cvaldiserri@...
www.idg-consulting.com

 

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.

 

Reply | Threaded
Open this post in threaded view
|

Automatic reply: Using String Variables in Recode Syntax

Kevan Edwards (MDH)
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! 

 

Reply | Threaded
Open this post in threaded view
|

Re: Using String Variables in Recode Syntax

David Marso
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.

Colin Valdiserri wrote
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
P: 440.935.5414
F: 440.353.0621

 <http://us.mc8.mail.yahoo.com/mc/compose?to=[hidden email]>
[hidden email]
 <http://www.idg-consulting.com/> www.idg-consulting.com



Follow us on
<http://www.linkedin.com/company/informed-decisions-group-inc/products>
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.
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?"
Reply | Threaded
Open this post in threaded view
|

Automatic reply: Using String Variables in Recode Syntax

Kreischer,Resha M
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
Reply | Threaded
Open this post in threaded view
|

Automatic reply: Using String Variables in Recode Syntax

MICHAEL J TONER
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