GGRAPH/GPL correct labelling

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

GGRAPH/GPL correct labelling

Luca Meyer-3
Hi,

I am running the following syntax to get a simple bar chart with an "All" category and labels:

DATASET CLOSE ALL.
NEW FILE.
GET FILE "/Applications/SPSSInc/PASWStatistics18/Samples/English/Employee data.sav".
FREQ jobcat.
/* i manually update the following line of syntax as well as the "All (n=XXX)" part of the ELEMENT line in the GPL */
VAL LABEL jobcat 1 "Clerical (n=363)" 2 "Custodial (n=27)" 3 "Manager (n=84)".
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=jobcat MEAN(salary)[name="MEAN_salary"]
    MISSING=LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA: jobcat=col(source(s), name("jobcat"), unit.category())
  DATA: MEAN_salary=col(source(s), name("MEAN_salary"))
  GUIDE: axis(dim(1), label("Employment Category"))
  GUIDE: axis(dim(2), label("Mean Current Salary"))
  SCALE: linear(dim(2), include(0))
  ELEMENT: interval(position((jobcat+"All (n=474)")*MEAN_salary), shape.interior(shape.square), color(color.green),
        label(summary.mean(MEAN_salary)))
END GPL.

The result i get is here:

I have got 2 questions for the graphic experts on the list:

(1) How can I show the average value for the "All" bar instead of the 3 labels (one for each category)?
(2) How can I automatically have the sample size for each category be added to the category label - that is, remove the manual update I am currently doing?

Thanks,
Luca


Luca Meyer
www.lucameyer.com
PASW Statistics v. 18.0.1 (13-nov-2009)
Mac OS X 10.6.2 (10C540) - kernel Darwin 10.2.0

=====================
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: GGRAPH/GPL correct labelling - LINK TO OUTPUT

Luca Meyer-3
Sorry in my previous email I have forgotten to add the link to the output: http://www.lucameyer.com/20100323_1215.pdf
Cheers,
Luca

Il giorno 23/mar/2010, alle ore 12.22, Luca Meyer ha scritto:

> Hi,
>
> I am running the following syntax to get a simple bar chart with an "All" category and labels:
>
> DATASET CLOSE ALL.
> NEW FILE.
> GET FILE "/Applications/SPSSInc/PASWStatistics18/Samples/English/Employee data.sav".
> FREQ jobcat.
> /* i manually update the following line of syntax as well as the "All (n=XXX)" part of the ELEMENT line in the GPL */
> VAL LABEL jobcat 1 "Clerical (n=363)" 2 "Custodial (n=27)" 3 "Manager (n=84)".
> GGRAPH
>  /GRAPHDATASET NAME="graphdataset" VARIABLES=jobcat MEAN(salary)[name="MEAN_salary"]
>    MISSING=LISTWISE REPORTMISSING=NO
>  /GRAPHSPEC SOURCE=INLINE.
> BEGIN GPL
>  SOURCE: s=userSource(id("graphdataset"))
>  DATA: jobcat=col(source(s), name("jobcat"), unit.category())
>  DATA: MEAN_salary=col(source(s), name("MEAN_salary"))
>  GUIDE: axis(dim(1), label("Employment Category"))
>  GUIDE: axis(dim(2), label("Mean Current Salary"))
>  SCALE: linear(dim(2), include(0))
>  ELEMENT: interval(position((jobcat+"All (n=474)")*MEAN_salary), shape.interior(shape.square), color(color.green),
>       label(summary.mean(MEAN_salary)))
> END GPL.
>
> The result i get is here:
>
> I have got 2 questions for the graphic experts on the list:
>
> (1) How can I show the average value for the "All" bar instead of the 3 labels (one for each category)?
> (2) How can I automatically have the sample size for each category be added to the category label - that is, remove the manual update I am currently doing?
>
> Thanks,
> Luca
>
>
> Luca Meyer
> www.lucameyer.com
> PASW Statistics v. 18.0.1 (13-nov-2009)
> Mac OS X 10.6.2 (10C540) - kernel Darwin 10.2.0
>
>
>
>
>

=====================
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: GGRAPH/GPL correct labelling - LINK TO OUTPUT

ViAnn Beadle
I have no quick answer for your second query but to get the computed label
in the bar you'll have to do the data aggregation within the GPL itself
using the summary.mean function:

GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=jobcat salary
    MISSING=LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA: jobcat=col(source(s), name("jobcat"), unit.category())
  DATA: salary=col(source(s), name("salary"))
  GUIDE: axis(dim(1), label("Employment Category"))
  GUIDE: axis(dim(2), label("Mean Current Salary"))
  SCALE: cat(dim(1), include("1", "2", "3"))
  SCALE: linear(dim(2), include(0))
  ELEMENT: interval(position(summary.mean((jobcat+"All")*salary)),
shape.interior(shape.square),
label(summary.mean(salary)))
END GPL.

I personally would use the label function to provide the n's within the bars
(via the summary.count function) and just let the chart's y axis graphically
show the mean. That is, afterall, the purpose of labeling the y-axis.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Luca Meyer
Sent: Tuesday, March 23, 2010 5:39 AM
To: [hidden email]
Subject: Re: GGRAPH/GPL correct labelling - LINK TO OUTPUT

Sorry in my previous email I have forgotten to add the link to the output:
http://www.lucameyer.com/20100323_1215.pdf
Cheers,
Luca

Il giorno 23/mar/2010, alle ore 12.22, Luca Meyer ha scritto:

> Hi,
>
> I am running the following syntax to get a simple bar chart with an "All"
category and labels:
>
> DATASET CLOSE ALL.
> NEW FILE.
> GET FILE "/Applications/SPSSInc/PASWStatistics18/Samples/English/Employee
data.sav".
> FREQ jobcat.
> /* i manually update the following line of syntax as well as the "All
> (n=XXX)" part of the ELEMENT line in the GPL */ VAL LABEL jobcat 1
"Clerical (n=363)" 2 "Custodial (n=27)" 3 "Manager (n=84)".
> GGRAPH
>  /GRAPHDATASET NAME="graphdataset" VARIABLES=jobcat
MEAN(salary)[name="MEAN_salary"]

>    MISSING=LISTWISE REPORTMISSING=NO
>  /GRAPHSPEC SOURCE=INLINE.
> BEGIN GPL
>  SOURCE: s=userSource(id("graphdataset"))
>  DATA: jobcat=col(source(s), name("jobcat"), unit.category())
>  DATA: MEAN_salary=col(source(s), name("MEAN_salary"))
>  GUIDE: axis(dim(1), label("Employment Category"))
>  GUIDE: axis(dim(2), label("Mean Current Salary"))
>  SCALE: linear(dim(2), include(0))
>  ELEMENT: interval(position((jobcat+"All (n=474)")*MEAN_salary),
shape.interior(shape.square), color(color.green),
>       label(summary.mean(MEAN_salary))) END GPL.
>
> The result i get is here:
>
> I have got 2 questions for the graphic experts on the list:
>
> (1) How can I show the average value for the "All" bar instead of the 3
labels (one for each category)?
> (2) How can I automatically have the sample size for each category be
added to the category label - that is, remove the manual update I am
currently doing?

>
> Thanks,
> Luca
>
>
> Luca Meyer
> www.lucameyer.com
> PASW Statistics v. 18.0.1 (13-nov-2009) Mac OS X 10.6.2 (10C540) -
> kernel Darwin 10.2.0
>
>
>
>
>

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: GGRAPH/GPL correct labelling - LINK TO OUTPUT

Luca Meyer-3
Thanks ViAnn,

It works just fine and I have actually given both mean value and count within the same labels. BTW, do you know how to create a one-line label for GPL Graphic Element of the sort "n=84" because so far I could only get multiple line labels .

Luca

Il giorno 23/mar/2010, alle ore 22.45, ViAnn Beadle ha scritto:

> I have no quick answer for your second query but to get the computed label
> in the bar you'll have to do the data aggregation within the GPL itself
> using the summary.mean function:
>
> GGRAPH
>  /GRAPHDATASET NAME="graphdataset" VARIABLES=jobcat salary
>    MISSING=LISTWISE REPORTMISSING=NO
>  /GRAPHSPEC SOURCE=INLINE.
> BEGIN GPL
>  SOURCE: s=userSource(id("graphdataset"))
>  DATA: jobcat=col(source(s), name("jobcat"), unit.category())
>  DATA: salary=col(source(s), name("salary"))
>  GUIDE: axis(dim(1), label("Employment Category"))
>  GUIDE: axis(dim(2), label("Mean Current Salary"))
>  SCALE: cat(dim(1), include("1", "2", "3"))
>  SCALE: linear(dim(2), include(0))
>  ELEMENT: interval(position(summary.mean((jobcat+"All")*salary)),
> shape.interior(shape.square),
> label(summary.mean(salary)))
> END GPL.
>
> I personally would use the label function to provide the n's within the bars
> (via the summary.count function) and just let the chart's y axis graphically
> show the mean. That is, afterall, the purpose of labeling the y-axis.
>
> -----Original Message-----
> From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
> Luca Meyer
> Sent: Tuesday, March 23, 2010 5:39 AM
> To: [hidden email]
> Subject: Re: GGRAPH/GPL correct labelling - LINK TO OUTPUT
>
> Sorry in my previous email I have forgotten to add the link to the output:
> http://www.lucameyer.com/20100323_1215.pdf
> Cheers,
> Luca
>
> Il giorno 23/mar/2010, alle ore 12.22, Luca Meyer ha scritto:
>
>> Hi,
>>
>> I am running the following syntax to get a simple bar chart with an "All"
> category and labels:
>>
>> DATASET CLOSE ALL.
>> NEW FILE.
>> GET FILE "/Applications/SPSSInc/PASWStatistics18/Samples/English/Employee
> data.sav".
>> FREQ jobcat.
>> /* i manually update the following line of syntax as well as the "All
>> (n=XXX)" part of the ELEMENT line in the GPL */ VAL LABEL jobcat 1
> "Clerical (n=363)" 2 "Custodial (n=27)" 3 "Manager (n=84)".
>> GGRAPH
>> /GRAPHDATASET NAME="graphdataset" VARIABLES=jobcat
> MEAN(salary)[name="MEAN_salary"]
>>   MISSING=LISTWISE REPORTMISSING=NO
>> /GRAPHSPEC SOURCE=INLINE.
>> BEGIN GPL
>> SOURCE: s=userSource(id("graphdataset"))
>> DATA: jobcat=col(source(s), name("jobcat"), unit.category())
>> DATA: MEAN_salary=col(source(s), name("MEAN_salary"))
>> GUIDE: axis(dim(1), label("Employment Category"))
>> GUIDE: axis(dim(2), label("Mean Current Salary"))
>> SCALE: linear(dim(2), include(0))
>> ELEMENT: interval(position((jobcat+"All (n=474)")*MEAN_salary),
> shape.interior(shape.square), color(color.green),
>>      label(summary.mean(MEAN_salary))) END GPL.
>>
>> The result i get is here:
>>
>> I have got 2 questions for the graphic experts on the list:
>>
>> (1) How can I show the average value for the "All" bar instead of the 3
> labels (one for each category)?
>> (2) How can I automatically have the sample size for each category be
> added to the category label - that is, remove the manual update I am
> currently doing?
>>
>> Thanks,
>> Luca
>>
>>
>> Luca Meyer
>> www.lucameyer.com
>> PASW Statistics v. 18.0.1 (13-nov-2009) Mac OS X 10.6.2 (10C540) -
>> kernel Darwin 10.2.0
>>
>>
>>
>>
>>
>
> =====================
> 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
Reply | Threaded
Open this post in threaded view
|

Re: GGRAPH/GPL correct labelling - LINK TO OUTPUT

ViAnn Beadle
You can add a prefix or suffix to labels via a chart template. Not sure
whether it applies to both your mean and count label--try it out.

-----Original Message-----
From: Luca Meyer [mailto:[hidden email]]
Sent: Wednesday, March 24, 2010 1:31 PM
To: ViAnn Beadle
Cc: SPSSX-L
Subject: Re: GGRAPH/GPL correct labelling - LINK TO OUTPUT

Thanks ViAnn,

It works just fine and I have actually given both mean value and count
within the same labels. BTW, do you know how to create a one-line label for
GPL Graphic Element of the sort "n=84" because so far I could only get
multiple line labels .

Luca

Il giorno 23/mar/2010, alle ore 22.45, ViAnn Beadle ha scritto:

> I have no quick answer for your second query but to get the computed
> label in the bar you'll have to do the data aggregation within the GPL
> itself using the summary.mean function:
>
> GGRAPH
>  /GRAPHDATASET NAME="graphdataset" VARIABLES=jobcat salary
>    MISSING=LISTWISE REPORTMISSING=NO
>  /GRAPHSPEC SOURCE=INLINE.
> BEGIN GPL
>  SOURCE: s=userSource(id("graphdataset"))
>  DATA: jobcat=col(source(s), name("jobcat"), unit.category())
>  DATA: salary=col(source(s), name("salary"))
>  GUIDE: axis(dim(1), label("Employment Category"))
>  GUIDE: axis(dim(2), label("Mean Current Salary"))
>  SCALE: cat(dim(1), include("1", "2", "3"))
>  SCALE: linear(dim(2), include(0))
>  ELEMENT: interval(position(summary.mean((jobcat+"All")*salary)),
> shape.interior(shape.square),
> label(summary.mean(salary)))
> END GPL.
>
> I personally would use the label function to provide the n's within
> the bars (via the summary.count function) and just let the chart's y
> axis graphically show the mean. That is, afterall, the purpose of labeling
the y-axis.

>
> -----Original Message-----
> From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf
> Of Luca Meyer
> Sent: Tuesday, March 23, 2010 5:39 AM
> To: [hidden email]
> Subject: Re: GGRAPH/GPL correct labelling - LINK TO OUTPUT
>
> Sorry in my previous email I have forgotten to add the link to the output:
> http://www.lucameyer.com/20100323_1215.pdf
> Cheers,
> Luca
>
> Il giorno 23/mar/2010, alle ore 12.22, Luca Meyer ha scritto:
>
>> Hi,
>>
>> I am running the following syntax to get a simple bar chart with an "All"
> category and labels:
>>
>> DATASET CLOSE ALL.
>> NEW FILE.
>> GET FILE
>> "/Applications/SPSSInc/PASWStatistics18/Samples/English/Employee
> data.sav".
>> FREQ jobcat.
>> /* i manually update the following line of syntax as well as the "All
>> (n=XXX)" part of the ELEMENT line in the GPL */ VAL LABEL jobcat 1
> "Clerical (n=363)" 2 "Custodial (n=27)" 3 "Manager (n=84)".
>> GGRAPH
>> /GRAPHDATASET NAME="graphdataset" VARIABLES=jobcat
> MEAN(salary)[name="MEAN_salary"]
>>   MISSING=LISTWISE REPORTMISSING=NO
>> /GRAPHSPEC SOURCE=INLINE.
>> BEGIN GPL
>> SOURCE: s=userSource(id("graphdataset"))
>> DATA: jobcat=col(source(s), name("jobcat"), unit.category())
>> DATA: MEAN_salary=col(source(s), name("MEAN_salary"))
>> GUIDE: axis(dim(1), label("Employment Category"))
>> GUIDE: axis(dim(2), label("Mean Current Salary"))
>> SCALE: linear(dim(2), include(0))
>> ELEMENT: interval(position((jobcat+"All (n=474)")*MEAN_salary),
> shape.interior(shape.square), color(color.green),
>>      label(summary.mean(MEAN_salary))) END GPL.
>>
>> The result i get is here:
>>
>> I have got 2 questions for the graphic experts on the list:
>>
>> (1) How can I show the average value for the "All" bar instead of the
>> 3
> labels (one for each category)?
>> (2) How can I automatically have the sample size for each category be
> added to the category label - that is, remove the manual update I am
> currently doing?
>>
>> Thanks,
>> Luca
>>
>>
>> Luca Meyer
>> www.lucameyer.com
>> PASW Statistics v. 18.0.1 (13-nov-2009) Mac OS X 10.6.2 (10C540) -
>> kernel Darwin 10.2.0
>>
>>
>>
>>
>>
>
> =====================
> 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
Reply | Threaded
Open this post in threaded view
|

Re: GGRAPH/GPL correct labelling - LINK TO OUTPUT

Luca Meyer-3
I am yet confident with chart template, where can I get a tutorial on how work on GPL chart templates - I suppose modifying the xml?
Thanks,
Luca

Il giorno 24/mar/2010, alle ore 20.42, ViAnn Beadle ha scritto:

> You can add a prefix or suffix to labels via a chart template. Not sure
> whether it applies to both your mean and count label--try it out.
>
> -----Original Message-----
> From: Luca Meyer [mailto:[hidden email]]
> Sent: Wednesday, March 24, 2010 1:31 PM
> To: ViAnn Beadle
> Cc: SPSSX-L
> Subject: Re: GGRAPH/GPL correct labelling - LINK TO OUTPUT
>
> Thanks ViAnn,
>
> It works just fine and I have actually given both mean value and count
> within the same labels. BTW, do you know how to create a one-line label for
> GPL Graphic Element of the sort "n=84" because so far I could only get
> multiple line labels .
>
> Luca
>
> Il giorno 23/mar/2010, alle ore 22.45, ViAnn Beadle ha scritto:
>
>> I have no quick answer for your second query but to get the computed
>> label in the bar you'll have to do the data aggregation within the GPL
>> itself using the summary.mean function:
>>
>> GGRAPH
>> /GRAPHDATASET NAME="graphdataset" VARIABLES=jobcat salary
>>   MISSING=LISTWISE REPORTMISSING=NO
>> /GRAPHSPEC SOURCE=INLINE.
>> BEGIN GPL
>> SOURCE: s=userSource(id("graphdataset"))
>> DATA: jobcat=col(source(s), name("jobcat"), unit.category())
>> DATA: salary=col(source(s), name("salary"))
>> GUIDE: axis(dim(1), label("Employment Category"))
>> GUIDE: axis(dim(2), label("Mean Current Salary"))
>> SCALE: cat(dim(1), include("1", "2", "3"))
>> SCALE: linear(dim(2), include(0))
>> ELEMENT: interval(position(summary.mean((jobcat+"All")*salary)),
>> shape.interior(shape.square),
>> label(summary.mean(salary)))
>> END GPL.
>>
>> I personally would use the label function to provide the n's within
>> the bars (via the summary.count function) and just let the chart's y
>> axis graphically show the mean. That is, afterall, the purpose of labeling
> the y-axis.
>>
>> -----Original Message-----
>> From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf
>> Of Luca Meyer
>> Sent: Tuesday, March 23, 2010 5:39 AM
>> To: [hidden email]
>> Subject: Re: GGRAPH/GPL correct labelling - LINK TO OUTPUT
>>
>> Sorry in my previous email I have forgotten to add the link to the output:
>> http://www.lucameyer.com/20100323_1215.pdf
>> Cheers,
>> Luca
>>
>> Il giorno 23/mar/2010, alle ore 12.22, Luca Meyer ha scritto:
>>
>>> Hi,
>>>
>>> I am running the following syntax to get a simple bar chart with an "All"
>> category and labels:
>>>
>>> DATASET CLOSE ALL.
>>> NEW FILE.
>>> GET FILE
>>> "/Applications/SPSSInc/PASWStatistics18/Samples/English/Employee
>> data.sav".
>>> FREQ jobcat.
>>> /* i manually update the following line of syntax as well as the "All
>>> (n=XXX)" part of the ELEMENT line in the GPL */ VAL LABEL jobcat 1
>> "Clerical (n=363)" 2 "Custodial (n=27)" 3 "Manager (n=84)".
>>> GGRAPH
>>> /GRAPHDATASET NAME="graphdataset" VARIABLES=jobcat
>> MEAN(salary)[name="MEAN_salary"]
>>>  MISSING=LISTWISE REPORTMISSING=NO
>>> /GRAPHSPEC SOURCE=INLINE.
>>> BEGIN GPL
>>> SOURCE: s=userSource(id("graphdataset"))
>>> DATA: jobcat=col(source(s), name("jobcat"), unit.category())
>>> DATA: MEAN_salary=col(source(s), name("MEAN_salary"))
>>> GUIDE: axis(dim(1), label("Employment Category"))
>>> GUIDE: axis(dim(2), label("Mean Current Salary"))
>>> SCALE: linear(dim(2), include(0))
>>> ELEMENT: interval(position((jobcat+"All (n=474)")*MEAN_salary),
>> shape.interior(shape.square), color(color.green),
>>>     label(summary.mean(MEAN_salary))) END GPL.
>>>
>>> The result i get is here:
>>>
>>> I have got 2 questions for the graphic experts on the list:
>>>
>>> (1) How can I show the average value for the "All" bar instead of the
>>> 3
>> labels (one for each category)?
>>> (2) How can I automatically have the sample size for each category be
>> added to the category label - that is, remove the manual update I am
>> currently doing?
>>>
>>> Thanks,
>>> Luca
>>>
>>>
>>> Luca Meyer
>>> www.lucameyer.com
>>> PASW Statistics v. 18.0.1 (13-nov-2009) Mac OS X 10.6.2 (10C540) -
>>> kernel Darwin 10.2.0
>>>
>>>
>>>
>>>
>>>
>>
>> =====================
>> 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
Reply | Threaded
Open this post in threaded view
|

Re: GGRAPH/GPL correct labelling - LINK TO OUTPUT

ViAnn Beadle
Edit your chart in the chart editor and then save the template. To test it
create your chart with GPL, open it in the editor and then apply the
template to it. When you save the chart template be sure to only check off
the items you modified (in your case, data value labels). If that works,
then specify the template name on the GGRAPH command.

-----Original Message-----
From: Luca Meyer [mailto:[hidden email]]
Sent: Friday, March 26, 2010 4:05 AM
To: ViAnn Beadle
Cc: SPSSX-L
Subject: Re: GGRAPH/GPL correct labelling - LINK TO OUTPUT

I am yet confident with chart template, where can I get a tutorial on how
work on GPL chart templates - I suppose modifying the xml?
Thanks,
Luca

Il giorno 24/mar/2010, alle ore 20.42, ViAnn Beadle ha scritto:

> You can add a prefix or suffix to labels via a chart template. Not
> sure whether it applies to both your mean and count label--try it out.
>
> -----Original Message-----
> From: Luca Meyer [mailto:[hidden email]]
> Sent: Wednesday, March 24, 2010 1:31 PM
> To: ViAnn Beadle
> Cc: SPSSX-L
> Subject: Re: GGRAPH/GPL correct labelling - LINK TO OUTPUT
>
> Thanks ViAnn,
>
> It works just fine and I have actually given both mean value and count
> within the same labels. BTW, do you know how to create a one-line
> label for GPL Graphic Element of the sort "n=84" because so far I
> could only get multiple line labels .
>
> Luca
>
> Il giorno 23/mar/2010, alle ore 22.45, ViAnn Beadle ha scritto:
>
>> I have no quick answer for your second query but to get the computed
>> label in the bar you'll have to do the data aggregation within the
>> GPL itself using the summary.mean function:
>>
>> GGRAPH
>> /GRAPHDATASET NAME="graphdataset" VARIABLES=jobcat salary
>>   MISSING=LISTWISE REPORTMISSING=NO
>> /GRAPHSPEC SOURCE=INLINE.
>> BEGIN GPL
>> SOURCE: s=userSource(id("graphdataset"))
>> DATA: jobcat=col(source(s), name("jobcat"), unit.category())
>> DATA: salary=col(source(s), name("salary"))
>> GUIDE: axis(dim(1), label("Employment Category"))
>> GUIDE: axis(dim(2), label("Mean Current Salary"))
>> SCALE: cat(dim(1), include("1", "2", "3"))
>> SCALE: linear(dim(2), include(0))
>> ELEMENT: interval(position(summary.mean((jobcat+"All")*salary)),
>> shape.interior(shape.square),
>> label(summary.mean(salary)))
>> END GPL.
>>
>> I personally would use the label function to provide the n's within
>> the bars (via the summary.count function) and just let the chart's y
>> axis graphically show the mean. That is, afterall, the purpose of
>> labeling
> the y-axis.
>>
>> -----Original Message-----
>> From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf
>> Of Luca Meyer
>> Sent: Tuesday, March 23, 2010 5:39 AM
>> To: [hidden email]
>> Subject: Re: GGRAPH/GPL correct labelling - LINK TO OUTPUT
>>
>> Sorry in my previous email I have forgotten to add the link to the
output:
>> http://www.lucameyer.com/20100323_1215.pdf
>> Cheers,
>> Luca
>>
>> Il giorno 23/mar/2010, alle ore 12.22, Luca Meyer ha scritto:
>>
>>> Hi,
>>>
>>> I am running the following syntax to get a simple bar chart with an
"All"

>> category and labels:
>>>
>>> DATASET CLOSE ALL.
>>> NEW FILE.
>>> GET FILE
>>> "/Applications/SPSSInc/PASWStatistics18/Samples/English/Employee
>> data.sav".
>>> FREQ jobcat.
>>> /* i manually update the following line of syntax as well as the
>>> "All (n=XXX)" part of the ELEMENT line in the GPL */ VAL LABEL
>>> jobcat 1
>> "Clerical (n=363)" 2 "Custodial (n=27)" 3 "Manager (n=84)".
>>> GGRAPH
>>> /GRAPHDATASET NAME="graphdataset" VARIABLES=jobcat
>> MEAN(salary)[name="MEAN_salary"]
>>>  MISSING=LISTWISE REPORTMISSING=NO
>>> /GRAPHSPEC SOURCE=INLINE.
>>> BEGIN GPL
>>> SOURCE: s=userSource(id("graphdataset"))
>>> DATA: jobcat=col(source(s), name("jobcat"), unit.category())
>>> DATA: MEAN_salary=col(source(s), name("MEAN_salary"))
>>> GUIDE: axis(dim(1), label("Employment Category"))
>>> GUIDE: axis(dim(2), label("Mean Current Salary"))
>>> SCALE: linear(dim(2), include(0))
>>> ELEMENT: interval(position((jobcat+"All (n=474)")*MEAN_salary),
>> shape.interior(shape.square), color(color.green),
>>>     label(summary.mean(MEAN_salary))) END GPL.
>>>
>>> The result i get is here:
>>>
>>> I have got 2 questions for the graphic experts on the list:
>>>
>>> (1) How can I show the average value for the "All" bar instead of
>>> the
>>> 3
>> labels (one for each category)?
>>> (2) How can I automatically have the sample size for each category
>>> be
>> added to the category label - that is, remove the manual update I am
>> currently doing?
>>>
>>> Thanks,
>>> Luca
>>>
>>>
>>> Luca Meyer
>>> www.lucameyer.com
>>> PASW Statistics v. 18.0.1 (13-nov-2009) Mac OS X 10.6.2 (10C540) -
>>> kernel Darwin 10.2.0
>>>
>>>
>>>
>>>
>>>
>>
>> =====================
>> 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
Reply | Threaded
Open this post in threaded view
|

Re: GGRAPH/GPL correct labelling - LINK TO OUTPUT

Luca Meyer-3
Right, that I knew but I do not know how to add prefix-suffix to labels, I suspect you do that directly by modifying the xml in the saved template, don't you?
Luca

Il giorno 26/mar/2010, alle ore 14.51, ViAnn Beadle ha scritto:

> Edit your chart in the chart editor and then save the template. To test it
> create your chart with GPL, open it in the editor and then apply the
> template to it. When you save the chart template be sure to only check off
> the items you modified (in your case, data value labels). If that works,
> then specify the template name on the GGRAPH command.
>
> -----Original Message-----
> From: Luca Meyer [mailto:[hidden email]]
> Sent: Friday, March 26, 2010 4:05 AM
> To: ViAnn Beadle
> Cc: SPSSX-L
> Subject: Re: GGRAPH/GPL correct labelling - LINK TO OUTPUT
>
> I am yet confident with chart template, where can I get a tutorial on how
> work on GPL chart templates - I suppose modifying the xml?
> Thanks,
> Luca
>
> Il giorno 24/mar/2010, alle ore 20.42, ViAnn Beadle ha scritto:
>
>> You can add a prefix or suffix to labels via a chart template. Not
>> sure whether it applies to both your mean and count label--try it out.
>>
>> -----Original Message-----
>> From: Luca Meyer [mailto:[hidden email]]
>> Sent: Wednesday, March 24, 2010 1:31 PM
>> To: ViAnn Beadle
>> Cc: SPSSX-L
>> Subject: Re: GGRAPH/GPL correct labelling - LINK TO OUTPUT
>>
>> Thanks ViAnn,
>>
>> It works just fine and I have actually given both mean value and count
>> within the same labels. BTW, do you know how to create a one-line
>> label for GPL Graphic Element of the sort "n=84" because so far I
>> could only get multiple line labels .
>>
>> Luca
>>
>> Il giorno 23/mar/2010, alle ore 22.45, ViAnn Beadle ha scritto:
>>
>>> I have no quick answer for your second query but to get the computed
>>> label in the bar you'll have to do the data aggregation within the
>>> GPL itself using the summary.mean function:
>>>
>>> GGRAPH
>>> /GRAPHDATASET NAME="graphdataset" VARIABLES=jobcat salary
>>>  MISSING=LISTWISE REPORTMISSING=NO
>>> /GRAPHSPEC SOURCE=INLINE.
>>> BEGIN GPL
>>> SOURCE: s=userSource(id("graphdataset"))
>>> DATA: jobcat=col(source(s), name("jobcat"), unit.category())
>>> DATA: salary=col(source(s), name("salary"))
>>> GUIDE: axis(dim(1), label("Employment Category"))
>>> GUIDE: axis(dim(2), label("Mean Current Salary"))
>>> SCALE: cat(dim(1), include("1", "2", "3"))
>>> SCALE: linear(dim(2), include(0))
>>> ELEMENT: interval(position(summary.mean((jobcat+"All")*salary)),
>>> shape.interior(shape.square),
>>> label(summary.mean(salary)))
>>> END GPL.
>>>
>>> I personally would use the label function to provide the n's within
>>> the bars (via the summary.count function) and just let the chart's y
>>> axis graphically show the mean. That is, afterall, the purpose of
>>> labeling
>> the y-axis.
>>>
>>> -----Original Message-----
>>> From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf
>>> Of Luca Meyer
>>> Sent: Tuesday, March 23, 2010 5:39 AM
>>> To: [hidden email]
>>> Subject: Re: GGRAPH/GPL correct labelling - LINK TO OUTPUT
>>>
>>> Sorry in my previous email I have forgotten to add the link to the
> output:
>>> http://www.lucameyer.com/20100323_1215.pdf
>>> Cheers,
>>> Luca
>>>
>>> Il giorno 23/mar/2010, alle ore 12.22, Luca Meyer ha scritto:
>>>
>>>> Hi,
>>>>
>>>> I am running the following syntax to get a simple bar chart with an
> "All"
>>> category and labels:
>>>>
>>>> DATASET CLOSE ALL.
>>>> NEW FILE.
>>>> GET FILE
>>>> "/Applications/SPSSInc/PASWStatistics18/Samples/English/Employee
>>> data.sav".
>>>> FREQ jobcat.
>>>> /* i manually update the following line of syntax as well as the
>>>> "All (n=XXX)" part of the ELEMENT line in the GPL */ VAL LABEL
>>>> jobcat 1
>>> "Clerical (n=363)" 2 "Custodial (n=27)" 3 "Manager (n=84)".
>>>> GGRAPH
>>>> /GRAPHDATASET NAME="graphdataset" VARIABLES=jobcat
>>> MEAN(salary)[name="MEAN_salary"]
>>>> MISSING=LISTWISE REPORTMISSING=NO
>>>> /GRAPHSPEC SOURCE=INLINE.
>>>> BEGIN GPL
>>>> SOURCE: s=userSource(id("graphdataset"))
>>>> DATA: jobcat=col(source(s), name("jobcat"), unit.category())
>>>> DATA: MEAN_salary=col(source(s), name("MEAN_salary"))
>>>> GUIDE: axis(dim(1), label("Employment Category"))
>>>> GUIDE: axis(dim(2), label("Mean Current Salary"))
>>>> SCALE: linear(dim(2), include(0))
>>>> ELEMENT: interval(position((jobcat+"All (n=474)")*MEAN_salary),
>>> shape.interior(shape.square), color(color.green),
>>>>    label(summary.mean(MEAN_salary))) END GPL.
>>>>
>>>> The result i get is here:
>>>>
>>>> I have got 2 questions for the graphic experts on the list:
>>>>
>>>> (1) How can I show the average value for the "All" bar instead of
>>>> the
>>>> 3
>>> labels (one for each category)?
>>>> (2) How can I automatically have the sample size for each category
>>>> be
>>> added to the category label - that is, remove the manual update I am
>>> currently doing?
>>>>
>>>> Thanks,
>>>> Luca
>>>>
>>>>
>>>> Luca Meyer
>>>> www.lucameyer.com
>>>> PASW Statistics v. 18.0.1 (13-nov-2009) Mac OS X 10.6.2 (10C540) -
>>>> kernel Darwin 10.2.0
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>> =====================
>>> 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
Reply | Threaded
Open this post in threaded view
|

Re: GGRAPH/GPL correct labelling - LINK TO OUTPUT

ViAnn Beadle
Select the labels and you'll see a tab in properties for data labels. You'll
find the dialog for prefix and suffix there.

-----Original Message-----
From: Luca Meyer [mailto:[hidden email]]
Sent: Friday, March 26, 2010 1:30 PM
To: ViAnn Beadle
Cc: 'SPSSX-L'
Subject: Re: GGRAPH/GPL correct labelling - LINK TO OUTPUT

Right, that I knew but I do not know how to add prefix-suffix to labels, I
suspect you do that directly by modifying the xml in the saved template,
don't you?
Luca

Il giorno 26/mar/2010, alle ore 14.51, ViAnn Beadle ha scritto:

> Edit your chart in the chart editor and then save the template. To
> test it create your chart with GPL, open it in the editor and then
> apply the template to it. When you save the chart template be sure to
> only check off the items you modified (in your case, data value
> labels). If that works, then specify the template name on the GGRAPH
command.

>
> -----Original Message-----
> From: Luca Meyer [mailto:[hidden email]]
> Sent: Friday, March 26, 2010 4:05 AM
> To: ViAnn Beadle
> Cc: SPSSX-L
> Subject: Re: GGRAPH/GPL correct labelling - LINK TO OUTPUT
>
> I am yet confident with chart template, where can I get a tutorial on
> how work on GPL chart templates - I suppose modifying the xml?
> Thanks,
> Luca
>
> Il giorno 24/mar/2010, alle ore 20.42, ViAnn Beadle ha scritto:
>
>> You can add a prefix or suffix to labels via a chart template. Not
>> sure whether it applies to both your mean and count label--try it out.
>>
>> -----Original Message-----
>> From: Luca Meyer [mailto:[hidden email]]
>> Sent: Wednesday, March 24, 2010 1:31 PM
>> To: ViAnn Beadle
>> Cc: SPSSX-L
>> Subject: Re: GGRAPH/GPL correct labelling - LINK TO OUTPUT
>>
>> Thanks ViAnn,
>>
>> It works just fine and I have actually given both mean value and
>> count within the same labels. BTW, do you know how to create a
>> one-line label for GPL Graphic Element of the sort "n=84" because so
>> far I could only get multiple line labels .
>>
>> Luca
>>
>> Il giorno 23/mar/2010, alle ore 22.45, ViAnn Beadle ha scritto:
>>
>>> I have no quick answer for your second query but to get the computed
>>> label in the bar you'll have to do the data aggregation within the
>>> GPL itself using the summary.mean function:
>>>
>>> GGRAPH
>>> /GRAPHDATASET NAME="graphdataset" VARIABLES=jobcat salary
>>> MISSING=LISTWISE REPORTMISSING=NO /GRAPHSPEC SOURCE=INLINE.
>>> BEGIN GPL
>>> SOURCE: s=userSource(id("graphdataset"))
>>> DATA: jobcat=col(source(s), name("jobcat"), unit.category())
>>> DATA: salary=col(source(s), name("salary"))
>>> GUIDE: axis(dim(1), label("Employment Category"))
>>> GUIDE: axis(dim(2), label("Mean Current Salary"))
>>> SCALE: cat(dim(1), include("1", "2", "3"))
>>> SCALE: linear(dim(2), include(0))
>>> ELEMENT: interval(position(summary.mean((jobcat+"All")*salary)),
>>> shape.interior(shape.square),
>>> label(summary.mean(salary)))
>>> END GPL.
>>>
>>> I personally would use the label function to provide the n's within
>>> the bars (via the summary.count function) and just let the chart's y
>>> axis graphically show the mean. That is, afterall, the purpose of
>>> labeling
>> the y-axis.
>>>
>>> -----Original Message-----
>>> From: SPSSX(r) Discussion [mailto:[hidden email]] On
>>> Behalf Of Luca Meyer
>>> Sent: Tuesday, March 23, 2010 5:39 AM
>>> To: [hidden email]
>>> Subject: Re: GGRAPH/GPL correct labelling - LINK TO OUTPUT
>>>
>>> Sorry in my previous email I have forgotten to add the link to the
> output:
>>> http://www.lucameyer.com/20100323_1215.pdf
>>> Cheers,
>>> Luca
>>>
>>> Il giorno 23/mar/2010, alle ore 12.22, Luca Meyer ha scritto:
>>>
>>>> Hi,
>>>>
>>>> I am running the following syntax to get a simple bar chart with an
> "All"
>>> category and labels:
>>>>
>>>> DATASET CLOSE ALL.
>>>> NEW FILE.
>>>> GET FILE
>>>> "/Applications/SPSSInc/PASWStatistics18/Samples/English/Employee
>>> data.sav".
>>>> FREQ jobcat.
>>>> /* i manually update the following line of syntax as well as the
>>>> "All (n=XXX)" part of the ELEMENT line in the GPL */ VAL LABEL
>>>> jobcat 1
>>> "Clerical (n=363)" 2 "Custodial (n=27)" 3 "Manager (n=84)".
>>>> GGRAPH
>>>> /GRAPHDATASET NAME="graphdataset" VARIABLES=jobcat
>>> MEAN(salary)[name="MEAN_salary"]
>>>> MISSING=LISTWISE REPORTMISSING=NO
>>>> /GRAPHSPEC SOURCE=INLINE.
>>>> BEGIN GPL
>>>> SOURCE: s=userSource(id("graphdataset"))
>>>> DATA: jobcat=col(source(s), name("jobcat"), unit.category())
>>>> DATA: MEAN_salary=col(source(s), name("MEAN_salary"))
>>>> GUIDE: axis(dim(1), label("Employment Category"))
>>>> GUIDE: axis(dim(2), label("Mean Current Salary"))
>>>> SCALE: linear(dim(2), include(0))
>>>> ELEMENT: interval(position((jobcat+"All (n=474)")*MEAN_salary),
>>> shape.interior(shape.square), color(color.green),
>>>>    label(summary.mean(MEAN_salary))) END GPL.
>>>>
>>>> The result i get is here:
>>>>
>>>> I have got 2 questions for the graphic experts on the list:
>>>>
>>>> (1) How can I show the average value for the "All" bar instead of
>>>> the
>>>> 3
>>> labels (one for each category)?
>>>> (2) How can I automatically have the sample size for each category
>>>> be
>>> added to the category label - that is, remove the manual update I am
>>> currently doing?
>>>>
>>>> Thanks,
>>>> Luca
>>>>
>>>>
>>>> Luca Meyer
>>>> www.lucameyer.com
>>>> PASW Statistics v. 18.0.1 (13-nov-2009) Mac OS X 10.6.2 (10C540) -
>>>> kernel Darwin 10.2.0
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>> =====================
>>> 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