I lost a code for a bivariate centroid plot :(

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

I lost a code for a bivariate centroid plot :(

Marta Garcia-Granero
Hi everybody:

I'm utterly frustrated: I have lost a piece of code (I think it was by
Viann Beadle or perhaps Jon Peck) . Some months ago, trying to help
someone I finally got my computer infected with a darn Bagle virus. The
cleaning process was like a tidal wave (reformatting hard drive and
installing everything back), and some files were forgotten behind or
unrecoverable: old mail and some syntax files I had left in a temporary
folder. As a result, I am missing a piece of syntax to plot a bivariate
centroid plot. I hadn't realized until today (because I need it, of
course). I have tried to fiddle with GPL syntax, but I have been
defeated (I'm really not good at graphs). I have also been searching the
archives, but, I can't remember how I asked the question (I tried to
search by: centroid, bivariate plot (or graph), error bars... without
any success). Perhaps the message subject was strange, or the name
centroid wasn't mentioned at all... I remember I also  got an Excel
solution (which also, alas!, lost).

Sorry I have to ask again

* This is the dataset *
DATA LIST LIST/group (F8) gluc trigl (2 F8.2).
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.

* This is the goal: a centroid (meanx/meany) plot with SD as error bars *.

Trigl
|
|
|                   -
|                   |
|       -           |
|       |       |---*---|
|       |           |
|  |----o----|      |
|       |           -
|       |
|       -
|
------------------------------ Gluc
o: group 1
*: group 2

Mad at myself,
Marta

--
For miscellaneous SPSS related statistical stuff, visit:
http://gjyp.nl/marta/

=====================
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: I lost a code for a bivariate centroid plot :(

vlad simion
Hi Marta,

the post was named "Bidimensional HILO graph with Spss" and the
solution was Jon's.

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'.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=MEANSD(Gluc)[NAME="MEAN_Gluc"
LOW="MEAN_Gluc_LOW" HIGH="MEAN_Gluc_HIGH"]
    MEANSD(Triglic)[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 levels"))
  GUIDE: axis(dim(2), label("Triglic"))
  GUIDE: legend(aesthetic(aesthetic.color.exterior))
  ELEMENT: point(position(MEAN_Gluc*MEAN_Triglic), color.exterior(Group))
  ELEMENT: edge(position(MEAN_Gluc*(LOW_Triglic+HIGH_Triglic)),color.interior(Group))
  ELEMENT: edge(position((LOW_Gluc+HIGH_Gluc)*MEAN_Triglic),color.interior(Group))
END GPL.

Many thanks for the wonderful solutions that you alongside with Jon
and Richard and many others provide us.
All the best,
Vlad


2009/5/7 Marta GarcĂ­a-Granero <[hidden email]>

>
> Hi everybody:
>
> I'm utterly frustrated: I have lost a piece of code (I think it was by
> Viann Beadle or perhaps Jon Peck) . Some months ago, trying to help
> someone I finally got my computer infected with a darn Bagle virus. The
> cleaning process was like a tidal wave (reformatting hard drive and
> installing everything back), and some files were forgotten behind or
> unrecoverable: old mail and some syntax files I had left in a temporary
> folder. As a result, I am missing a piece of syntax to plot a bivariate
> centroid plot. I hadn't realized until today (because I need it, of
> course). I have tried to fiddle with GPL syntax, but I have been
> defeated (I'm really not good at graphs). I have also been searching the
> archives, but, I can't remember how I asked the question (I tried to
> search by: centroid, bivariate plot (or graph), error bars... without
> any success). Perhaps the message subject was strange, or the name
> centroid wasn't mentioned at all... I remember I also  got an Excel
> solution (which also, alas!, lost).
>
> Sorry I have to ask again
>
> * This is the dataset *
> DATA LIST LIST/group (F8) gluc trigl (2 F8.2).
> 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.
>
> * This is the goal: a centroid (meanx/meany) plot with SD as error bars *.
>
> Trigl
> |
> |
> |                   -
> |                   |
> |       -           |
> |       |       |---*---|
> |       |           |
> |  |----o----|      |
> |       |           -
> |       |
> |       -
> |
> ------------------------------ Gluc
> o: group 1
> *: group 2
>
> Mad at myself,
> Marta
>
> --
> For miscellaneous SPSS related statistical stuff, visit:
> http://gjyp.nl/marta/
>
> =====================
> 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