vertical and horizontal error bar

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

vertical and horizontal error bar

muhammad hanif
Dear all,

How to add/put vertical and horizontal error bar
in scatter plot ?

Thanks...

Reply | Threaded
Open this post in threaded view
|

Re: vertical and horizontal error bar

Marta Garcia-Granero
El 13/02/2011 17:56, muhammad hanif wrote:
Dear all,

How to add/put vertical and horizontal error bar
in scatter plot ?

Hi Muhammad Hanif:

You don't give many details, but I think this syntax (provided by Jon Peck time ago and modified later by me) might be a good starting point:

* Sample dataset *.
set locale=english.
DATA LIST FREE/Group Gluc Triglic.
BEGIN DATA
1 5.17 1.51 1 5.25 1.64 1 5.31 1.59 1 4.58 1.52 1 5.56 1.64
1 5.15 1.35 1 5.33 1.68 1 5.29 1.30 1 5.01 1.91 1 5.88 1.30
2 4.92 1.32 2 4.71 1.41 2 4.79 1.24 2 4.04 1.24 2 4.82 1.39
2 4.41 1.32 2 4.89 1.36 2 4.60 1.33 2 4.75 1.20 2 5.33 1.41
2 4.67 1.18 2 4.08 1.37 2 5.19 1.28 2 4.77 1.05 2 4.94 0.99
2 4.65 1.31 2 4.76 1.29 2 5.33 1.20 2 4.70 1.18 2 5.02 1.13
END DATA.
VALUE LABEL Group 1 'Control' 2' Treated'.

* Graph with Colors *.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=MEANSD(Gluc,1)[NAME="MEAN_Gluc"
LOW="MEAN_Gluc_LOW" HIGH="MEAN_Gluc_HIGH"]
    MEANSD(Triglic,1)[NAME="MEAN_Triglic" LOW="MEAN_Triglic_LOW"
HIGH="MEAN_Triglic_HIGH"]
    Group MISSING=LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA: MEAN_Gluc=col(source(s),    name("MEAN_Gluc"))
  DATA: LOW_Gluc=col(source(s),     name("MEAN_Gluc_LOW"))
  DATA: HIGH_Gluc=col(source(s),    name("MEAN_Gluc_HIGH"))
  DATA: MEAN_Triglic=col(source(s), name("MEAN_Triglic"))
  DATA: LOW_Triglic=col(source(s),  name("MEAN_Triglic_LOW"))
  DATA: HIGH_Triglic=col(source(s), name("MEAN_Triglic_HIGH"))
  DATA: Group=col(source(s),        name("Group"), unit.category())
  GUIDE: axis(dim(1), label("Glucose"))
  GUIDE: axis(dim(2), label("Trigliceryde"))
  GUIDE: legend(aesthetic(aesthetic.color.exterior))
  ELEMENT: edge(position(MEAN_Gluc*(LOW_Triglic+HIGH_Triglic)),color.interior(Group))
  ELEMENT: edge(position((LOW_Gluc+HIGH_Gluc)*MEAN_Triglic),color.interior(Group))
  ELEMENT: point(position(MEAN_Gluc*MEAN_Triglic),color.interior(Group),color.exterior(Group))
END GPL.


* Graph with Patterns *.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=MEANSD(Gluc,1)[NAME="MEAN_Gluc"
LOW="MEAN_Gluc_LOW" HIGH="MEAN_Gluc_HIGH"]
    MEANSD(Triglic,1)[NAME="MEAN_Triglic" LOW="MEAN_Triglic_LOW"
HIGH="MEAN_Triglic_HIGH"]
    Group MISSING=LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA: MEAN_Gluc=col(source(s),    name("MEAN_Gluc"))
  DATA: LOW_Gluc=col(source(s),     name("MEAN_Gluc_LOW"))
  DATA: HIGH_Gluc=col(source(s),    name("MEAN_Gluc_HIGH"))
  DATA: MEAN_Triglic=col(source(s), name("MEAN_Triglic"))
  DATA: LOW_Triglic=col(source(s),  name("MEAN_Triglic_LOW"))
  DATA: HIGH_Triglic=col(source(s), name("MEAN_Triglic_HIGH"))
  DATA: Group=col(source(s),        name("Group"), unit.category())
  GUIDE: axis(dim(1), label("Glucose"))
  GUIDE: axis(dim(2), label("Trigliceryde"))
  GUIDE: legend(aesthetic(aesthetic.shape.exterior))
  ELEMENT: point(position(MEAN_Gluc*MEAN_Triglic),shape(Group),color.interior(color.black))
  ELEMENT: edge(position(MEAN_Gluc*(LOW_Triglic+HIGH_Triglic)))
  ELEMENT: edge(position((LOW_Gluc+HIGH_Gluc)*MEAN_Triglic))
END GPL.

If this is not what you want/need, please give more details (explain the problem, give some smple data, describe your goal...)

Best regards,
Marta GG
--
For miscellaneous SPSS related statistical stuff, visit:
http://gjyp.nl/marta/
Reply | Threaded
Open this post in threaded view
|

Automatic reply: vertical and horizontal error bar

Lee, Jason (Customer Insights Group)
I am out of the office the week of Monday February 14th.
 
If you need urgent assistance please contact Barbara Bilodeau.
 
Thank you, Jason
__________________NOTICE_______________ This electronic mail transmission, including any attachments, contains confidential information of Bain & Company, Inc. ("Bain") and/or its clients. It is intended only for the person(s) named, and the information in such e-mail shall only be used by the person(s) named for the purpose intended and for no other purpose. Any use, distribution, copying, or disclosure by any other persons, or by the person(s) named but for purposes other than the intended purpose, is strictly prohibited. If you received this transmission in error, please notify the sender by reply e-mail and then destroy this e-mail. Opinions, conclusions and other information in this message that do not relate to the official business of Bain shall be understood to be neither given nor endorsed by Bain. When addressed to Bain clients, any information contained in this e-mail shall be subject to the terms and conditions in the applicable client contract.