Using syntax and or GPL in SPSS 14 for features not retained in a template

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

Using syntax and or GPL in SPSS 14 for features not retained in a template

Art Kendall-2
I am starting to use GPL and could use a little help.  I am using
version 14.

How do I modify the syntax below the sig block
 so that

1) the markers  are 9 point symbols with a border width of 2 in dark gray
 and the symbols for Reading First are Circles, and for Title I are
triangles.

2) Have the title contain only the value label, and not the variable
name ("subset".  It would also be nice if the title could be a little
farther from
the top of the data area.

3) show the linear regression line, and have it be the same width in the
data area and in the key.

4) Have the entries for the key be separated vertically.

I can do the first three of these by editing a graph once it is
produced,  However, I need to have 3 graphs like this for each State in
the US.
These kinds of changes do not "stick".  When I save a template  this
kind of change does not stick

Art Kendall
Social Research Consultants


new file.
input program.
vector x (6,f1).
loop #i = 1 to 50.
compute new_3group =1.
compute y00.read.pct.prof.up =rv.uniform(0,100).
compute y00.Pct.sld =rv.uniform(0,100).
end case.
end loop.
loop #i = 1 to 50.
compute new_3group =2.
compute y00.read.pct.prof.up =rv.uniform(0,100).
compute y00.Pct.sld =rv.uniform(0,100).
end case.
end loop.
end file.
end input program.
execute.
value labels new_3group 1'Reading First' 2 'Title I'.
compute subset = mod($casenum,2) +1.
value labels subset 1'Odd' 2'Even'.
sort cases by subset.
split file by subset.
* Chart Builder.
GGRAPH
 /GRAPHDATASET NAME="graphdataset" VARIABLES=y00.read.pct.prof.up[rename=
  "y00_read_pct_prof_up"] Y00.Pct.SLD[rename="Y00_Pct_SLD"] new_3group
  MISSING=LISTWISE REPORTMISSING=NO
 /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
 SOURCE: s=userSource(id("graphdataset"))
 DATA: y00_read_pct_prof_up=col(source(s), name("y00_read_pct_prof_up"))
 DATA: Y00_Pct_SLD=col(source(s), name("Y00_Pct_SLD"))
 DATA: new_3group=col(source(s), name("new_3group"), unit.category())
 GUIDE: axis(dim(1), label("Reading Proficiency Rate"))
 GUIDE: axis(dim(2), label("LD Participation Rate"))
 GUIDE: legend(aesthetic(aesthetic.color.exterior), label(""))
 SCALE: linear(dim(1), min(0), max(100))
 SCALE: linear(dim(2), min(0))
 SCALE: cat(aesthetic(aesthetic.color.exterior))
 ELEMENT: point(position(y00_read_pct_prof_up*Y00_Pct_SLD),
  color.exterior(new_3group))
END GPL.
Reply | Threaded
Open this post in threaded view
|

Re: Using syntax and or GPL in SPSS 14 for features not retained in a template

Antro, Mark
Hi Art,

This syntax and the template (sent separately) will get you some of the way there....

GGRAPH
 /GRAPHDATASET NAME="graphdataset" VARIABLES=y00.read.pct.prof.up[rename=
  "y00_read_pct_prof_up"] Y00.Pct.SLD[rename="Y00_Pct_SLD"] new_3group
  MISSING=LISTWISE REPORTMISSING=NO
 /GRAPHSPEC SOURCE=INLINE
  TEMPLATE=["C:\Program Files\SPSS14\Looks\kendall.sgt"].
BEGIN GPL
 SOURCE: s=userSource(id("graphdataset"))
 DATA: y00_read_pct_prof_up=col(source(s), name("y00_read_pct_prof_up"))
 DATA: Y00_Pct_SLD=col(source(s), name("Y00_Pct_SLD"))
 DATA: new_3group=col(source(s), name("new_3group"), unit.category())
 GUIDE: text.title(label("Title"))
 GUIDE: axis(dim(1), label("Reading Proficiency Rate"))
 GUIDE: axis(dim(2), label("LD Participation Rate"))
 SCALE: linear(dim(1), min(0), max(100))
 SCALE: linear(dim(2), min(0))
 ELEMENT: line(position(smooth.linear(y00_read_pct_prof_up*Y00_Pct_SLD)))
 ELEMENT: point(position(y00_read_pct_prof_up*Y00_Pct_SLD),color.exterior(color.grey), shape.interior(new_3group))
END GPL.

Just change the path to the template file. Comments below...

1) the markers  are 9 point symbols with a border width of 2 in dark gray  and the symbols for Reading First are Circles, and for Title I are triangles.
Antro> I've used the template to set this up. There is a section for the cycle shapes in the template file, and I've specified that they be circle first, then triangle (polygon with 3 sides in the .sgt file) and for each the size be 9px. The shape function in the GPL then forces SPSS to loop through these shapes for each category.
2) Have the title contain only the value label, and not the variable name ("subset".  It would also be nice if the title could be a little farther from the top of the data area.
Antro> I've added a title in the GPL which is a little further away from the chart. The subset title though comes from the split file and can't be changed. Use select cases and loop through the categories is the only other option I think.
3) show the linear regression line, and have it be the same width in the data area and in the key.
Antro> Added using the GPL line above
4) Have the entries for the key be separated vertically.
Antro> No hope I think!

Rgds,
Antro.
Reply | Threaded
Open this post in threaded view
|

Maximum Difference Scaling (MaxDiff) analysis

Satya Bonala
In reply to this post by Art Kendall-2
Greetings,

I want to use this technique for a small project and have also developed
the q'naire. Can I analyse this data in SPSS 14.0, if yes, I would
appreciate some guidance.

I am told Sawtooth software is the ideal package for this, but my current
project budget does not allow me to buy the software. Is there
any other software in the public domain that will allow me to analyse this
data.

thanks,
Satya



---------------------------------
Do you Yahoo!?
 Everyone is raving about the  all-new Yahoo! Mail.