Overlapping graphs

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

Overlapping graphs

eppu
Hi,
I an using SPSS 21.
I have a dataset with three different groups. I want to show the values of each datapoint as a dot plot.
In addition to the original values (as dots) I want to add the mean value of each group as a line.
An example can be seen in this article:
http://www.nature.com/bjc/journal/v108/n1/fig_tab/bjc2012553f2.html#figure-title

I have now tried to do this in SPSS according to spss help instructions for overlapping graphs,
but when I drag more than one variable to the y-axix, it only showns the
means and not the values.
Can anybody help me?

PS. I am sorry that I ask this kind of simple thing but I have really tried to solve this problem for a long time and even our department´s statistics guru could not help me.

Thank you
Reply | Threaded
Open this post in threaded view
|

Re: Overlapping graphs

David Marso
Administrator
First of all PASTE the syntax for what you have thus far attempted?
eppu wrote
Hi,
I an using SPSS 21.
I have a dataset with three different groups. I want to show the values of each datapoint as a dot plot.
In addition to the original values (as dots) I want to add the mean value of each group as a line.
An example can be seen in this article:
http://www.nature.com/bjc/journal/v108/n1/fig_tab/bjc2012553f2.html#figure-title

I have now tried to do this in SPSS according to spss help instructions for overlapping graphs,
but when I drag more than one variable to the y-axix, it only showns the
means and not the values.
Can anybody help me?

PS. I am sorry that I ask this kind of simple thing but I have really tried to solve this problem for a long time and even our department´s statistics guru could not help me.

Thank you
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: Overlapping graphs

Ryan Black
Do you ever sleep, David? :-)

Ryan

Sent from my iPhone

On Apr 26, 2013, at 7:13 AM, David Marso <[hidden email]> wrote:

> First of all PASTE the syntax for what you have thus far attempted?
>
> eppu wrote
>> Hi,
>> I an using SPSS 21.
>> I have a dataset with three different groups. I want to show the values of
>> each datapoint as a dot plot.
>> In addition to the original values (as dots) I want to add the mean value
>> of each group as a line.
>> An example can be seen in this article:
>> http://www.nature.com/bjc/journal/v108/n1/fig_tab/bjc2012553f2.html#figure-title
>>
>> I have now tried to do this in SPSS according to spss help instructions
>> for overlapping graphs,
>> but when I drag more than one variable to the y-axix, it only showns the
>> means and not the values.
>> Can anybody help me?
>>
>> PS. I am sorry that I ask this kind of simple thing but I have really
>> tried to solve this problem for a long time and even our department´s
>> statistics guru could not help me.
>>
>> Thank you
>
>
>
>
>
> -----
> Please reply to the list and not to my personal email.
> Those desiring my consulting or training services please feel free to email me.
> ---
> "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
> Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
> --
> View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Overlapping-graphs-tp5719732p5719735.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: Overlapping graphs

Andy W
In reply to this post by eppu
I have an example of doing a similar chart on this blog post, Avoid Dynamite Plots! Visualizing dot plots with super-imposed confidence intervals in SPSS and R.

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

Re: Overlapping graphs

eppu
In reply to this post by David Marso
Syntax?
Is this what you mean?
I manage to make a scatter plot with the chart builder:
 
Chart Builder.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=VAR00001 VAR00002 MISSING=LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA: VAR00001=col(source(s), name("VAR00001"), unit.category())
  DATA: VAR00002=col(source(s), name("VAR00002"))
  GUIDE: axis(dim(1), label("VAR00001"))
  GUIDE: axis(dim(2), label("VAR00002"))
  SCALE: linear(dim(2), include(0))
  ELEMENT: point(position(VAR00001*VAR00002))
END GPL.


But then I tried to add a line showing the mean of each group.
I tried to add another variable (containing the same values) to the scatter plot, and then choose "mean" for that variable, but the program only sets "mean" to both variables in the Y-axis and cannot understand that I want to have "mean" for one set and "value" to another.
So, it seems that this is not a correct way of doing it.
But if you saw the image in the article (panel C), can you imagine any possible way to create such a figure with SPSS?
Reply | Threaded
Open this post in threaded view
|

Re: Overlapping graphs

David Marso
Administrator
In reply to this post by Ryan Black
LOL:  I maintain a very strange 'non-schedule'.
I work from home as an independent consultant, so the typical 9-5 for most people is a complete aberration.  I rarely go to sleep til about 12 AM and sometimes 3.  
My Sigoth's alarm goes off at around 6:30 AM.
Usually take a short 2 hr nap in the afternoon.  
Average about 5-7 hrs a day spread out.
When I am on a coding roll I will sometimes not sleep for 36 hrs.
When I do artwork I have been known to stay up for as long as 70 straight hours working on video projects or painting.
You could say I have certain incurable, obsessive tendencies.
"I'll sleep when I'm dead"
https://www.youtube.com/watch?v=yUj1ricuFdY
Warren Zevon (RIP).
I am at an age where I really need much less sleep than in my youth.
Winter is a different matter (I hibernate like a bear in my cave).
Now that spring has sprung, it's Zoom!!!!!! Dare I say Manic?
--
Subscribe SAS-L Anonymous-2 wrote
Do you ever sleep, David? :-)

Ryan

Sent from my iPhone

On Apr 26, 2013, at 7:13 AM, David Marso <[hidden email]> wrote:

> First of all PASTE the syntax for what you have thus far attempted?
>
> eppu wrote
>> Hi,
>> I an using SPSS 21.
>> I have a dataset with three different groups. I want to show the values of
>> each datapoint as a dot plot.
>> In addition to the original values (as dots) I want to add the mean value
>> of each group as a line.
>> An example can be seen in this article:
>> http://www.nature.com/bjc/journal/v108/n1/fig_tab/bjc2012553f2.html#figure-title
>>
>> I have now tried to do this in SPSS according to spss help instructions
>> for overlapping graphs,
>> but when I drag more than one variable to the y-axix, it only showns the
>> means and not the values.
>> Can anybody help me?
>>
>> PS. I am sorry that I ask this kind of simple thing but I have really
>> tried to solve this problem for a long time and even our department´s
>> statistics guru could not help me.
>>
>> Thank you
>
>
>
>
>
> -----
> Please reply to the list and not to my personal email.
> Those desiring my consulting or training services please feel free to email me.
> ---
> "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
> Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
> --
> View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Overlapping-graphs-tp5719732p5719735.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
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: Overlapping graphs

David Marso
Administrator
In reply to this post by Andy W
VERY COOL Andrew!
I must wrap my brain around the nuances of GGRAPH and GPL very soon.
re Blog post.
I would probably replace the OMS and Means with an AGGREGATE for a bit cleaner approach.
ie: using MODE ADDVARIABLES ... / N, SD, Mean as stats.
That's maybe just my own philosophical bias (If I can calculate it in AGGREGATE or MATRIX then I'll eschew OMS and output generating procedures in favor of going for the jugular).
OTOH:  I've only upgraded recently from a non-OMS version.

---
dataset declare mean.
OMS /IF LABELS = 'Report'
/DESTINATION FORMAT = SAV OUTFILE = 'mean'.
MEANS TABLES=condition_score BY condition
  /CELLS MEAN SEMEAN.
OMSEND.

dataset activate mean.
compute mean_minus = mean - Std.ErrorofMean.
compute mean_plus = mean + Std.ErrorofMean.
execute.


I shall work through your example later today or next week?
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: Overlapping graphs

eppu
In reply to this post by Andy W
Thank you, Andy, this is what I need.

Can you please translate you procedure to a language a stupid blonde can read?
Like click-this button -type instructions?

=)


I promise to mention everybody who helped me in the Acknowledgement part of my article.


Reply | Threaded
Open this post in threaded view
|

Re: Overlapping graphs

Jon K Peck
In reply to this post by Andy W
It's worth being a little careful about terminology here.  A dot plot is really just a representation of a one-dimensional tally.  It's a more detailed analog of a bar chart.  As such, it could not contain means or confidence intervals for the points, because there is no y-axis scale to represent those values.   Andy's example is really a scatterplot with one of the axes categorical and some dodging.  If you go to the dotplot type in the Chart Builder, you will see only one axis.


Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        Andy W <[hidden email]>
To:        [hidden email],
Date:        04/26/2013 06:14 AM
Subject:        Re: [SPSSX-L] Overlapping graphs
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




I have an example of doing a similar chart on this blog post,  Avoid Dynamite
Plots! Visualizing dot plots with super-imposed confidence intervals in SPSS
and R
<
http://andrewpwheeler.wordpress.com/2012/02/20/avoid-dynamite-plots-visualizing-dot-plots-with-super-imposed-confidence-intervals-in-spss-and-r/>
.

<
http://spssx-discussion.1045642.n5.nabble.com/file/n5719741/dynamite_new_small11.png>



-----
Andy W
[hidden email]
http://andrewpwheeler.wordpress.com/
--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/Overlapping-graphs-tp5719732p5719741.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


Reply | Threaded
Open this post in threaded view
|

Re: Overlapping graphs

David Marso
Administrator
In reply to this post by eppu
I'll bet you aren't really a stupid blond.  You're likely a 40 yr old guy living in his mother's basement ;-)
With a lot of GPL and GGRAPH examples, you simply will NOT achieve them with the POINT and CLICK interface.  You will likely need to study Andy's blog post and adapt it to your requirements.
Now, I consider myself a complete neophyte wrt GPL since I just acquired ver 21 a month ago so I will be climbing the GGRAPH/GPL mountain soon -I plan to carry a lot of water and the GPL manual as a map-.
Very powerful stuff.  Too bad they don't play nice with macros ;-(((
--
eppu wrote
Thank you, Andy, this is what I need.

Can you please translate you procedure to a language a stupid blonde can read?
Like click-this button -type instructions?

=)


I promise to mention everybody who helped me in the Acknowledgement part of my article.
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: Overlapping graphs

Andy W
In reply to this post by eppu
eppu,

Unfortunately you can't do it via point-and-click. What I did below was to start with an error-interval chart, and then add in the necessary elements to make it a final chart with all the necessary elements. If you need more help and post some example data I could help adapt it to your needs, but there isn't much else I can say besides dig into to it and see if you understand. If you have more specific questions feel free to ask. At the end of the post I provide an essentially complete example.

re David - You can get the error intervals however you would like, and I agree there OMS wasn't needed. Below I show how to get confidence intervals and the mean through regression.

re Jon - Yes, it is good to be clear with terminology. I disagree though the SPSS's chart dialog is what defines the correct terminology!

1) My use of dot plot is totally consistent with LeLand Wilkinson's work (see his American Statistician article on dot plots or his Grammer of Graphics book). I even see  Wikipedia discusses the differences.
2) I imagine when you say dot plot (as opposed to SPSS's chart builder) most people think of Cleveland type dot plots (e.g. here). I challenge anyone to describe a Cleveland dot plot as anything other than "a scatterplot with one of the axes categorical". The dot plots via the chart builder dialog are merely histograms that use dots instead of bars (which aren't even  Wilkinson dot plots as he describes in his American Statistician article!).

I agree we should be clear with terminology and the differences within SPSS lingo, but it is much easier to just speak in terms of elements of the chart (via the grammer) then just label charts with specific names.

**********************************************************.
*Making fake data.
set seed 10.
input program.
loop #i = 1 to 25.
loop #g = 1 to 4.
compute group = #g.
compute y = RV.NORMAL(#g,2).
end case.
end loop.
end loop.
end file.
end input program.
dataset name test.
variable level group (nominal).
formats group (F1.0).

*lets make our error bars - I'm a regression type of guy - plotted are confidence intervals of the mean.
*you could do this anyway you like though.
vector groupD(3).
loop #i = 1 to 3.
compute groupD(#i) = (#i = group).
end loop.
REGRESSION
  /MISSING LISTWISE
  /NOORIGIN
  /DEPENDENT y
  /METHOD=ENTER groupD1 groupD2 groupD3
  /SAVE PRED (gMeany) MCIN (CI95).
formats gMeany LCI95 UCI95 y (F3.2).
*only keep one mean value within group - so there arent redundant points on the plot.
sort cases by group.
if lag(group) = group gMeany = $SYSMIS.
exe.


*Make error bar chart through GUI - then make scatterplot through GUI - then put them together.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=group UCI95 LCI95 gMeany y MISSING = VARIABLEWISE
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
 SOURCE: s=userSource(id("graphdataset"))
 DATA: group=col(source(s), name("group"), unit.category())
 DATA: UCI95=col(source(s), name("UCI95"))
 DATA: LCI95=col(source(s), name("LCI95"))
 DATA: gMeany=col(source(s), name("gMeany"))
 DATA: y=col(source(s), name("y"))
 GUIDE: axis(dim(1), label("group"))
 GUIDE: axis(dim(2), label("y"))
 SCALE: cat(dim(1))
 SCALE: linear(dim(2))
 ELEMENT: point.jitter(position(group*y), shape(shape.circle))
 ELEMENT: interval(position(region.spread.range(group*(LCI95+UCI95))), shape(shape.ibeam))
 ELEMENT: point(position(group*gMeany), shape(shape.square))
END GPL.


*Alittle bit nicer chart - aesthetics mapped - so get legend - points binned and dodged.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=group UCI95 LCI95 gMeany y MISSING = VARIABLEWISE
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
 SOURCE: s=userSource(id("graphdataset"))
 DATA: group=col(source(s), name("group"), unit.category())
 DATA: UCI95=col(source(s), name("UCI95"))
 DATA: LCI95=col(source(s), name("LCI95"))
 DATA: gMeany=col(source(s), name("gMeany"))
 DATA: y=col(source(s), name("y"))
 GUIDE: axis(dim(1), label("group"))
 GUIDE: axis(dim(2), label("y"), delta(0.25))
 SCALE: cat(dim(1))
 SCALE: linear(dim(2), min(-6))
 SCALE: cat(aesthetic(aesthetic.color), map(("obs",color.grey),("mean",color.black),("error",color.black)))
 SCALE: cat(aesthetic(aesthetic.shape), map(("obs",shape.circle),("mean",shape.square),("error",shape.ibeam)))
 ELEMENT: point.dodge.symmetric(position(bin.rect(group*y, dim(2), binWidth(0.25), binStart(-6))), color.interior("obs"), shape("obs"))
 ELEMENT: interval(position(region.spread.range(group*(LCI95+UCI95))), shape("error"), color("error"))
 ELEMENT: point(position(group*gMeany), shape("mean"), color.interior("mean"))
END GPL.
*I think symmetric binning looks nicer - but in this example you needed such large bins to make it look nice it is probably not worth it over jittering.

*See also for reference.
*Blog post dynamite plots - http://andrewpwheeler.wordpress.com/2012/02/20/avoid-dynamite-plots-visualizing-dot-plots-with-super-imposed-confidence-intervals-in-spss-and-r/
*This nabble post with similar references/examples - http://spssx-discussion.1045642.n5.nabble.com/What-does-this-graph-means-td5717745i20.html#a5717839.
*Binned scatterplots blog post - http://andrewpwheeler.wordpress.com/2013/03/06/some-random-spss-graph-tips-shading-areas-under-curves-and-using-dodging-in-binned-dot-plots/.
***********************************************************.
Andy W
apwheele@gmail.com
http://andrewpwheeler.wordpress.com/
Reply | Threaded
Open this post in threaded view
|

Re: Overlapping graphs

Jon K Peck
I agree that chart types are a slippery slope, but the Chart Builder actually is based on Lee's GoG.  The UI is a compromise between the GoG grammar, which avoids chart types like the plague, and users' desperate need to refer to charts by type.  In GoG, the term dot plot is never defined (unless I missed it somewhere), but there are 8 entries for it in the index (second edition) :-)


Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        Andy W <[hidden email]>
To:        [hidden email],
Date:        04/26/2013 08:43 AM
Subject:        Re: [SPSSX-L] Overlapping graphs
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




eppu,

Unfortunately you can't do it via point-and-click. What I did below was to
start with an error-interval chart, and then add in the necessary elements
to make it a final chart with all the necessary elements. If you need more
help and post some example data I could help adapt it to your needs, but
there isn't much else I can say besides dig into to it and see if you
understand. If you have more specific questions feel free to ask. At the end
of the post I provide an essentially complete example.

re David - You can get the error intervals however you would like, and I
agree there OMS wasn't needed. Below I show how to get confidence intervals
and the mean through regression.

re Jon - Yes, it is good to be clear with terminology. I disagree though the
SPSS's chart dialog is what defines the correct terminology!

1) My use of dot plot is totally consistent with LeLand Wilkinson's work
(see his American Statistician article on dot plots or his Grammer of
Graphics book). I even see  Wikipedia discusses the differences
<
http://en.wikipedia.org/wiki/Dot_plot_(statistics)>  .
2) I imagine when you say dot plot (as opposed to SPSS's chart builder) most
people think of Cleveland type dot plots (e.g.  here
<
http://www.b-eye-network.com/view/2468>  ). I challenge anyone to describe
a Cleveland dot plot as anything other than "a scatterplot with one of the
axes categorical". The dot plots via the chart builder dialog are merely
histograms that use dots instead of bars (which aren't even  Wilkinson dot
plots as he describes in his American Statistician article!).

I agree we should be clear with terminology and the differences within SPSS
lingo, but it is much easier to just speak in terms of elements of the chart
(via the grammer) then just label charts with specific names.

**********************************************************.
*Making fake data.
set seed 10.
input program.
loop #i = 1 to 25.
loop #g = 1 to 4.
compute group = #g.
compute y = RV.NORMAL(#g,2).
end case.
end loop.
end loop.
end file.
end input program.
dataset name test.
variable level group (nominal).
formats group (F1.0).

*lets make our error bars - I'm a regression type of guy - plotted are
confidence intervals of the mean.
*you could do this anyway you like though.
vector groupD(3).
loop #i = 1 to 3.
compute groupD(#i) = (#i = group).
end loop.
REGRESSION
 /MISSING LISTWISE
 /NOORIGIN
 /DEPENDENT y
 /METHOD=ENTER groupD1 groupD2 groupD3
 /SAVE PRED (gMeany) MCIN (CI95).
formats gMeany LCI95 UCI95 y (F3.2).
*only keep one mean value within group - so there arent redundant points on
the plot.
sort cases by group.
if lag(group) = group gMeany = $SYSMIS.
exe.


*Make error bar chart through GUI - then make scatterplot through GUI - then
put them together.
GGRAPH
 /GRAPHDATASET NAME="graphdataset" VARIABLES=group UCI95 LCI95 gMeany y
MISSING = VARIABLEWISE
 /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
SOURCE: s=userSource(id("graphdataset"))
DATA: group=col(source(s), name("group"), unit.category())
DATA: UCI95=col(source(s), name("UCI95"))
DATA: LCI95=col(source(s), name("LCI95"))
DATA: gMeany=col(source(s), name("gMeany"))
DATA: y=col(source(s), name("y"))
GUIDE: axis(dim(1), label("group"))
GUIDE: axis(dim(2), label("y"))
SCALE: cat(dim(1))
SCALE: linear(dim(2))
ELEMENT: point.jitter(position(group*y), shape(shape.circle))
ELEMENT: interval(position(region.spread.range(group*(LCI95+UCI95))),
shape(shape.ibeam))
ELEMENT: point(position(group*gMeany), shape(shape.square))
END GPL.


*Alittle bit nicer chart - aesthetics mapped - so get legend - points binned
and dodged.
GGRAPH
 /GRAPHDATASET NAME="graphdataset" VARIABLES=group UCI95 LCI95 gMeany y
MISSING = VARIABLEWISE
 /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
SOURCE: s=userSource(id("graphdataset"))
DATA: group=col(source(s), name("group"), unit.category())
DATA: UCI95=col(source(s), name("UCI95"))
DATA: LCI95=col(source(s), name("LCI95"))
DATA: gMeany=col(source(s), name("gMeany"))
DATA: y=col(source(s), name("y"))
GUIDE: axis(dim(1), label("group"))
GUIDE: axis(dim(2), label("y"), delta(0.25))
SCALE: cat(dim(1))
SCALE: linear(dim(2), min(-6))
SCALE: cat(aesthetic(aesthetic.color),
map(("obs",color.grey),("mean",color.black),("error",color.black)))
SCALE: cat(aesthetic(aesthetic.shape),
map(("obs",shape.circle),("mean",shape.square),("error",shape.ibeam)))
ELEMENT: point.dodge.symmetric(position(bin.rect(group*y, dim(2),
binWidth(0.25), binStart(-6))), color.interior("obs"), shape("obs"))
ELEMENT: interval(position(region.spread.range(group*(LCI95+UCI95))),
shape("error"), color("error"))
ELEMENT: point(position(group*gMeany), shape("mean"),
color.interior("mean"))
END GPL.
*I think symmetric binning looks nicer - but in this example you needed such
large bins to make it look nice it is probably not worth it over jittering.

*See also for reference.
*Blog post dynamite plots -
http://andrewpwheeler.wordpress.com/2012/02/20/avoid-dynamite-plots-visualizing-dot-plots-with-super-imposed-confidence-intervals-in-spss-and-r/
*This nabble post with similar references/examples -
http://spssx-discussion.1045642.n5.nabble.com/What-does-this-graph-means-td5717745i20.html#a5717839.
*Binned scatterplots blog post -
http://andrewpwheeler.wordpress.com/2013/03/06/some-random-spss-graph-tips-shading-areas-under-curves-and-using-dodging-in-binned-dot-plots/.
***********************************************************.




-----
Andy W
[hidden email]
http://andrewpwheeler.wordpress.com/
--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/Overlapping-graphs-tp5719732p5719752.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


Reply | Threaded
Open this post in threaded view
|

Re: Overlapping graphs

Andy W
To be pedantic, I think *the point* of the GoG is that you don't need to define (give names to) specific individual charts (they are defined by the elements they portray). Hence it isn't meaningful to say Wilkinson did not define "dot plot" in his GoG book. I see he referenced his own article on it at several different points [I gave the copy I read back to the library]. Or you could just go to the article itself and read how he defines them. As I said, my use of dot plot is totally consistent with everything he wrote.

I'm not knocking the chart builder dialog, it is IMO quite good and I use it all the time. Just at a point (like all things point-and-click) it is self-limiting. You can (theoretically) place an error bar on the dot plot, the GUI dialog just gives a misleading frame of reference. The error bar doesn't go the way the points are displaced, they span the other direction (again to be pedantic).

Going with the example previously posted I will propose a new chart, and I will name it "Andy's horrific idea: Making misleading error bar lengths with polar coordinates" (I'm not known for my snazzy titles).

********************************************************.
if lag(group) = group LCI95 = $SYSMIS.
if lag(group) = group UCI95 = $SYSMIS.

GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=group UCI95 LCI95 gMeany y MISSING = VARIABLEWISE
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
 COORD: polar(dim(1,2))
 SOURCE: s=userSource(id("graphdataset"))
 DATA: group=col(source(s), name("group"), unit.category())
 DATA: UCI95=col(source(s), name("UCI95"))
 DATA: LCI95=col(source(s), name("LCI95"))
 DATA: gMeany=col(source(s), name("gMeany"))
 DATA: y=col(source(s), name("y"))
 GUIDE: axis(dim(2), label("group"))
 GUIDE: axis(dim(1), label("y"), delta(0.25))
 SCALE: cat(dim(2))
 SCALE: linear(dim(1), min(-6))
 SCALE: cat(aesthetic(aesthetic.color), map(("obs",color.grey),("mean",color.black),("error",color.black)))
 SCALE: cat(aesthetic(aesthetic.shape), map(("obs",shape.circle),("mean",shape.plus),("error",shape.square)))
 ELEMENT: point.dodge.symmetric(position(bin.rect(y*group, dim(1), binWidth(0.25), binStart(-6))), color.interior("obs"), shape("obs"))
 ELEMENT: edge(position((LCI95+UCI95)*group), shape.interior("error"), color("error"), size(size."10"), transparency(transparency."0.5"))
 ELEMENT: point(position(gMeany*group), shape("mean"), color.interior("mean"))
END GPL.
********************************************************.

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

Re: Overlapping graphs

David Marso
Administrator
"Going with the example previously posted I will propose a new chart, and I will name it "Andy's horrific idea: Making misleading error bar lengths with polar coordinates" (I'm not known for my snazzy titles). "

Can I call it the "Wheeler-Whacky-Dot-PolErrity-Plot"
It's Friday!  I'm always silly on Fridays ;-)
--
Andy W wrote
To be pedantic, I think *the point* of the GoG is that you don't need to define (give names to) specific individual charts (they are defined by the elements they portray). Hence it isn't meaningful to say Wilkinson did not define "dot plot" in his GoG book. I see he referenced his own article on it at several different points [I gave the copy I read back to the library]. Or you could just go to the article itself and read how he defines them. As I said, my use of dot plot is totally consistent with everything he wrote.

I'm not knocking the chart builder dialog, it is IMO quite good and I use it all the time. Just at a point (like all things point-and-click) it is self-limiting. You can (theoretically) place an error bar on the dot plot, the GUI dialog just gives a misleading frame of reference. The error bar doesn't go the way the points are displaced, they span the other direction (again to be pedantic).

Going with the example previously posted I will propose a new chart, and I will name it "Andy's horrific idea: Making misleading error bar lengths with polar coordinates" (I'm not known for my snazzy titles).

********************************************************.
if lag(group) = group LCI95 = $SYSMIS.
if lag(group) = group UCI95 = $SYSMIS.

GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=group UCI95 LCI95 gMeany y MISSING = VARIABLEWISE
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
 COORD: polar(dim(1,2))
 SOURCE: s=userSource(id("graphdataset"))
 DATA: group=col(source(s), name("group"), unit.category())
 DATA: UCI95=col(source(s), name("UCI95"))
 DATA: LCI95=col(source(s), name("LCI95"))
 DATA: gMeany=col(source(s), name("gMeany"))
 DATA: y=col(source(s), name("y"))
 GUIDE: axis(dim(2), label("group"))
 GUIDE: axis(dim(1), label("y"), delta(0.25))
 SCALE: cat(dim(2))
 SCALE: linear(dim(1), min(-6))
 SCALE: cat(aesthetic(aesthetic.color), map(("obs",color.grey),("mean",color.black),("error",color.black)))
 SCALE: cat(aesthetic(aesthetic.shape), map(("obs",shape.circle),("mean",shape.plus),("error",shape.square)))
 ELEMENT: point.dodge.symmetric(position(bin.rect(y*group, dim(1), binWidth(0.25), binStart(-6))), color.interior("obs"), shape("obs"))
 ELEMENT: edge(position((LCI95+UCI95)*group), shape.interior("error"), color("error"), size(size."10"), transparency(transparency."0.5"))
 ELEMENT: point(position(gMeany*group), shape("mean"), color.interior("mean"))
END GPL.
********************************************************.

Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: Overlapping graphs

Andy W
I'm always open to suggestions! I think I like "PolErrity" - it is probably best at the onset I don't attach my name to it for when it actually gets used somewhere and correctly cited (although my name is pretty common - so I could always say it must be another Andy Wheeler)
Andy W
apwheele@gmail.com
http://andrewpwheeler.wordpress.com/
Reply | Threaded
Open this post in threaded view
|

Re: Overlapping graphs

Bruce Weaver
Administrator
In reply to this post by David Marso
It really is astonishing that "I'm always silly on Fridays" has been sitting there for 4 hours with no response.  Okay then...someone has to say it...

.oO(On Fridays?)  



David Marso wrote
"Going with the example previously posted I will propose a new chart, and I will name it "Andy's horrific idea: Making misleading error bar lengths with polar coordinates" (I'm not known for my snazzy titles). "

Can I call it the "Wheeler-Whacky-Dot-PolErrity-Plot"
It's Friday!  I'm always silly on Fridays ;-)
--
Andy W wrote
To be pedantic, I think *the point* of the GoG is that you don't need to define (give names to) specific individual charts (they are defined by the elements they portray). Hence it isn't meaningful to say Wilkinson did not define "dot plot" in his GoG book. I see he referenced his own article on it at several different points [I gave the copy I read back to the library]. Or you could just go to the article itself and read how he defines them. As I said, my use of dot plot is totally consistent with everything he wrote.

I'm not knocking the chart builder dialog, it is IMO quite good and I use it all the time. Just at a point (like all things point-and-click) it is self-limiting. You can (theoretically) place an error bar on the dot plot, the GUI dialog just gives a misleading frame of reference. The error bar doesn't go the way the points are displaced, they span the other direction (again to be pedantic).

Going with the example previously posted I will propose a new chart, and I will name it "Andy's horrific idea: Making misleading error bar lengths with polar coordinates" (I'm not known for my snazzy titles).

********************************************************.
if lag(group) = group LCI95 = $SYSMIS.
if lag(group) = group UCI95 = $SYSMIS.

GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=group UCI95 LCI95 gMeany y MISSING = VARIABLEWISE
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
 COORD: polar(dim(1,2))
 SOURCE: s=userSource(id("graphdataset"))
 DATA: group=col(source(s), name("group"), unit.category())
 DATA: UCI95=col(source(s), name("UCI95"))
 DATA: LCI95=col(source(s), name("LCI95"))
 DATA: gMeany=col(source(s), name("gMeany"))
 DATA: y=col(source(s), name("y"))
 GUIDE: axis(dim(2), label("group"))
 GUIDE: axis(dim(1), label("y"), delta(0.25))
 SCALE: cat(dim(2))
 SCALE: linear(dim(1), min(-6))
 SCALE: cat(aesthetic(aesthetic.color), map(("obs",color.grey),("mean",color.black),("error",color.black)))
 SCALE: cat(aesthetic(aesthetic.shape), map(("obs",shape.circle),("mean",shape.plus),("error",shape.square)))
 ELEMENT: point.dodge.symmetric(position(bin.rect(y*group, dim(1), binWidth(0.25), binStart(-6))), color.interior("obs"), shape("obs"))
 ELEMENT: edge(position((LCI95+UCI95)*group), shape.interior("error"), color("error"), size(size."10"), transparency(transparency."0.5"))
 ELEMENT: point(position(gMeany*group), shape("mean"), color.interior("mean"))
END GPL.
********************************************************.

--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.
Reply | Threaded
Open this post in threaded view
|

Re: Overlapping graphs

David Marso
Administrator
Yeah, keep it up Bruce - You've been strangely silent all day-!!!


Bruce Weaver wrote
It really is astonishing that "I'm always silly on Fridays" has been sitting there for 4 hours with no response.  Okay then...someone has to say it...

.oO(On Fridays?)  



David Marso wrote
"Going with the example previously posted I will propose a new chart, and I will name it "Andy's horrific idea: Making misleading error bar lengths with polar coordinates" (I'm not known for my snazzy titles). "

Can I call it the "Wheeler-Whacky-Dot-PolErrity-Plot"
It's Friday!  I'm always silly on Fridays ;-)
--
Andy W wrote
To be pedantic, I think *the point* of the GoG is that you don't need to define (give names to) specific individual charts (they are defined by the elements they portray). Hence it isn't meaningful to say Wilkinson did not define "dot plot" in his GoG book. I see he referenced his own article on it at several different points [I gave the copy I read back to the library]. Or you could just go to the article itself and read how he defines them. As I said, my use of dot plot is totally consistent with everything he wrote.

I'm not knocking the chart builder dialog, it is IMO quite good and I use it all the time. Just at a point (like all things point-and-click) it is self-limiting. You can (theoretically) place an error bar on the dot plot, the GUI dialog just gives a misleading frame of reference. The error bar doesn't go the way the points are displaced, they span the other direction (again to be pedantic).

Going with the example previously posted I will propose a new chart, and I will name it "Andy's horrific idea: Making misleading error bar lengths with polar coordinates" (I'm not known for my snazzy titles).

********************************************************.
if lag(group) = group LCI95 = $SYSMIS.
if lag(group) = group UCI95 = $SYSMIS.

GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=group UCI95 LCI95 gMeany y MISSING = VARIABLEWISE
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
 COORD: polar(dim(1,2))
 SOURCE: s=userSource(id("graphdataset"))
 DATA: group=col(source(s), name("group"), unit.category())
 DATA: UCI95=col(source(s), name("UCI95"))
 DATA: LCI95=col(source(s), name("LCI95"))
 DATA: gMeany=col(source(s), name("gMeany"))
 DATA: y=col(source(s), name("y"))
 GUIDE: axis(dim(2), label("group"))
 GUIDE: axis(dim(1), label("y"), delta(0.25))
 SCALE: cat(dim(2))
 SCALE: linear(dim(1), min(-6))
 SCALE: cat(aesthetic(aesthetic.color), map(("obs",color.grey),("mean",color.black),("error",color.black)))
 SCALE: cat(aesthetic(aesthetic.shape), map(("obs",shape.circle),("mean",shape.plus),("error",shape.square)))
 ELEMENT: point.dodge.symmetric(position(bin.rect(y*group, dim(1), binWidth(0.25), binStart(-6))), color.interior("obs"), shape("obs"))
 ELEMENT: edge(position((LCI95+UCI95)*group), shape.interior("error"), color("error"), size(size."10"), transparency(transparency."0.5"))
 ELEMENT: point(position(gMeany*group), shape("mean"), color.interior("mean"))
END GPL.
********************************************************.

Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"