DO REPEAT won't create new variables

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

DO REPEAT won't create new variables

John F Hall

This syntax worked in 1991.  It creates new intermediate variables which need to be reverse coded to generate sets of indices of (un)healthy diet.

 

do repeat

  a = v158 to v180 v201 to v221

  b = r158 to r180 r201 to r221.

compute b=a.

end repeat.

 

When I run it I get:

 

 

Error # 4502 in column 10.  Text: =

An equals sign appears in a variable or value list where it is not expected.

It will be ignored.

Execution of this command stops.

 

Error # 4001.  Command name: end repeat

An END REPEAT command has appeared without a previous DO REPEAT command.

Execution of this command stops.

 

Error # 4530.  Command name: do repeat

This command is not allowed inside the DO REPEAT/ END REPEAT facility.  The

command will be ignored.

Execution of this command stops.

 

Error # 4502 in column 5.  Text: =

An equals sign appears in a variable or value list where it is not expected.

It will be ignored.

Execution of this command stops.

 

Error # 4285 in column 11.  Text: a

Incorrect variable name: either the name is more than 64 characters, or it is

not defined by a previous command.

Execution of this command stops.

 

Error # 4001.  Command name: end repeat

An END REPEAT command has appeared without a previous DO REPEAT command.

Execution of this command stops.

 

Is it me or SPSS?

 

John F Hall  MA (Cantab) Dip Ed (Dunelm)

[Retired academic survey researcher]

 

Email:          [hidden email]

Website:     Journeys in Survey Research

Course:       Survey Analysis Workshop (SPSS)

Research:   Subjective Social Indicators (Quality of Life)

 

===================== 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
|

Re: DO REPEAT won't create new variables

Rick Oliver

stand-in variable lists need to be separated with a forward slash.


do repeat

  a = v158 to v180 v201 to v221

  /b = r158 to r180 r201 to r221.

compute b=a.

end repeat.


On Tue, May 22, 2018 at 1:09 PM, John F Hall <[hidden email]> wrote:

This syntax worked in 1991.  It creates new intermediate variables which need to be reverse coded to generate sets of indices of (un)healthy diet.

 

do repeat

  a = v158 to v180 v201 to v221

  b = r158 to r180 r201 to r221.

compute b=a.

end repeat.

 

When I run it I get:

 

 

Error # 4502 in column 10.  Text: =

An equals sign appears in a variable or value list where it is not expected.

It will be ignored.

Execution of this command stops.

 

Error # 4001.  Command name: end repeat

An END REPEAT command has appeared without a previous DO REPEAT command.

Execution of this command stops.

 

Error # 4530.  Command name: do repeat

This command is not allowed inside the DO REPEAT/ END REPEAT facility.  The

command will be ignored.

Execution of this command stops.

 

Error # 4502 in column 5.  Text: =

An equals sign appears in a variable or value list where it is not expected.

It will be ignored.

Execution of this command stops.

 

Error # 4285 in column 11.  Text: a

Incorrect variable name: either the name is more than 64 characters, or it is

not defined by a previous command.

Execution of this command stops.

 

Error # 4001.  Command name: end repeat

An END REPEAT command has appeared without a previous DO REPEAT command.

Execution of this command stops.

 

Is it me or SPSS?

 

John F Hall  MA (Cantab) Dip Ed (Dunelm)

[Retired academic survey researcher]

 

Email:          [hidden email]

Website:     Journeys in Survey Research

Course:       Survey Analysis Workshop (SPSS)

Research:   Subjective Social Indicators (Quality of Life)

 

===================== 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
Reply | Threaded
Open this post in threaded view
|

Re: DO REPEAT won't create new variables

Anthony Babinec
In reply to this post by John F Hall

John,

The slash is your friend.

 

do repeat

  a = v158 to v180 v201 to v221 /

  b = r158 to r180 r201 to r221.

compute b=a.

end repeat.

 

 

From: SPSSX(r) Discussion <[hidden email]> On Behalf Of John F Hall
Sent: Tuesday, May 22, 2018 1:10 PM
To: [hidden email]
Subject: DO REPEAT won't create new variables

 

This syntax worked in 1991.  It creates new intermediate variables which need to be reverse coded to generate sets of indices of (un)healthy diet.

 

do repeat

  a = v158 to v180 v201 to v221

  b = r158 to r180 r201 to r221.

compute b=a.

end repeat.

 

When I run it I get:

 

 

Error # 4502 in column 10.  Text: =

An equals sign appears in a variable or value list where it is not expected.

It will be ignored.

Execution of this command stops.

 

Error # 4001.  Command name: end repeat

An END REPEAT command has appeared without a previous DO REPEAT command.

Execution of this command stops.

 

Error # 4530.  Command name: do repeat

This command is not allowed inside the DO REPEAT/ END REPEAT facility.  The

command will be ignored.

Execution of this command stops.

 

Error # 4502 in column 5.  Text: =

An equals sign appears in a variable or value list where it is not expected.

It will be ignored.

Execution of this command stops.

 

Error # 4285 in column 11.  Text: a

Incorrect variable name: either the name is more than 64 characters, or it is

not defined by a previous command.

Execution of this command stops.

 

Error # 4001.  Command name: end repeat

An END REPEAT command has appeared without a previous DO REPEAT command.

Execution of this command stops.

 

Is it me or SPSS?

 

John F Hall  MA (Cantab) Dip Ed (Dunelm)

[Retired academic survey researcher]

 

Email:          [hidden email]

Website:     Journeys in Survey Research

Course:       Survey Analysis Workshop (SPSS)

Research:   Subjective Social Indicators (Quality of Life)

 

===================== 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
Reply | Threaded
Open this post in threaded view
|

Re: DO REPEAT won't create new variables

Rick Oliver
And I doubt the original syntax ever worked without the forward slash.

On Tue, May 22, 2018 at 1:18 PM, Anthony Babinec <[hidden email]> wrote:

John,

The slash is your friend.

 

do repeat

  a = v158 to v180 v201 to v221 /

  b = r158 to r180 r201 to r221.

compute b=a.

end repeat.

 

 

From: SPSSX(r) Discussion <[hidden email]> On Behalf Of John F Hall
Sent: Tuesday, May 22, 2018 1:10 PM
To: [hidden email]
Subject: DO REPEAT won't create new variables

 

This syntax worked in 1991.  It creates new intermediate variables which need to be reverse coded to generate sets of indices of (un)healthy diet.

 

do repeat

  a = v158 to v180 v201 to v221

  b = r158 to r180 r201 to r221.

compute b=a.

end repeat.

 

When I run it I get:

 

 

Error # 4502 in column 10.  Text: =

An equals sign appears in a variable or value list where it is not expected.

It will be ignored.

Execution of this command stops.

 

Error # 4001.  Command name: end repeat

An END REPEAT command has appeared without a previous DO REPEAT command.

Execution of this command stops.

 

Error # 4530.  Command name: do repeat

This command is not allowed inside the DO REPEAT/ END REPEAT facility.  The

command will be ignored.

Execution of this command stops.

 

Error # 4502 in column 5.  Text: =

An equals sign appears in a variable or value list where it is not expected.

It will be ignored.

Execution of this command stops.

 

Error # 4285 in column 11.  Text: a

Incorrect variable name: either the name is more than 64 characters, or it is

not defined by a previous command.

Execution of this command stops.

 

Error # 4001.  Command name: end repeat

An END REPEAT command has appeared without a previous DO REPEAT command.

Execution of this command stops.

 

Is it me or SPSS?

 

John F Hall  MA (Cantab) Dip Ed (Dunelm)

[Retired academic survey researcher]

 

Email:          [hidden email]

Website:     Journeys in Survey Research

Course:       Survey Analysis Workshop (SPSS)

Research:   Subjective Social Indicators (Quality of Life)

 

===================== 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
Reply | Threaded
Open this post in threaded view
|

Re: DO REPEAT won't create new variables

Ki Park
In reply to this post by Rick Oliver
If wanted to reverse code at the same time, you may also use "ABS". The value
of "1" should be replaced with "n+1" if they are Likert scale "1" to "n" and
not a dummy variable.

*For dummy.
do repeat
  a = v158 to v180 v201 to v221
  /b = r158 to r180 r201 to r221.
compute b=ABS(a-1).
end repeat.

*for a scale 1 to n.
do repeat
  a = v158 to v180 v201 to v221
  /b = r158 to r180 r201 to r221.
compute b=ABS(a-(n+1)).
end repeat.



--
Sent from: http://spssx-discussion.1045642.n5.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