# Re: How to ADD MEAN AND STANDARD DEVIATION ON A CTABLE

2 messages
Open this post in threaded view
|

## Re: How to ADD MEAN AND STANDARD DEVIATION ON A CTABLE

HI,

How do I Add Mean and standard deviation on a table

Below is the example.

 TT Q7. Valid N 99 Mean 1882.84 Median 2000.00 Mode 2200.00 Standard Deviation 627 MEAN + SD 2510.12

Thanks in advance for the help

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Rick Oliver
Sent: Tuesday, May 22, 2018 11:51 PM
To: [hidden email]
Subject: Re: DO REPEAT won't create new variables

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,

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)

Email:          [hidden email]

Website:     Journeys in Survey Research

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

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

## Re: How to ADD MEAN AND STANDARD DEVIATION ON A CTABLE

I am guessing that this output is from CTABLES.  If not, some minor modification will be needed.

The easiest way to do this is to use the STATS TABLE CALC extension command.  If it is not already installed, you can add it from the Extensions menu or, in older versions, from Utilities.

Here is the syntax.
STATS TABLE CALC SUBTYPE="customtable" PROCESS=PRECEDING
/TARGET FORMULA="x[0]+ x1" DIMENSION=ROWS LEVEL = -1  LOCATION="Standard Deviation"
LABEL="Mean + SD" MODE=AFTER.

On Fri, May 25, 2018 at 4:13 AM, B, Muthukkumaran (IMCHR) wrote:

HI,

How do I Add Mean and standard deviation on a table

Below is the example.

 TT Q7. Valid N 99 Mean 1882.84 Median 2000.00 Mode 2200.00 Standard Deviation 627 MEAN + SD 2510.12

Thanks in advance for the help

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Rick Oliver
Sent: Tuesday, May 22, 2018 11:51 PM
To: [hidden email]
Subject: Re: DO REPEAT won't create new variables

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,

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)

Email:          [hidden email]

Website:     Journeys in Survey Research

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

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

--
Jon K Peck
[hidden email]

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