SPSS Statistics

SPSS Statistics

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

 View Only
  • 1.  missing values in graph

    Posted Sun October 02, 2022 10:50 AM
      |   view attached
    hi,

    when i run the following code on the attached file, i am not able to edit the graph to make it display the values for Finland 2011 and Finland 2021. it does display all other values. Finland is missing mnx for 2006.

    get file = "C:\Temp\Test\samplefile.sav".
    graph / line(multiple)=mean(mnx) by year by idcntry.

    any clues how to make this happen?

    thank you!

    ------------------------------
    Eugenio Gonzalez
    ------------------------------

    #SPSSStatistics

    Attachment(s)

    sav
    samplefile.sav   1 KB 1 version


  • 2.  RE: missing values in graph

    Posted Sun October 02, 2022 01:40 PM
    GGRAPH gives you control over the missing value treatment.  Here's what you might do.

    GGRAPH
      /GRAPHDATASET NAME="graphdataset" VARIABLES=YEAR mnx IDCNTRY MISSING=VARIABLEWISE  
      /GRAPHSPEC SOURCE=INLINE.
    BEGIN GPL
      GUIDE: axis(dim(1), label("YEAR"))
      GUIDE: axis(dim(2), label("ASDAGE (Mean)"))
      GUIDE: legend(aesthetic(aesthetic.color.interior), label("COUNTRY ID - NUMERIC CODE"))
      GUIDE: text.title(label("Multiple Line of ASDAGE (Mean) by YEAR by COUNTRY ID - NUMERIC CODE"))
      SCALE: cat(aesthetic(aesthetic.color.interior), include(
    "208", "246", "578", "752", "88.888"), aestheticMissing(color.black))
      ELEMENT: line(position(YEAR*mnx), color.interior(IDCNTRY), missing.wings())
    END GPL.

    If your Statistics version is older than 29 or maybe 28.0.1.1, you would need to add the data definition statements, which the ChartBuilder will do for you in those versions.  You have a label for 88888, but you might want to eliminate that label so that it doesn't appear in the legend.

    --





  • 3.  RE: missing values in graph

    Posted Tue October 04, 2022 09:38 AM

    Thank you, John. Will give it a try.