Dear SPSSers
Please help. Want a plot of y variable as function of category, where category has many values, N. SPSS does not show ALL category names if N is 'large'. I have some data sets with N >100 SPSS decides to show every second value if N is large. This happens no matter how wide I make the graph. Here is base syntax GRAPH /HILO(SIMPLE)=VALUE(GexactUCL GexactLCL pgoodQ22) BY HEIshort. HEIshort is category variable with too large N Any help much appreciated. Have read the syntax specification from SPSS, but not found any relevant sub-command best diana ___________ Professor Diana Kornbrot Work University of Hertfordshire College Lane, Hatfield, Hertfordshire AL10 9AB, UK +44 (0) 170 728 4626 skype: kornbrotme Home 19 Elmhurst Avenue London N2 0LT, UK +44 (0) 208 444 2081 |
if I understand your
post. Something like this untested. the idea is to change the
increment in the properties of an axis via the chart editor.
open the .spv file click on the graph. edit it click on the the Y icon depending correct the values for high, low and increment. Is HEIShort set to be nominal level. variable level HEIshort (nominal). Art Kendall Social Research ConsultantsOn 4/22/2014 6:52 AM, Kornbrot, Diana [via SPSSX Discussion] wrote: Dear SPSSers
Art Kendall
Social Research Consultants |
In reply to this post by Kornbrot, Diana
When using GGRAPH charts you can make the relevant axis longer until all of the groups can fit in the space provided using the PAGE statement. Here is a caterpillar plot example with 100 groups.
**************************************************************************. SET SEED 5. INPUT PROGRAM. LOOP #G = 1 TO 100. COMPUTE #M = RV.NORMAL(50,15). COMPUTE #V = (#M - 50)**2. COMPUTE #Obs = TRUNC(RV.UNIFORM(5,31)). LOOP #Id = 1 TO #Obs. COMPUTE G = #G. COMPUTE Val = RV.NORMAL(#M,#V). END CASE. END LOOP. END LOOP. END FILE. END INPUT PROGRAM. DATASET NAME ManyLines. STRING GroupName (A10). COMPUTE GroupName = CONCAT("Group",STRING(G,N3.0)). FORMATS Val (F4.0). EXECUTE. *Default Line Graph. GRAPH /ERRORBAR(CI 95)=Val BY GroupName. *Nicer graph with GGRAPH. GGRAPH /GRAPHDATASET NAME="graphdataset" VARIABLES=GroupName MEANCI(Val, 95)[name="MEAN_Val" LOW="MEAN_Val_LOW" HIGH="MEAN_Val_HIGH"] /GRAPHSPEC SOURCE=INLINE. BEGIN GPL PAGE: begin(scale(500px,1500px)) SOURCE: s=userSource(id("graphdataset")) DATA: GroupName=col(source(s), name("GroupName"), unit.category()) DATA: MEAN_Val=col(source(s), name("MEAN_Val")) DATA: LOW=col(source(s), name("MEAN_Val_LOW")) DATA: HIGH=col(source(s), name("MEAN_Val_HIGH")) COORD: rect(dim(1,2), transpose()) GUIDE: axis(dim(1)) GUIDE: axis(dim(2), label("Mean Val & 95% CI")) SCALE: cat(dim(1), sort.statistic(summary.mean(MEAN_Val)), reverse()) ELEMENT: point(position(GroupName*MEAN_Val), size(size."2"), color.interior(color.black)) ELEMENT: edge(position(region.spread.range(GroupName*(LOW+HIGH))), shape.interior(shape.line)) PAGE: end() END GPL. **************************************************************************. |
Free forum by Nabble | Edit this page |