SPSS Statistics

 View Only
Expand all | Collapse all

Syntax results in error but second try passes #spss statistics

  • 1.  Syntax results in error but second try passes #spss statistics

    Posted Mon March 04, 2024 08:37 AM
      |   view attached

    I run a syntax based on OMS Control Panel utility. Extract from syntax below.

    First I build a new dataset. Then I run the Graph Builder on the new dataset.

    The strange thing that happens is that the first run of this syntax results in an error: "Cannot combine category and number types for items 'Mean' and 'null' "

    However, when I try to run the same syntax again (20 seconds later), it passes and creates the graph.

    What is happening here?

    * Store mean score and standard deviation in a separate dataset to be exploited in next step to build a scatter plot.
    DATASET DECLARE  InputfromOutput.
    OMS
      /SELECT TABLES
      /IF COMMANDS=['Descriptives'] SUBTYPES=['Descriptive Statistics']
      /DESTINATION FORMAT=SAV NUMBERED=TableNumber_
       OUTFILE='InputfromOutput' VIEWER=YES
      /TAG='Mean_StDev'.
    DESCRIPTIVES VARIABLES=VE01 VE02 VE03 VA01 VA02 VR02 VR01 VB01 VB02 VW01 VW03 VM01 VM02 VV04 VV03 
        VC01 VC02 VI01 VI02 VI03 VI04 VL01 VL02 VL03 VL04 VN01 VN02 VN04 VN03 VP01 VF01 VF02 VV01 VN05 VC03 
        VV02 VT02 VT03 VT05
      /STATISTICS=MEAN STDDEV
      /SORT=MEAN (D).
    OMSEND tag='Mean_StDev'.

    * Plotting the mean against the standard deviation.
    * Chart Builder.

    DATASET ACTIVATE InputfromOutput.
    GGRAPH
      /GRAPHDATASET NAME="graphdataset" VARIABLES=Mean Std.Deviation[name="Std_Deviation"] 
        MISSING=LISTWISE REPORTMISSING=NO
      /GRAPHSPEC SOURCE=INLINE
      /FITLINE TOTAL=NO SUBGROUP=NO
      /FRAME OUTER=NO INNER=NO
      /GRIDLINES XAXIS=NO YAXIS=NO.
    BEGIN GPL
      GUIDE: axis(dim(1), label("Mean"))
      GUIDE: axis(dim(2), label("Std. Deviation"))
      GUIDE: text.title(label("Scatter Plot of Std. Deviation by Mean"))
      SCALE: linear(dim(1), min(3.00), max(4.50))
      SCALE: linear(dim(2), min(0.75), max(1.50), reverse())
      ELEMENT: point(position(Mean*Std_Deviation))
    END GPL.



    ------------------------------
    Jos Blykers
    ------------------------------

    Attachment(s)

    docx
    Error Msg GPL.docx   258 KB 1 version


  • 2.  RE: Syntax results in error but second try passes #spss statistics

    Posted Wed March 13, 2024 05:37 PM
    Edited by David Dwyer Wed March 13, 2024 05:48 PM

    Hi @Jos Blykers

    Thank you for bringing this behavior to our attention!  I tried to the same kind of operations using the bankloan.sav example data.  The OMS procedure brings back the last row of your DESCRIPTIVES table.  That is the "Valid N" row and has system missing values for "Mean" and "Std. Deviation".  I'm suspecting that the

    "GGRAPH /GRAPHDATASET MISSING=LISTWISE" is not properly dropping this case and that is why your graph fails.

    To test, I used the FILTER command to eliminate this case and re-ran the graph -- Success!

    I've logged an issue with IBM SPSS Statistics Development (GH #7591) to have it addressed in a future release.

    See Known Issue DT319221



    ------------------------------
    David Dwyer
    SPSS Technical Support
    IBM Software
    ------------------------------