GPL help: two multiple line outcomes in one graph

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

GPL help: two multiple line outcomes in one graph

Kylie
Hi everyone,

I'm hoping to get some help in constructing a graph. I have a data set with two outcomes (highest blood glucose (BSL_hi) and lowest blood glucose (BSL_low)) measured daily for 1-10 days per subject. The data file is in the 'long' format with one row per day (StudyDay) per subject. Subjects belong to one of two groups (Group). I have drawn line graphs separately for BSL_hi and BSL_low (StudyDay on the x-axis, separate lines per Group) showing the means and 95% CIs.

I'd now like to put both sets of lines on the same graph - can anyone help with that? I haven't had any luck constructing it through the Chart Builder or the Template Chooser. I think it might need a dual axis setup (though both outcomes are on the same scale so I don't actually want a physical axis on the right hand side of the graph)?

Here is the syntax generated for one of the single graphs (BSL_hi):

GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=StudyDay#[name="StudyDay_"] MEANCI(BSL_Hi, 95)[name="MEAN_BSL_Hi" LOW="MEAN_BSL_Hi_LOW" HIGH="MEAN_BSL_Hi_HIGH"] Group
  MISSING=LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA: StudyDay_=col(source(s), name("StudyDay_"), unit.category())
  DATA: MEAN_BSL_Hi=col(source(s), name("MEAN_BSL_Hi"))
  DATA: Group=col(source(s), name("Group"), unit.category())
  DATA: LOW=col(source(s), name("MEAN_BSL_Hi_LOW"))
  DATA: HIGH=col(source(s), name("MEAN_BSL_Hi_HIGH"))
  GUIDE: axis(dim(1), label("Study Day #"))
  GUIDE: axis(dim(2), label("Mean Highest BSL (mmol/L)"))
  GUIDE: legend(aesthetic(aesthetic.color.interior), label("Group"))
  GUIDE: text.footnote(label("Error Bars: 95% CI"))
  SCALE: linear(dim(2), include(0))
  SCALE: cat(aesthetic(aesthetic.color.interior), include("1.0", "1.5"))
  ELEMENT: line(position(StudyDay_*MEAN_BSL_Hi), color.interior(Group), missing.wings())
  ELEMENT: interval(position(region.spread.range(StudyDay_*(LOW+HIGH))), shape.interior(shape.ibeam), color.interior(Group))
END GPL.

Thanks for any suggestions.

Kylie.
Reply | Threaded
Open this post in threaded view
|

Re: GPL help: two multiple line outcomes in one graph

Andy W
You can't do it through the GUI, but you can just copy and paste several lines to add in the additional line (no dual axis needed). (An easy way to do it is to generate the exact same chart for the BSL_low variable, and you can copy-paste in the appropriate lines to make a graph with both.)

So 1), we have the variables on the GRAPHDATASET subcommand on the GGRAPH command,

MEANCI(BSL_Hi, 95)[name="MEAN_BSL_Hi" LOW="MEAN_BSL_Hi_LOW" HIGH="MEAN_BSL_Hi_HIGH"]

You will just need to do more or less the same for BSL_Low, but just need to make sure they have different names so they don't conflict.

MEANCI(BSL_Low, 95)[name="MEAN_BSL_Low" LOW="MEAN_BSL_Low_LOW" HIGH="MEAN_BSL_Low_HIGH"]

2), Within the GPL call, you will need to update the DATA subcommands to call the new variables, so previously we have

  DATA: MEAN_BSL_Hi=col(source(s), name("MEAN_BSL_Hi"))
  DATA: LOW=col(source(s), name("MEAN_BSL_Hi_LOW"))
  DATA: HIGH=col(source(s), name("MEAN_BSL_Hi_HIGH"))

And you will want to add in the new variables you just made for the Low line. Note changes to both the name token on the right hand side, and what it results in in GPL code on the left hand side.

  DATA: MEAN_BSL_Low=col(source(s), name("MEAN_BSL_Hi"))
  DATA: LOW_L=col(source(s), name("MEAN_BSL_Low_LOW"))
  DATA: HIGH_L=col(source(s), name("MEAN_BSL_Low_HIGH"))

3), now we can add in new ELEMENT statements to superimpose the new lines on the graph. So originally we have

  ELEMENT: line(position(StudyDay_*MEAN_BSL_Hi), color.interior(Group), missing.wings())
  ELEMENT: interval(position(region.spread.range(StudyDay_*(LOW+HIGH))), shape.interior(shape.ibeam), color.interior(Group))

And we just need to insert our new variables within the position statement

  ELEMENT: line(position(StudyDay_*MEAN_BSL_Low), color.interior(Group), missing.wings())
  ELEMENT: interval(position(region.spread.range(StudyDay_*(LOW_L+HIGH_L))), shape.interior(shape.ibeam), color.interior(Group))

As far as graphing goes, visualizing overlapping areas is difficult, so plotting them with transparency is suggested. Also this doesn't visually distinguish between the low line (and confidence interval) and the upper line. For the lines you could change the shape of the line and/or use a dashed fill for the areas (it gets quite busy though).

So my guess on a graph would be (with transparency for the areas);

GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=StudyDay#[name="StudyDay_"] MEANCI(BSL_Hi, 95)[name="MEAN_BSL_Hi" LOW="MEAN_BSL_Hi_LOW" HIGH="MEAN_BSL_Hi_HIGH"] Group
  MEANCI(BSL_Low, 95)[name="MEAN_BSL_Low" LOW="MEAN_BSL_Low_LOW" HIGH="MEAN_BSL_Low_HIGH"]
  MISSING=LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA: StudyDay_=col(source(s), name("StudyDay_"), unit.category())
  DATA: MEAN_BSL_Hi=col(source(s), name("MEAN_BSL_Hi"))
  DATA: Group=col(source(s), name("Group"), unit.category())
  DATA: LOW=col(source(s), name("MEAN_BSL_Hi_LOW"))
  DATA: HIGH=col(source(s), name("MEAN_BSL_Hi_HIGH"))
  DATA: MEAN_BSL_Hi=col(source(s), name("MEAN_BSL_Hi"))
  DATA: LOW=col(source(s), name("MEAN_BSL_Hi_LOW"))
  DATA: HIGH=col(source(s), name("MEAN_BSL_Hi_HIGH"))
  GUIDE: axis(dim(1), label("Study Day #"))
  GUIDE: axis(dim(2), label("Mean Highest BSL (mmol/L)"))
  GUIDE: legend(aesthetic(aesthetic.color.interior), label("Group"))
  GUIDE: text.footnote(label("Error Bars: 95% CI"))
  SCALE: linear(dim(2), include(0))
  SCALE: cat(aesthetic(aesthetic.color.interior), include("1.0", "1.5"))
  ELEMENT: line(position(StudyDay_*MEAN_BSL_Hi), color.interior(Group), missing.wings())
  ELEMENT: interval(position(region.spread.range(StudyDay_*(LOW+HIGH))), shape.interior(shape.ibeam), color.interior(Group), transparency.interior(transparency."0.5"))
  ELEMENT: line(position(StudyDay_*MEAN_BSL_Low), color.interior(Group), missing.wings())
  ELEMENT: interval(position(region.spread.range(StudyDay_*(LOW_L+HIGH_L))), shape.interior(shape.ibeam), color.interior(Group), transparency.interior(transparency."0.5"))
END GPL.
Andy W
apwheele@gmail.com
http://andrewpwheeler.wordpress.com/
Reply | Threaded
Open this post in threaded view
|

Re: GPL help: two multiple line outcomes in one graph

Andy W
I see I failed to take my own advice in the suggested syntax (the DATA statements weren't updated properly). Here are some examples with similar data. I have attached the last example that uses faceting by group instead of placing all of the errors on the chart. (I also see I was thinking the interval element was an area, but I was wrong and it is just seperate error bars, so you can pretty much ignore what I said about transparency and overlapping areas, although overlapping error bars is still a problem).

************************************************************************************.
set seed 10.
input program.
loop #subs = 1 to 100.
loop #days = 1 to TRUNC(RV.UNIFORM(1,11)).
  compute StudyDay# = #days.
  compute id = #subs.
  compute group = 1 + RV.BERNOULLI(0.5)/2.
  end case.
end loop.
end loop.
end file.
end input program.
dataset name BSL.
compute BSL_Hi = RV.UNIFORM(0.3,0.8).
compute BSL_Low = RV.UNIFORM(0.1,0.5).
exe.

*With Clustering.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=StudyDay#[name="StudyDay_"] group
   MEANCI(BSL_hi, 95)[name="MEANCI_BSL_hi_95" LOW="MEANCI_BSL_hi_95_LOW" HIGH="MEANCI_BSL_hi_95_HIGH"]
   MEANCI(BSL_Low, 95)[name="MEAN_BSL_Low" LOW="MEAN_BSL_Low_LOW" HIGH="MEAN_BSL_Low_HIGH"]
  MISSING=LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
 SOURCE: s=userSource(id("graphdataset"))
 DATA: StudyDay_=col(source(s), name("StudyDay_"), unit.category())
 DATA: MEAN_BSL_hi=col(source(s), name("MEANCI_BSL_hi_95"))
 DATA: LOW=col(source(s), name("MEANCI_BSL_hi_95_LOW"))
 DATA: HIGH=col(source(s), name("MEANCI_BSL_hi_95_HIGH"))
 DATA: group=col(source(s), name("group"), unit.category())
 DATA: MEAN_BSL_Low=col(source(s), name("MEAN_BSL_Low"))
 DATA: LOW_L=col(source(s), name("MEAN_BSL_Low_LOW"))
 DATA: HIGH_L=col(source(s), name("MEAN_BSL_Low_HIGH"))
 COORD: rect(dim(1,2), cluster(3,0))
 GUIDE: axis(dim(3), label("StudyDay#"))
 GUIDE: axis(dim(2), label("Mean BSL"))
 GUIDE: legend(aesthetic(aesthetic.color.exterior), label("group"))
 GUIDE: text.footnote(label("Error Bars: 95% CI"))
 SCALE: cat(dim(3))
 SCALE: linear(dim(2))
 SCALE: cat(dim(1))
 ELEMENT: line(position(group*MEAN_BSL_hi*StudyDay_), color(group))
 ELEMENT: interval(position(region.spread.range(group*(LOW+HIGH)*StudyDay_)), shape.interior(shape.ibeam), color.interior(group))
 ELEMENT: line(position(group*MEAN_BSL_Low*StudyDay_), color(group))
 ELEMENT: interval(position(region.spread.range(group*(LOW_L+HIGH_L)*StudyDay_)), shape.interior(shape.ibeam), color.interior(group))
END GPL.

*Without Clustering.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=StudyDay#[name="StudyDay_"] group
   MEANCI(BSL_hi, 95)[name="MEANCI_BSL_hi_95" LOW="MEANCI_BSL_hi_95_LOW" HIGH="MEANCI_BSL_hi_95_HIGH"]
   MEANCI(BSL_Low, 95)[name="MEAN_BSL_Low" LOW="MEAN_BSL_Low_LOW" HIGH="MEAN_BSL_Low_HIGH"]
  MISSING=LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
 SOURCE: s=userSource(id("graphdataset"))
 DATA: StudyDay_=col(source(s), name("StudyDay_"), unit.category())
 DATA: MEAN_BSL_hi=col(source(s), name("MEANCI_BSL_hi_95"))
 DATA: LOW=col(source(s), name("MEANCI_BSL_hi_95_LOW"))
 DATA: HIGH=col(source(s), name("MEANCI_BSL_hi_95_HIGH"))
 DATA: group=col(source(s), name("group"), unit.category())
 DATA: MEAN_BSL_Low=col(source(s), name("MEAN_BSL_Low"))
 DATA: LOW_L=col(source(s), name("MEAN_BSL_Low_LOW"))
 DATA: HIGH_L=col(source(s), name("MEAN_BSL_Low_HIGH"))
 GUIDE: axis(dim(1), label("StudyDay#"))
 GUIDE: axis(dim(2), label("Mean BSL"))
 GUIDE: legend(aesthetic(aesthetic.color.exterior), label("group"))
 GUIDE: text.footnote(label("Error Bars: 95% CI"))
 SCALE: cat(dim(3))
 SCALE: linear(dim(2))
 SCALE: cat(dim(1))
 ELEMENT: line(position(StudyDay_*MEAN_BSL_hi), color(group))
 ELEMENT: interval(position(region.spread.range(StudyDay_*(LOW+HIGH))), shape.interior(shape.ibeam), color.interior(group))
 ELEMENT: line(position(StudyDay_*MEAN_BSL_Low), color(group))
 ELEMENT: interval(position(region.spread.range(StudyDay_*(LOW_L+HIGH_L))), shape.interior(shape.ibeam), color.interior(group))
END GPL.

*Facet by groups may be a good idea too here I use color to distinguish BSL Low or hi.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=StudyDay#[name="StudyDay_"] group
   MEANCI(BSL_hi, 95)[name="MEANCI_BSL_hi_95" LOW="MEANCI_BSL_hi_95_LOW" HIGH="MEANCI_BSL_hi_95_HIGH"]
   MEANCI(BSL_Low, 95)[name="MEAN_BSL_Low" LOW="MEAN_BSL_Low_LOW" HIGH="MEAN_BSL_Low_HIGH"]
  MISSING=LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
 SOURCE: s=userSource(id("graphdataset"))
 DATA: StudyDay_=col(source(s), name("StudyDay_"), unit.category())
 DATA: MEAN_BSL_hi=col(source(s), name("MEANCI_BSL_hi_95"))
 DATA: LOW=col(source(s), name("MEANCI_BSL_hi_95_LOW"))
 DATA: HIGH=col(source(s), name("MEANCI_BSL_hi_95_HIGH"))
 DATA: group=col(source(s), name("group"), unit.category())
 DATA: MEAN_BSL_Low=col(source(s), name("MEAN_BSL_Low"))
 DATA: LOW_L=col(source(s), name("MEAN_BSL_Low_LOW"))
 DATA: HIGH_L=col(source(s), name("MEAN_BSL_Low_HIGH"))
 GUIDE: axis(dim(3), label("Group"), opposite())
 GUIDE: axis(dim(2), label("Mean BSL"))
 GUIDE: axis(dim(1), label("StudyDay#"))
 GUIDE: legend(aesthetic(aesthetic.color.exterior), label("group"))
 GUIDE: text.footnote(label("Error Bars: 95% CI"))
 SCALE: cat(dim(3))
 SCALE: linear(dim(2))
 SCALE: cat(dim(1))
 ELEMENT: line(position(StudyDay_*MEAN_BSL_hi*group), color("BSL_High"))
 ELEMENT: interval(position(region.spread.range(StudyDay_*(LOW+HIGH)*group)), shape.interior(shape.ibeam), color.interior("BSL_High"))
 ELEMENT: line(position(StudyDay_*MEAN_BSL_Low*group), color("BSL_Low"))
 ELEMENT: interval(position(region.spread.range(StudyDay_*(LOW_L+HIGH_L)*group)), shape.interior(shape.ibeam), color.interior("BSL_Low"))
END GPL.
************************************************************************************.

Andy W
apwheele@gmail.com
http://andrewpwheeler.wordpress.com/
Reply | Threaded
Open this post in threaded view
|

Re: GPL help: two multiple line outcomes in one graph

Kylie
Thanks not only for the code Andy, but the detailed explanation - that makes great sense. The clustered and non-clustered graphs worked perfectly and give me what I need.

The faceted graph gave me the following error (something in the GUIDE lines maybe?) but I don't need it fixed for myself so this is only if you are curious:

GPL error: GPL Translation Error:
Internal translation error.
Cannot handle [com.spss.vis.specification.legend.LegendTargetSpecification@61b861b8 legendTarget[target=color_409,id=legendTarget_447], com.spss.vis.specification.legend.LegendTargetSpecification@62e262e2 legendTarget[target=color_421,id=legendTarget_448], com.spss.vis.specification.legend.LegendTargetSpecification@64126412 legendTarget[target=color_427,id=legendTarget_449], com.spss.vis.specification.legend.LegendTargetSpecification@64e264e2 legendTarget[target=color_427,id=legendTarget_450]] for com.spss.vis.specification.legend.LegendSpecification@60896089 legend[id=legend_446]{legendTarget,legendTarget,legendTarget,legendTarget,location,location,location,location}

Many thanks,
Kylie.


-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Andy W
Sent: Friday, 23 August 2013 12:50 AM
To: [hidden email]
Subject: Re: GPL help: two multiple line outcomes in one graph

I see I failed to take my own advice in the suggested syntax (the DATA
statements weren't updated properly). Here are some examples with similar
data. I have attached the last example that uses faceting by group instead
of placing all of the errors on the chart. (I also see I was thinking the
interval element was an area, but I was wrong and it is just seperate error
bars, so you can pretty much ignore what I said about transparency and
overlapping areas, although overlapping error bars is still a problem).

************************************************************************************.
set seed 10.
input program.
loop #subs = 1 to 100.
loop #days = 1 to TRUNC(RV.UNIFORM(1,11)).
  compute StudyDay# = #days.
  compute id = #subs.
  compute group = 1 + RV.BERNOULLI(0.5)/2.
  end case.
end loop.
end loop.
end file.
end input program.
dataset name BSL.
compute BSL_Hi = RV.UNIFORM(0.3,0.8).
compute BSL_Low = RV.UNIFORM(0.1,0.5).
exe.

*With Clustering.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=StudyDay#[name="StudyDay_"]
group
   MEANCI(BSL_hi, 95)[name="MEANCI_BSL_hi_95" LOW="MEANCI_BSL_hi_95_LOW"
HIGH="MEANCI_BSL_hi_95_HIGH"]
   MEANCI(BSL_Low, 95)[name="MEAN_BSL_Low" LOW="MEAN_BSL_Low_LOW"
HIGH="MEAN_BSL_Low_HIGH"]
  MISSING=LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
 SOURCE: s=userSource(id("graphdataset"))
 DATA: StudyDay_=col(source(s), name("StudyDay_"), unit.category())
 DATA: MEAN_BSL_hi=col(source(s), name("MEANCI_BSL_hi_95"))
 DATA: LOW=col(source(s), name("MEANCI_BSL_hi_95_LOW"))
 DATA: HIGH=col(source(s), name("MEANCI_BSL_hi_95_HIGH"))
 DATA: group=col(source(s), name("group"), unit.category())
 DATA: MEAN_BSL_Low=col(source(s), name("MEAN_BSL_Low"))
 DATA: LOW_L=col(source(s), name("MEAN_BSL_Low_LOW"))
 DATA: HIGH_L=col(source(s), name("MEAN_BSL_Low_HIGH"))
 COORD: rect(dim(1,2), cluster(3,0))
 GUIDE: axis(dim(3), label("StudyDay#"))
 GUIDE: axis(dim(2), label("Mean BSL"))
 GUIDE: legend(aesthetic(aesthetic.color.exterior), label("group"))
 GUIDE: text.footnote(label("Error Bars: 95% CI"))
 SCALE: cat(dim(3))
 SCALE: linear(dim(2))
 SCALE: cat(dim(1))
 ELEMENT: line(position(group*MEAN_BSL_hi*StudyDay_), color(group))
 ELEMENT:
interval(position(region.spread.range(group*(LOW+HIGH)*StudyDay_)),
shape.interior(shape.ibeam), color.interior(group))
 ELEMENT: line(position(group*MEAN_BSL_Low*StudyDay_), color(group))
 ELEMENT:
interval(position(region.spread.range(group*(LOW_L+HIGH_L)*StudyDay_)),
shape.interior(shape.ibeam), color.interior(group))
END GPL.

*Without Clustering.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=StudyDay#[name="StudyDay_"]
group
   MEANCI(BSL_hi, 95)[name="MEANCI_BSL_hi_95" LOW="MEANCI_BSL_hi_95_LOW"
HIGH="MEANCI_BSL_hi_95_HIGH"]
   MEANCI(BSL_Low, 95)[name="MEAN_BSL_Low" LOW="MEAN_BSL_Low_LOW"
HIGH="MEAN_BSL_Low_HIGH"]
  MISSING=LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
 SOURCE: s=userSource(id("graphdataset"))
 DATA: StudyDay_=col(source(s), name("StudyDay_"), unit.category())
 DATA: MEAN_BSL_hi=col(source(s), name("MEANCI_BSL_hi_95"))
 DATA: LOW=col(source(s), name("MEANCI_BSL_hi_95_LOW"))
 DATA: HIGH=col(source(s), name("MEANCI_BSL_hi_95_HIGH"))
 DATA: group=col(source(s), name("group"), unit.category())
 DATA: MEAN_BSL_Low=col(source(s), name("MEAN_BSL_Low"))
 DATA: LOW_L=col(source(s), name("MEAN_BSL_Low_LOW"))
 DATA: HIGH_L=col(source(s), name("MEAN_BSL_Low_HIGH"))
 GUIDE: axis(dim(1), label("StudyDay#"))
 GUIDE: axis(dim(2), label("Mean BSL"))
 GUIDE: legend(aesthetic(aesthetic.color.exterior), label("group"))
 GUIDE: text.footnote(label("Error Bars: 95% CI"))
 SCALE: cat(dim(3))
 SCALE: linear(dim(2))
 SCALE: cat(dim(1))
 ELEMENT: line(position(StudyDay_*MEAN_BSL_hi), color(group))
 ELEMENT: interval(position(region.spread.range(StudyDay_*(LOW+HIGH))),
shape.interior(shape.ibeam), color.interior(group))
 ELEMENT: line(position(StudyDay_*MEAN_BSL_Low), color(group))
 ELEMENT: interval(position(region.spread.range(StudyDay_*(LOW_L+HIGH_L))),
shape.interior(shape.ibeam), color.interior(group))
END GPL.

*Facet by groups may be a good idea too here I use color to distinguish BSL
Low or hi.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=StudyDay#[name="StudyDay_"]
group
   MEANCI(BSL_hi, 95)[name="MEANCI_BSL_hi_95" LOW="MEANCI_BSL_hi_95_LOW"
HIGH="MEANCI_BSL_hi_95_HIGH"]
   MEANCI(BSL_Low, 95)[name="MEAN_BSL_Low" LOW="MEAN_BSL_Low_LOW"
HIGH="MEAN_BSL_Low_HIGH"]
  MISSING=LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
 SOURCE: s=userSource(id("graphdataset"))
 DATA: StudyDay_=col(source(s), name("StudyDay_"), unit.category())
 DATA: MEAN_BSL_hi=col(source(s), name("MEANCI_BSL_hi_95"))
 DATA: LOW=col(source(s), name("MEANCI_BSL_hi_95_LOW"))
 DATA: HIGH=col(source(s), name("MEANCI_BSL_hi_95_HIGH"))
 DATA: group=col(source(s), name("group"), unit.category())
 DATA: MEAN_BSL_Low=col(source(s), name("MEAN_BSL_Low"))
 DATA: LOW_L=col(source(s), name("MEAN_BSL_Low_LOW"))
 DATA: HIGH_L=col(source(s), name("MEAN_BSL_Low_HIGH"))
 GUIDE: axis(dim(3), label("Group"), opposite())
 GUIDE: axis(dim(2), label("Mean BSL"))
 GUIDE: axis(dim(1), label("StudyDay#"))
 GUIDE: legend(aesthetic(aesthetic.color.exterior), label("group"))
 GUIDE: text.footnote(label("Error Bars: 95% CI"))
 SCALE: cat(dim(3))
 SCALE: linear(dim(2))
 SCALE: cat(dim(1))
 ELEMENT: line(position(StudyDay_*MEAN_BSL_hi*group), color("BSL_High"))
 ELEMENT:
interval(position(region.spread.range(StudyDay_*(LOW+HIGH)*group)),
shape.interior(shape.ibeam), color.interior("BSL_High"))
 ELEMENT: line(position(StudyDay_*MEAN_BSL_Low*group), color("BSL_Low"))
 ELEMENT:
interval(position(region.spread.range(StudyDay_*(LOW_L+HIGH_L)*group)),
shape.interior(shape.ibeam), color.interior("BSL_Low"))
END GPL.
************************************************************************************.

<http://spssx-discussion.1045642.n5.nabble.com/file/n5721683/OUTPUT0.png>



-----
Andy W
[hidden email]
http://andrewpwheeler.wordpress.com/
--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/GPL-help-two-multiple-line-outcomes-in-one-graph-tp5721671p5721683.html
Sent from the SPSSX Discussion mailing list archive at 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

=====================
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: GPL help: two multiple line outcomes in one graph

Andy W
Thanks for the feedback and glad it worked out. The error is in regards to the legend, so I would either change the "aesthetic.color.exterior" to "aesthetic.color.interior" in the "GUIDE: legend" statement or delete that line altogether (SPSS defaults to draw all legends).

I did that on V15, and it appears it just didn't draw that specified legend (or it would have a title of "Group").
Andy W
apwheele@gmail.com
http://andrewpwheeler.wordpress.com/