Problems with syntax file

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

Problems with syntax file

Helpme
Hi,

I'm having problems with a syntax script used to analyse a Brief Implicit Association Test. I basically took the Brief IAT/w Pictures from http://www.millisecond.com/download/library/IAT/BriefIAT/ and changed the images and names used. I'm trying to use the BriefIAT SPSS Script but I keep getting these error messages:

39 IF A relational operator may have two numeric operands or two character string operands.  To compare a character string to a numeric quantity, consider using the STRING or NUMBER function.
40 IF A relational operator may have two numeric operands or two character string operands.  To compare a character string to a numeric quantity, consider using the STRING or NUMBER function.

Which refer to:

line 38 COMPUTE Pairing = 0.
line 39 IF (blockcode = 'A' ) Pairing = 1.
line 40 IF (blockcode = 'B' ) Pairing = 2.

Blockcode was originally a string value so I changed it to a numerical value using the ALTER TYPE command (ALTER TYPE blockcode (f8.2)).

What do I have to do to get rid of this error?

Thank you.


Reply | Threaded
Open this post in threaded view
|

Re: Problems with syntax file

Bruce Weaver
Administrator
"Blockcode was originally a string value so I changed it to a numerical value using the ALTER TYPE command (ALTER TYPE blockcode (f8.2))."

Did you do that before running the lines of syntax shown below?  Why?  Values of 'A' and 'B' must end up as system missing when you ALTER TYPE to a numeric variable.  

Assumming blockcode is string (with values A and B), this should accomplish what you apparently want.

RECODE blockcode
 ('A' = 1)
 ('B' = 2)
 (else = 0) into Pairing.
FORMATS Pairing (f1).





Helpme wrote
Hi,

I'm having problems with a syntax script used to analyse a Brief Implicit Association Test. I basically took the Brief IAT/w Pictures from http://www.millisecond.com/download/library/IAT/BriefIAT/ and changed the images and names used. I'm trying to use the BriefIAT SPSS Script but I keep getting these error messages:

39 IF A relational operator may have two numeric operands or two character string operands.  To compare a character string to a numeric quantity, consider using the STRING or NUMBER function.
40 IF A relational operator may have two numeric operands or two character string operands.  To compare a character string to a numeric quantity, consider using the STRING or NUMBER function.

Which refer to:

line 38 COMPUTE Pairing = 0.
line 39 IF (blockcode = 'A' ) Pairing = 1.
line 40 IF (blockcode = 'B' ) Pairing = 2.

Blockcode was originally a string value so I changed it to a numerical value using the ALTER TYPE command (ALTER TYPE blockcode (f8.2)).

What do I have to do to get rid of this error?

Thank you.
--
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: Problems with syntax file

Helpme
When I ran the original syntax file I got these errors:

72 Descriptives No statistics are computed for the following variables because they are strings: time, blockcode, trialcode, stimulusitem1.
129 Descriptives No statistics are computed for the following variables because they are strings: time, blockcode, trialcode, stimulusitem1.

So I put in this:

ALTER TYPE time (f8.2) blockcode (f8.2) trialcode (f8.2) stimulusitem1 (f8.2)

and ran the whole thing again and that's when I got these errors:

39 IF A relational operator may have two numeric operands or two character string operands.  To compare a character string to a numeric quantity, consider using the STRING or NUMBER function.
40 IF A relational operator may have two numeric operands or two character string operands.  To compare a character string to a numeric quantity, consider using the STRING or NUMBER function. 

So, do I have to substitute this:

line 38 COMPUTE Pairing = 0.
line 39 IF (blockcode = 'A' ) Pairing = 1.
line 40 IF (blockcode = 'B' ) Pairing = 2.

For:

RECODE blockcode
 ('A' = 1)
 ('B' = 2)
 (else = 0) into Pairing.
FORMATS Pairing (f1).

Thank you for your reply.

On 24/02/2013 14:29, Bruce Weaver [via SPSSX Discussion] wrote:
"Blockcode was originally a string value so I changed it to a numerical value using the ALTER TYPE command (ALTER TYPE blockcode (f8.2))."

Did you do that before running the lines of syntax shown below?  Why?  Values of 'A' and 'B' must end up as system missing when you ALTER TYPE to a numeric variable.  

Assumming blockcode is string (with values A and B), this should accomplish what you apparently want.

RECODE blockcode
 ('A' = 1)
 ('B' = 2)
 (else = 0) into Pairing.
FORMATS Pairing (f1).





Helpme wrote
Hi,

I'm having problems with a syntax script used to analyse a Brief Implicit Association Test. I basically took the Brief IAT/w Pictures from http://www.millisecond.com/download/library/IAT/BriefIAT/ and changed the images and names used. I'm trying to use the BriefIAT SPSS Script but I keep getting these error messages:

39 IF A relational operator may have two numeric operands or two character string operands.  To compare a character string to a numeric quantity, consider using the STRING or NUMBER function.
40 IF A relational operator may have two numeric operands or two character string operands.  To compare a character string to a numeric quantity, consider using the STRING or NUMBER function.

Which refer to:

line 38 COMPUTE Pairing = 0.
line 39 IF (blockcode = 'A' ) Pairing = 1.
line 40 IF (blockcode = 'B' ) Pairing = 2.

Blockcode was originally a string value so I changed it to a numerical value using the ALTER TYPE command (ALTER TYPE blockcode (f8.2)).

What do I have to do to get rid of this error?

Thank you.
--
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.



If you reply to this email, your message will be added to the discussion below:
http://spssx-discussion.1045642.n5.nabble.com/Problems-with-syntax-file-tp5718221p5718222.html
To unsubscribe from Problems with syntax file, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Problems with syntax file

Garry Gelade

I think you are confused.   It sounds like your block codes, trial codes and stimulus items are categorical (nominal) variables.  Such variables can be represented either by numbers or strings in SPSS, but in any case you should NOT be trying to compute SPSS Descriptives for them.

 

Altering the type allowed the Descriptives procedure to run without giving any error message, but the results would be quite meaningless because catgeorical variables don’t have a mean or an SD.  Leave them as strings, just don’t try to calculate descriptives for them, and everything will be OK.

 

Garry Gelade

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Helpme
Sent: 24 February 2013 14:37
To: [hidden email]
Subject: Re: Problems with syntax file

 

When I ran the original syntax file I got these errors:

72 Descriptives No statistics are computed for the following variables because they are strings: time, blockcode, trialcode, stimulusitem1.
129 Descriptives No statistics are computed for the following variables because they are strings: time, blockcode, trialcode, stimulusitem1.

So I put in this:

ALTER TYPE time (f8.2) blockcode (f8.2) trialcode (f8.2) stimulusitem1 (f8.2)

and ran the whole thing again and that's when I got these errors:

39 IF A relational operator may have two numeric operands or two character string operands.  To compare a character string to a numeric quantity, consider using the STRING or NUMBER function.
40 IF A relational operator may have two numeric operands or two character string operands.  To compare a character string to a numeric quantity, consider using the STRING or NUMBER function. 

So, do I have to substitute this:

line 38 COMPUTE Pairing = 0.
line 39 IF (blockcode = 'A' ) Pairing = 1.
line 40 IF (blockcode = 'B' ) Pairing = 2.

For:

RECODE blockcode
 ('A' = 1)
 ('B' = 2)
 (else = 0) into Pairing.
FORMATS Pairing (f1).

Thank you for your reply.

On 24/02/2013 14:29, Bruce Weaver [via SPSSX Discussion] wrote:

"Blockcode was originally a string value so I changed it to a numerical value using the ALTER TYPE command (ALTER TYPE blockcode (f8.2))."

Did you do that before running the lines of syntax shown below?  Why?  Values of 'A' and 'B' must end up as system missing when you ALTER TYPE to a numeric variable.  

Assumming blockcode is string (with values A and B), this should accomplish what you apparently want.

RECODE blockcode
 ('A' = 1)
 ('B' = 2)
 (else = 0) into Pairing.
FORMATS Pairing (f1).




Helpme wrote

Hi,

I'm having problems with a syntax script used to analyse a Brief Implicit Association Test. I basically took the Brief IAT/w Pictures from http://www.millisecond.com/download/library/IAT/BriefIAT/ and changed the images and names used. I'm trying to use the BriefIAT SPSS Script but I keep getting these error messages:

39 IF A relational operator may have two numeric operands or two character string operands.  To compare a character string to a numeric quantity, consider using the STRING or NUMBER function.
40 IF A relational operator may have two numeric operands or two character string operands.  To compare a character string to a numeric quantity, consider using the STRING or NUMBER function.

Which refer to:

line 38 COMPUTE Pairing = 0.
line 39 IF (blockcode = 'A' ) Pairing = 1.
line 40 IF (blockcode = 'B' ) Pairing = 2.

Blockcode was originally a string value so I changed it to a numerical value using the ALTER TYPE command (ALTER TYPE blockcode (f8.2)).

What do I have to do to get rid of this error?

Thank you.

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

 


If you reply to this email, your message will be added to the discussion below:

http://spssx-discussion.1045642.n5.nabble.com/Problems-with-syntax-file-tp5718221p5718222.html

To unsubscribe from Problems with syntax file, click here.
NAML

 


View this message in context: Re: Problems with syntax file
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: Problems with syntax file

Bruce Weaver
Administrator
In reply to this post by Helpme
The original "errors" (or were they warnings), before you used ALTER TYPE don't sound very serious.  You just failed to get descriptive statistics for a few string variables, but nothing important was changed.  (If you want information about those variables, use FREQUENCIES rather than DESCRIPTIVES.)

The errors you get AFTER using ALTER TYPE are serious.  

Is this syntax you downloaded from somewhere?  Is there any documentation for it?  If so, have you read it carefully?

HTH.


Helpme wrote
When I ran the original syntax file I got these errors:

72 Descriptives No statistics are computed for the following variables
because they are strings: time, blockcode, trialcode, stimulusitem1.
129 Descriptives No statistics are computed for the following variables
because they are strings: time, blockcode, trialcode, stimulusitem1.

So I put in this:

ALTER TYPE time (f8.2) blockcode (f8.2) trialcode (f8.2) stimulusitem1
(f8.2)

and ran the whole thing again and that's when I got these errors:

39 IF A relational operator may have two numeric operands or two
character string operands.  To compare a character string to a numeric
quantity, consider using the STRING or NUMBER function.
40 IF A relational operator may have two numeric operands or two
character string operands.  To compare a character string to a numeric
quantity, consider using the STRING or NUMBER function.

So, do I have to substitute this:

line 38 COMPUTE Pairing = 0.
line 39 IF (blockcode = 'A' ) Pairing = 1.
line 40 IF (blockcode = 'B' ) Pairing = 2.

For:

RECODE blockcode
  ('A' = 1)
  ('B' = 2)
  (else = 0) into Pairing.
FORMATS Pairing (f1).

Thank you for your reply.

On 24/02/2013 14:29, Bruce Weaver [via SPSSX Discussion] wrote:
> "Blockcode was originally a string value so I changed it to a
> numerical value using the ALTER TYPE command (ALTER TYPE blockcode
> (f8.2))."
>
> Did you do that before running the lines of syntax shown below?  Why?
>  Values of 'A' and 'B' must end up as system missing when you ALTER
> TYPE to a numeric variable.
>
> Assumming blockcode is string (with values A and B), this should
> accomplish what you apparently want.
>
> RECODE blockcode
>  ('A' = 1)
>  ('B' = 2)
>  (else = 0) into Pairing.
> FORMATS Pairing (f1).
>
>
>
>
>
>     Helpme wrote
>     Hi,
>
>     I'm having problems with a syntax script used to analyse a Brief
>     Implicit Association Test. I basically took the Brief IAT/w
>     Pictures from
>     http://www.millisecond.com/download/library/IAT/BriefIAT/ and
>     changed the images and names used. I'm trying to use the BriefIAT
>     SPSS Script but I keep getting these error messages:
>
>     39 IF A relational operator may have two numeric operands or two
>     character string operands.  To compare a character string to a
>     numeric quantity, consider using the STRING or NUMBER function.
>     40 IF A relational operator may have two numeric operands or two
>     character string operands.  To compare a character string to a
>     numeric quantity, consider using the STRING or NUMBER function.
>
>     Which refer to:
>
>     line 38 COMPUTE Pairing = 0.
>     line 39 IF (blockcode = 'A' ) Pairing = 1.
>     line 40 IF (blockcode = 'B' ) Pairing = 2.
>
>     Blockcode was originally a string value so I changed it to a
>     numerical value using the ALTER TYPE command (ALTER TYPE blockcode
>     (f8.2)).
>
>     What do I have to do to get rid of this error?
>
>     Thank you.
>
> --
> 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.
> *
>
>
> ------------------------------------------------------------------------
> If you reply to this email, your message will be added to the
> discussion below:
> http://spssx-discussion.1045642.n5.nabble.com/Problems-with-syntax-file-tp5718221p5718222.html 
>
> To unsubscribe from Problems with syntax file, click here
> <http://spssx-discussion.1045642.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5718221&code=cmowNjA1QG15LmJyaXN0b2wuYWMudWt8NTcxODIyMXwtMTk1NTMzNDEyMg==>.
> NAML
> <http://spssx-discussion.1045642.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> 
>
--
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/).