Simple Macro Question

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

Simple Macro Question

Craig Johnson

I'm making some generic syntax using a macro and have ran into a snag.  When I use the syntax below I end up getting the error: ">Error # 1.  Command name: /METHOD >The first word in the line is not recognized as an SPSS command. >This command not executed." 

 

Any ideas how to solve this error? 

 

***********************************************

Define Scales

***********************************************

 

DEFINE !Scale1 ( ) scale !ENDDEFINE.

DEFINE !Outcome1 () Outcome !ENDDEFINE.

 

***********************************************

Outcome Results

***********************************************

 

UNIANOVA

  !Outcome1  BY !Scale1

     /METHOD = SSTYPE(3)

     /INTERCEPT = INCLUDE

     /PRINT = DESCRIPTIVE

     /CRITERIA = ALPHA(.05)

     /DESIGN = !Scale1 .

Reply | Threaded
Open this post in threaded view
|

Re: Simple Macro Question

Fry, Jonathan B.

The program has decided that a new command begins with /METHOD.  It looks in your post like the line before that is empty, which would cause that, but cutting and pasting in e-mail often adds empty lines that weren’t there in the original, so we can’t be sure.

 

Jonathan Fry

 


From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Craig Johnson
Sent: Monday, February 09, 2009 12:57 PM
To: [hidden email]
Subject: Simple Macro Question

 

I'm making some generic syntax using a macro and have ran into a snag.  When I use the syntax below I end up getting the error: ">Error # 1.  Command name: /METHOD >The first word in the line is not recognized as an SPSS command. >This command not executed." 

 

Any ideas how to solve this error? 

 

***********************************************

Define Scales

***********************************************

 

DEFINE !Scale1 ( ) scale !ENDDEFINE.

DEFINE !Outcome1 () Outcome !ENDDEFINE.

 

***********************************************

Outcome Results

***********************************************

 

UNIANOVA

  !Outcome1  BY !Scale1

     /METHOD = SSTYPE(3)

     /INTERCEPT = INCLUDE

     /PRINT = DESCRIPTIVE

     /CRITERIA = ALPHA(.05)

     /DESIGN = !Scale1 .

Reply | Threaded
Open this post in threaded view
|

Re: Simple Macro Question

Marks, Jim

Macros insert a return after the macro is executed:

 

(reformatted to eliminate spaces before/ after paragraphs):

 

This should work

 

UNIANOVA

  !Outcome1  BY  !Scale1      /

    METHOD = SSTYPE(3)

     /INTERCEPT = INCLUDE

     /PRINT = DESCRIPTIVE

     /CRITERIA = ALPHA(.05)

     /DESIGN = !Scale1 .

 

Try running the macro with

 

SET MPRINT = on.

 

 Before the macro

 

Jim Marks

Director, Market Research

x1616

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Fry, Jonathan B.
Sent: Monday, February 09, 2009 3:59 PM
To: [hidden email]
Subject: Re: Simple Macro Question

 

The program has decided that a new command begins with /METHOD.  It looks in your post like the line before that is empty, which would cause that, but cutting and pasting in e-mail often adds empty lines that weren’t there in the original, so we can’t be sure.

 

Jonathan Fry

 


From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Craig Johnson
Sent: Monday, February 09, 2009 12:57 PM
To: [hidden email]
Subject: Simple Macro Question

 

I'm making some generic syntax using a macro and have ran into a snag.  When I use the syntax below I end up getting the error: ">Error # 1.  Command name: /METHOD >The first word in the line is not recognized as an SPSS command. >This command not executed." 

 

Any ideas how to solve this error? 

 

***********************************************

Define Scales

***********************************************

 

DEFINE !Scale1 ( ) scale !ENDDEFINE.

DEFINE !Outcome1 () Outcome !ENDDEFINE.

 

***********************************************

Outcome Results

***********************************************

 

UNIANOVA

  !Outcome1  BY !Scale1

     /METHOD = SSTYPE(3)

     /INTERCEPT = INCLUDE

     /PRINT = DESCRIPTIVE

     /CRITERIA = ALPHA(.05)

     /DESIGN = !Scale1 .

Reply | Threaded
Open this post in threaded view
|

Re: Simple Macro Question

Oliver, Richard
In reply to this post by Fry, Jonathan B.

In older versions, there are issues with ending a line with a macro call, which results in the generated code including a blank line in the middle of the command, which is interpreted as a command terminator. Try putting the /METHOD subcommand on the same line !Outcome1 BY !Scale1.

 


From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Fry, Jonathan B.
Sent: Monday, February 09, 2009 3:59 PM
To: [hidden email]
Subject: Re: Simple Macro Question

 

The program has decided that a new command begins with /METHOD.  It looks in your post like the line before that is empty, which would cause that, but cutting and pasting in e-mail often adds empty lines that weren’t there in the original, so we can’t be sure.

 

Jonathan Fry

 


From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Craig Johnson
Sent: Monday, February 09, 2009 12:57 PM
To: [hidden email]
Subject: Simple Macro Question

 

I'm making some generic syntax using a macro and have ran into a snag.  When I use the syntax below I end up getting the error: ">Error # 1.  Command name: /METHOD >The first word in the line is not recognized as an SPSS command. >This command not executed." 

 

Any ideas how to solve this error? 

 

***********************************************

Define Scales

***********************************************

 

DEFINE !Scale1 ( ) scale !ENDDEFINE.

DEFINE !Outcome1 () Outcome !ENDDEFINE.

 

***********************************************

Outcome Results

***********************************************

 

UNIANOVA

  !Outcome1  BY !Scale1

     /METHOD = SSTYPE(3)

     /INTERCEPT = INCLUDE

     /PRINT = DESCRIPTIVE

     /CRITERIA = ALPHA(.05)

     /DESIGN = !Scale1 .

Reply | Threaded
Open this post in threaded view
|

R: Simple Macro Question

Luca Meyer-3
In reply to this post by Craig Johnson
It looks like your "scale" parameter contains a period which SPSS inteprets as end of command, is that the case? Which value(s) does scale take?
 
Luca


Da: SPSSX(r) Discussion [mailto:[hidden email]] Per conto di Craig Johnson
Inviato: lunedì 9 febbraio 2009 19.57
A: [hidden email]
Oggetto: Simple Macro Question

I'm making some generic syntax using a macro and have ran into a snag.  When I use the syntax below I end up getting the error: ">Error # 1.  Command name: /METHOD >The first word in the line is not recognized as an SPSS command. >This command not executed." 

 

Any ideas how to solve this error? 

 

***********************************************

Define Scales

***********************************************

 

DEFINE !Scale1 ( ) scale !ENDDEFINE.

DEFINE !Outcome1 () Outcome !ENDDEFINE.

 

***********************************************

Outcome Results

***********************************************

 

UNIANOVA

  !Outcome1  BY !Scale1

     /METHOD = SSTYPE(3)

     /INTERCEPT = INCLUDE

     /PRINT = DESCRIPTIVE

     /CRITERIA = ALPHA(.05)

     /DESIGN = !Scale1 .

Reply | Threaded
Open this post in threaded view
|

Can the denominator for a bar chart representing percentage be specified?

mpirritano

Dearest listers,

 

I would like to create a series of bar charts. The chart consists of several categorical variables, community health clinics. I want to be able to see the percent of individuals with and without chronic diseases that are assigned to a clinic as their pcp who have visited that clinic. The numbers of individuals assigned to the clinic does not enter into the graph, it merely represents the number of individuals that have visited the clinic, either with or without chronic illnesses. From that information the only percentage that I can get by default for a clinic is the percentage of individuals that have chronic vs nonchronic conditions who have visited the clinic. I want to specify the already known numbers. How can I create graphs that use the total number of individuals with chronic diseases assigned to that clinic as their pcp as the denominator in the percentage calculation, or is that not possible? The denominators would therefore be different for each clinic, and different within each clinic based on chronic vs nonchronic conditions.

 

Please let me know if you can help, or if this is unclear.

 

Thanks

Matt

 

Matthew Pirritano, Ph.D.

Research Analyst IV

Medical Services Initiative (MSI)

Orange County Health Care Agency

(714) 568-5648