Can anyone explain?

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

Can anyone explain?

Staffan Lindberg
Dear list!

For illustration purposes, I have the following dataset:

VARA     VARB
1             4
2             5
3             6

Say that write the following syntax::

RECODE VARB (5=sysmis).

This is a perfectly valid statement. Wereas If I write:

IF (VARA EQ 2)VARB=sysmis.

This is regarded an invalid statement and I get the error message:
.
>Error # 4285 in column 20.  Text: sysmis
>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

Why is this? The only practical difference that I can see is that I
inserted a conditional clause in the implied recode statement.

best

Staffan Lindberg
Stockholm
Sweden.

=====================
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: Can anyone explain?

Jon K Peck
The IF should refer to $sysmis.  $sysmis is a value while in RECODE, LO, HI, THRU, MISSING, SYSMIS, and ELSE are keywords.  In RECODE is it possible to distinguish these keywords unambiguously from values, while the IF statement would attempt to assign the value of a variable named SYSMIS.


Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        "[hidden email]" <[hidden email]>
To:        [hidden email],
Date:        05/13/2014 06:37 AM
Subject:        [SPSSX-L] Can anyone explain?
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




Dear list!

For illustration purposes, I have the following dataset:

VARA     VARB
1             4
2             5
3             6

Say that write the following syntax::

RECODE VARB (5=sysmis).

This is a perfectly valid statement. Wereas If I write:

IF (VARA EQ 2)VARB=sysmis.

This is regarded an invalid statement and I get the error message:
.
>Error # 4285 in column 20.  Text: sysmis
>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

Why is this? The only practical difference that I can see is that I
inserted a conditional clause in the implied recode statement.

best

Staffan Lindberg
Stockholm
Sweden.

=====================
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: Can anyone explain?

Bruce Weaver
Administrator
In reply to this post by Staffan Lindberg
Try this:

IF (VARA EQ 2) VARB = $sysmis.


And then search the list archives for one of Art K's posts on missing data, and why SYSMIS should not be used when the reason for the missing data is known.  ;-)



Staffan Lindberg wrote
Dear list!

For illustration purposes, I have the following dataset:

VARA     VARB
1             4
2             5
3             6

Say that write the following syntax::

RECODE VARB (5=sysmis).

This is a perfectly valid statement. Wereas If I write:

IF (VARA EQ 2)VARB=sysmis.

This is regarded an invalid statement and I get the error message:
.
>Error # 4285 in column 20.  Text: sysmis
>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

Why is this? The only practical difference that I can see is that I
inserted a conditional clause in the implied recode statement.

best

Staffan Lindberg
Stockholm
Sweden.

=====================
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
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: Can anyone explain?

PRogman
In reply to this post by Staffan Lindberg
SYSMIS is a keyword in RECODE, in assignments use system variable $Sysmis, or perhaps use:
MISSING VALUES VarA (5).

/PR
Reply | Threaded
Open this post in threaded view
|

Re: Can anyone explain?

PRogman
Hm, may have misread: 1) VarB and it was conditional... /PR
Reply | Threaded
Open this post in threaded view
|

Re: Can anyone explain?

Art Kendall
In reply to this post by Staffan Lindberg
Do you know why a value of 5 for varb is to be considered missing?
If so, you would be better off by declaring 5 a missing value, or by recoding to another value that you declare missing.

This allows you to apply a value label to the missing value.

Jon gave you a technical answer why it wouldn't work.

I would still like SPSS to give a warning for the undesirable but syntactically correct usage of a user assigning a sysmis value.
The value is not understood to be treated as missing because the system was unable to do what the user said. The value is understood to be treated as missing because the user said so
Art Kendall
Social Research Consultants
On 5/13/2014 8:46 AM, Staffan Lindberg [via SPSSX Discussion] wrote:
Dear list!

For illustration purposes, I have the following dataset:

VARA     VARB
1             4
2             5
3             6

Say that write the following syntax::

RECODE VARB (5=sysmis).

This is a perfectly valid statement. Wereas If I write:

IF (VARA EQ 2)VARB=sysmis.

This is regarded an invalid statement and I get the error message:
.
>Error # 4285 in column 20.  Text: sysmis
>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

Why is this? The only practical difference that I can see is that I
inserted a conditional clause in the implied recode statement.

best

Staffan Lindberg
Stockholm
Sweden.

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



If you reply to this email, your message will be added to the discussion below:
http://spssx-discussion.1045642.n5.nabble.com/Can-anyone-explain-tp5725997.html
To start a new topic under SPSSX Discussion, email [hidden email]
To unsubscribe from SPSSX Discussion, click here.
NAML

Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: Can anyone explain?

Rick Oliver-3
In reply to this post by Bruce Weaver
To elaborate a little:

SYSMIS is valid keyword on the RECODE command, and sets the value to the value of the system variable $SYSMIS.

The IF command does not have a SYSMIS keyword. Instead, you just specify the system variable $SYSMIS.

Rick Oliver
Senior Information Developer
IBM Business Analytics (SPSS)
E-mail: [hidden email]




From:        Bruce Weaver <[hidden email]>
To:        [hidden email],
Date:        05/13/2014 10:13 AM
Subject:        Re: Can anyone explain?
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




Try this:

IF (VARA EQ 2) VARB = $sysmis.


And then search the list archives for one of Art K's posts on missing data,
and why SYSMIS should not be used when the reason for the missing data is
known.  ;-)




Staffan Lindberg wrote
> Dear list!
>
> For illustration purposes, I have the following dataset:
>
> VARA     VARB
> 1             4
> 2             5
> 3             6
>
> Say that write the following syntax::
>
> RECODE VARB (5=sysmis).
>
> This is a perfectly valid statement. Wereas If I write:
>
> IF (VARA EQ 2)VARB=sysmis.
>
> This is regarded an invalid statement and I get the error message:
> .
>>Error # 4285 in column 20.  Text: sysmis
>>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
>
> Why is this? The only practical difference that I can see is that I
> inserted a conditional clause in the implied recode statement.
>
> best
>
> Staffan Lindberg
> Stockholm
> Sweden.
>
> =====================
> 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





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/Can-anyone-explain-tp5725997p5726000.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