I'm interested in creating automated [via syntax] graphs.
My Version 14 has 3 graphing syntax "languages" - Ggraph [Chart Builder], Igraph [Interactive Graphs] & Graph [plain graphs]. I don't want to learn all 3 - which one is my best choice in the long run ? Do they work independently of each other or can they be used in combination ? Regards Mark Webb Cape Town |
Hi Mark:
MW> I'm interested in creating automated [via syntax] graphs. My MW> Version 14 has 3 graphing syntax "languages" - Ggraph [Chart MW> Builder], Igraph [Interactive Graphs] & Graph [plain graphs]. MW> I don't want to learn all 3 - which one is my best choice in the long run ? My two cents. Until now (before Ggraphs, I mean), I used mainly "plain graphs", and, for more complicated tasks, some Igraphs. Now I use the three, because I have found that some tasks are better done with one of the three types. Anyway, with SPSS 15 (Ggraphs in this version have undergone further development), I've discovered that almost everything I did with plain graphs (as you call them, SPSS 15 labels them as "legacy graphs") or Igraphs can be done (much better) with Ggraphs. I still keep code that uses Igraphs, but I'm slowly abandoning legacy graphs for my own work, although these last are the only ones I teach: my students are scared enough with syntax to complicate their lives further with Igraphs (besides, computers used for teaching at the University don't have a lot of memory, and plain-legacy graphs are much faster than Igraphs, and, since we use SPSS 13 at the University, Ggraphs are not available). Legacy graphs are very easy to learn (perhaps the fact that I learnt them several versions ago makes me say that), I needed a bit of time with Igraphs, and with Ggraphs, well, I'm still on it, with the help of the book "GPL Reference Guide": http://support.spss.com/Tech/Products/SPSS/Documentation/SPSSforWindows/15.0/GPL%20Reference%20Guide.pdf We could call legacy graphs the quick&dirty approach to graphing: simple to use, but simple (anodine?) results. They are quite limited but very easy to use. You have to tweak them manually and save all the adjustments to a chart template (where, unfortunately, not every modification is saved, some items are lost) and use it to apply the modifications authomatically to future charts. With Ggraphs and Igraphs, almost any adjustment can be done with syntax, leaving very little work (or none, sometimes) for the chart template. I still use the legacy graphs in "scratch work": as temporary graphs that give me an idea of my final goal (after tweaking them a lot manually), then I build the final graph either with Ggraphs or Igraphs, trying to use the syntax as much as I can to avoid the use of a chart template. This is an example that shows the advantage of Ggraphs over legacy graphs (I have used this code before, it is a meta-analytic graph called "forest-plot", I tend to repeat myself a bit): * Sample dataset (processed data)*. DATA LIST LIST/ trial(F4) year(A5) study(A10) measure cilow ciup percwi(4 F8.3). BEGIN DATA 1 "1989" "Hodnett " .502 .262 .962 4.940 2 "1991" "Kennell " .352 .216 .575 8.694 3 "1992" "Bréart-Fr" .785 .483 1.276 8.878 4 "1992" "Bréart-Bg" .811 .653 1.007 44.598 5 "1997" "Gagnon " .867 .573 1.311 12.237 6 "1998" "Langer " .280 .203 .384 20.654 7 " " "Total " .594 .514 .687 100.000 END DATA. * A) Plain graph solution (it lacks an important feature of a good forest-plot: the dot size should reflect the weight of the study in the final result - variable "percwi"): GRAPH /HILO(SIMPLE)=VALUE( ciup cilow measure ) BY study. * Short syntax and very easy to understand *. * Now the manual tweaking: *- Change Y scale to log-scale *- Add a reference dash line at y=1 *- Transpose chart coordinates *- Select black colour for line and dots *- Label category-axis *- Hide legend * Save the looks to a chart template and apply it (some of the features are lost, unfortunately) . GRAPH /HILO(SIMPLE)=VALUE( ciup cilow measure ) BY study /TEMPLATE='Your template file.sgt'. * B) With Ggrahs (first we add some auxilliary variables): SORT CASES BY trial(D). STRING YearAndStudy(A30). COMPUTE YearAndStudy=CONCAT(RTRIM(year)," ",study). COMPUTE RefLine=1. GGRAPH /GRAPHDATASET NAME="graphdataset" VARIABLES=YearAndStudy ciup cilow measure percwi RefLine MISSING=LISTWISE REPORTMISSING=NO /GRAPHSPEC SOURCE=INLINE. BEGIN GPL SOURCE: s=userSource(id("graphdataset")) DATA: YearAndStudy=col(source(s), name("YearAndStudy"), unit.category()) DATA: ciup=col(source(s), name("ciup")) DATA: cilow=col(source(s), name("cilow")) DATA: measure=col(source(s), name("measure")) DATA: percwi=col(source(s), name("percwi")) DATA: RefLine=col(source(s), name("RefLine")) COORD: transpose(rect(dim(1,2), transpose())) GUIDE: axis(dim(2), label(" Favours treatment Favours Control")) SCALE: cat(dim(1)) SCALE: log(dim(2)) ELEMENT: interval(position(region.spread.range(YearAndStudy*(cilow+ciup))), shape(shape.line), color(color.black)) ELEMENT: point(position(YearAndStudy*measure), shape(shape.square), size(percwi), color.interior(color.black)) ELEMENT: line(position(YearAndStudy*RefLine), shape(shape.line)) END GPL. * See the COORD: transpose..., GUIDE: axis..., SCALE: log(.... ELEMENT: line... these elements replace almost all the manual modifications you needed with the legacy graph. * See also the use of: size(percwi), color(color.black) ... * Manual tweaking: hide legend (we can rely on a chart template to run that task and make our task fully authomatic). I couldn't find a way of doing this same graph with an Igraph. Regards, Dr. Marta García-Granero,PhD mailto:[hidden email] Statistician --- "It is unwise to use a statistical procedure whose use one does not understand. SPSS syntax guide cannot supply this knowledge, and it is certainly no substitute for the basic understanding of statistics and statistical thinking that is essential for the wise choice of methods and the correct interpretation of their results". (Adapted from WinPepi manual - I'm sure Joe Abrahmson will not mind) |
A piggyback message onto Marta's reply.
We have just loaded 14. The GPL documentation that Marta referenced is, as I understand it, for 15. Will that documentation work for 14, or have there been incremental changes between 14 and 15 that renders the currently available documentation more or less useless for 14? If so, does the documentation for 14 remain up on the spss site? I'd also like to make a tiny observation. A long time ago spss introduced 'table looks'. One of them is called 'academic' and it looks suspiciously like an APA style table. I never use it. It's simply useless to me. Every table, for a paper or presentation, is custom made. I suspect that the same thing will be true for GPL graphs, maybe even more so because the programming overhead appears to be so high that very, very regular use will be required to become comfortably familiar with the syntax. Gene Maguin |
Use the GPL help that comes with SPSS 14.0 for SPSS 14.0. You'll find it under Base Help Topics. GPL is very rich and it's syntax rules are somewhat different than traditional SPSS syntax.
Start with Chart Builder to paste syntax and proceed from there. Note that Chart Builder has been substantially enhanced in SPSS 15 and will get you much further along towards the desired chart. GPL syntax provides for limited formatting other than colors. You'll still have to rely upon templates and the Chart Editor to build them for custom control of things like fonts, spacing, background colors, etc. ________________________________ From: SPSSX(r) Discussion on behalf of Gene Maguin Sent: Mon 10/9/2006 8:51 AM To: [hidden email] Subject: Re: Grahing syntax language - into the future ? A piggyback message onto Marta's reply. We have just loaded 14. The GPL documentation that Marta referenced is, as I understand it, for 15. Will that documentation work for 14, or have there been incremental changes between 14 and 15 that renders the currently available documentation more or less useless for 14? If so, does the documentation for 14 remain up on the spss site? I'd also like to make a tiny observation. A long time ago spss introduced 'table looks'. One of them is called 'academic' and it looks suspiciously like an APA style table. I never use it. It's simply useless to me. Every table, for a paper or presentation, is custom made. I suspect that the same thing will be true for GPL graphs, maybe even more so because the programming overhead appears to be so high that very, very regular use will be required to become comfortably familiar with the syntax. Gene Maguin |
Free forum by Nabble | Edit this page |