SPSS Statistics

SPSS Statistics

Your hub for statistical analysis, data management, and data documentation. Connect, learn, and share with your peers! 

 View Only
  • 1.  SPSS error#99 message for jitter scatter plot. What can I do?

    Posted Thu June 24, 2021 01:42 AM

    Hello everyone,

    I want to get a jitter scatter plot on SPSS for two ordinal variables. I use the Graph Fonction and then I paste the syntax and add "jitter" where needed.

    When I run the graph, I received this message : error # 99. Command name: BEGIN GPL >This command is only valid immediately following the GGRAPH procedure. >Execution of this command stops.

    Here's my syntax:

    DATASET ACTIVATE Dataset1.
        * Chart Builder.
    GGRAPH
      /GRAPHDATASET NAME="graphdataset" VARIABLES=V1 V2 
        MISSING=LISTWISE REPORTMISSING=NO
      /GRAPHSPEC SOURCE=INLINE
      /FITLINE TOTAL=NO.
    BEGIN GPL
      SOURCE: s=userSource(id("graphdataset"))
      DATA: V1=col(source(s), name("V1"), unit.category())
      DATA: V2=col(source(s), name("V2"), unit.category())
      GUIDE: axis(dim(1), label("V1"))
      GUIDE: axis(dim(2), label("V2"))
      SCALE: cat(dim(1), include("0.00", "1.00", "2.00", "3.00"))
      SCALE: cat(dim(2), include("0.00", "1.00"))
      ELEMENT: point.jitter(position(V1*V2))
    END GPL.
    

    I notice that /FITLINE TOTAL=NO. is not an actual fonction, but when adding a "s" to FITLINE, it turns green, "TOTAL" turns red and "No". Running the syntax after this change does not do anything and I receive the same error message...

    I just don't get it.

    If anyone have thoughts it would be great. Your help would be greatly appreciated!

    Cheers



    ------------------------------
    Guillaume D
    ------------------------------

    #SPSSStatistics


  • 2.  RE: SPSS error#99 message for jitter scatter plot. What can I do?

    Posted Thu June 24, 2021 08:39 AM
    Edited by System Admin Fri January 20, 2023 04:35 PM
    Hi. I made up my own data, pasted your syntax exactly as it is in your note, and it ran with no problems in both versions 27 and 28 on a Mac.

    data list free /v1 v2.
    begin data.
    1 0
    2 1
    3 1
    3 0
    1 0
    2 1
    2 1
    1 1
    1 0
    end data.
    variable level v1 v2 (ordinal).
    
    GGRAPH
     /GRAPHDATASET NAME="graphdataset" VARIABLES=V1 V2 
     MISSING=LISTWISE REPORTMISSING=NO
     /GRAPHSPEC SOURCE=INLINE
     /FITLINE TOTAL=NO.
    BEGIN GPL
     SOURCE: s=userSource(id("graphdataset"))
     DATA: V1=col(source(s), name("V1"), unit.category())
     DATA: V2=col(source(s), name("V2"), unit.category())
     GUIDE: axis(dim(1), label("V1"))
     GUIDE: axis(dim(2), label("V2"))
     SCALE: cat(dim(1), include("0.00", "1.00", "2.00", "3.00"))
     SCALE: cat(dim(2), include("0.00", "1.00"))
     ELEMENT: point.jitter(position(V1*V2))
    END GPL.​


    And for me, FITLINE is already green (meaning that it is recognized as a valid subcommand) without adding anything:

    I am guessing that an invisible character is embedded in your syntax file somewhere inside the GGRAPH command. I don't know what else it could be.

    ------------------------------
    Rick Marcantonio
    Quality Assurance
    IBM
    ------------------------------



  • 3.  RE: SPSS error#99 message for jitter scatter plot. What can I do?

    Posted Thu June 24, 2021 08:49 AM
    or, perhaps, when you selected and ran the code, you got only the BEGIN... END GPL part.  Make sure to select all of that,

    --





  • 4.  RE: SPSS error#99 message for jitter scatter plot. What can I do?

    Posted Thu June 24, 2021 04:38 PM
    Well, sorry for bothering you again:

    Jon pointed it out correctly. I needed to select all of the syntax and run it in one time! I did select from DATASET ACTIVATE to END GPL and it works !

    Thank you!
    --
    Guillaume Durou





  • 5.  RE: SPSS error#99 message for jitter scatter plot. What can I do?

    Posted Thu June 24, 2021 04:33 PM
    Thank you everyone !

    I actually have SPSS 26.

    I thought my data would be a problem, so I used Rick's syntax with his data  and I still have the same error#99 when I run GPL.

    Moreover, when I run 
    GGRAPH
    /GRAPHDATASET NAME="graphdataset"
    VARIABLES=V1 V2 MISSING=LISTWISE REPORTMISSING=NO
    /GRAPHSPEC SOURCE=INLINE.

    I get "An inline graph specification was expected but not found"

    I don't know if there is something wrong with my SPSS default setting or if I am not doing the procedure correctly.

    Maybe it's the version ?

    Again, if you have any thoughts, it would be greatly appreciated.