plotting multiple lines and CIs from saved values

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

plotting multiple lines and CIs from saved values

Kylie Lange-3

Hi all,

 

I am trying to plot the predicted values and 95% CIs that I have saved from a mixed model (continuous outcome versus a continuous predictor, for two groups). I created dummy cases for the range of the predictor that I want to plot (for each group) and saved the predicted values and SEs.

 

I tried restructuring the file so that the predicted values, LCL and UCLs are in one variable and used the following syntax (generated from the Graphboard as a scatterplot):

 

GGRAPH

  /GRAPHDATASET NAME="graphdataset"

    VARIABLES=DataType[LEVEL=nominal] XVar[LEVEL=scale] YVar[LEVEL=scale] GroupVar[LEVEL=nominal]

    MISSING=LISTWISE REPORTMISSING=NO

  /GRAPHSPEC SOURCE=VIZTEMPLATE(NAME="Scatterplot"[LOCATION=LOCAL]

    MAPPING( "color"="GroupVar"[DATASET="graphdataset"]

    "shape"="DataType"[DATASET="graphdataset"]

    "x"=" XVar "[DATASET="graphdataset"]

    "y"=" YVar "[DATASET="graphdataset"]))

    VIZSTYLESHEET="Traditional"[LOCATION=LOCAL]

    LABEL='SCATTERPLOT: YVar - XVar’

    DEFAULTTEMPLATE=NO.

 

This gives me the six series that I want (predicted values, LCL and UCLs for each group), but it’s not particularly pretty. I don’t know if I’m close, or on the wrong track.

 

Ideally, I’d have the predicted lines for the two groups in different colours, and the 2 sets of CIs in different line styles (small and large dashes, for example).

 

Any suggestions of how best to approach this?

Thanks,

Kylie.

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: plotting multiple lines and CIs from saved values

Andy W
I have an analogous example posted here,
https://andrewpwheeler.wordpress.com/2016/03/08/on-overlapping-error-bars-in-charts/.

For the charts you won't want the data all stacked into two columns.
Depending on the type of chart you will either have the data variables like:

Group Low Middle High

OR

LowG1 MiddleG1 HighG1 LowG2 MiddleG2 HighG2





-----
Andy W
[hidden email]
http://andrewpwheeler.wordpress.com/
--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Andy W
apwheele@gmail.com
http://andrewpwheeler.wordpress.com/
Reply | Threaded
Open this post in threaded view
|

Re: plotting multiple lines and CIs from saved values

Andy W
The specific syntax in that post is linked at the bottom, but here is the
direct dropbox link for folks to peruse,
https://dl.dropboxusercontent.com/s/a4jz8cggdhhz8qb/Overlap_Graphs.sps?dl=0.



-----
Andy W
[hidden email]
http://andrewpwheeler.wordpress.com/
--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Andy W
apwheele@gmail.com
http://andrewpwheeler.wordpress.com/