Changing stacked bar chart to "Scale to 100%"

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

Changing stacked bar chart to "Scale to 100%"

Alina Sheyman-3
I'm creating stacked bar charts in SPSS 12.0.
I want to scale each bar to 100%, and I can do it by clicking on each chart
and then manually selecting a "scale to 100%" option. Which is somewhat time
consuming when dealing with multiple charts. I'm wondering if anyone knows
of a code that can do this for me.

thank you

=====================
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: Changing stacked bar chart to "Scale to 100%"

ViAnn Beadle
What SPSS commands are you using to create the stacked bars?

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Alina Sheyman
Sent: Wednesday, May 14, 2008 3:57 PM
To: [hidden email]
Subject: Changing stacked bar chart to "Scale to 100%"

I'm creating stacked bar charts in SPSS 12.0.
I want to scale each bar to 100%, and I can do it by clicking on each chart
and then manually selecting a "scale to 100%" option. Which is somewhat time
consuming when dealing with multiple charts. I'm wondering if anyone knows
of a code that can do this for me.

thank you

=====================
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: Changing stacked bar chart to "Scale to 100%"

Alina Sheyman-3
Very simple

GRAPH
  /BAR(STACK)=COUNT BY REGION_NAME BY i18q1 .


On Wed, May 14, 2008 at 7:00 PM, ViAnn Beadle <[hidden email]> wrote:

> What SPSS commands are you using to create the stacked bars?
>
> -----Original Message-----
> From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
> Alina Sheyman
> Sent: Wednesday, May 14, 2008 3:57 PM
> To: [hidden email]
> Subject: Changing stacked bar chart to "Scale to 100%"
>
> I'm creating stacked bar charts in SPSS 12.0.
> I want to scale each bar to 100%, and I can do it by clicking on each chart
> and then manually selecting a "scale to 100%" option. Which is somewhat
> time
> consuming when dealing with multiple charts. I'm wondering if anyone knows
> of a code that can do this for me.
>
> thank you
>
> =====================
> 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: Changing stacked bar chart to "Scale to 100%"

ViAnn Beadle
I cannot guarantee that this will work in 12-it does work in 16 but a lot of
time and effort has been in improving templates over recent versions.



1.       Open one of your edited bar charts or create a new one and edit it
to stack to 100%.

2.       Within the chart editor select File>Save Template.

3.       Expand the scale axis group and you should see a check box for
scale to 100%. Turn it on. Leave all other check boxes turned off except for
it and the Scale Axis check box.

4.       Save the template to someplace easy to specify or find.

5.       Use the /template subcommand to point to the saved template for
charts that you want scaled to 100%.



If this doesn't work for you, try the IGRAPH command:



IGRAPH
  /VIEWNAME='Bar Chart'
  /X1=VAR(REGION_NAME) TYPE=CATEGORICAL
  /Y=$count
  /COLOR=VAR(il8q1) TYPE=CATEGORICAL STACK
  /COORDINATE=VERTICAL
  /NORMALIZE
  /YLENGTH=5.2
  /X1LENGTH=6.5
  /CHARTLOOK='NONE'
  /CATORDER VAR(gender) (ASCENDING VALUES OMITEMPTY)
  /CATORDER VAR(jobcat) (ASCENDING VALUES OMITEMPTY)
  /BAR KEY=ON SHAPE=RECTANGLE BASELINE=AUTO.



The /NORMALIZE subcommand is used to force 100% stacking.



From: Alina Sheyman [mailto:[hidden email]]
Sent: Thursday, May 15, 2008 7:08 AM
To: ViAnn Beadle
Cc: [hidden email]
Subject: Re: Changing stacked bar chart to "Scale to 100%"



Very simple

GRAPH
  /BAR(STACK)=COUNT BY REGION_NAME BY i18q1 .



On Wed, May 14, 2008 at 7:00 PM, ViAnn Beadle <[hidden email]> wrote:

What SPSS commands are you using to create the stacked bars?

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Alina Sheyman
Sent: Wednesday, May 14, 2008 3:57 PM
To: [hidden email]
Subject: Changing stacked bar chart to "Scale to 100%"

I'm creating stacked bar charts in SPSS 12.0.
I want to scale each bar to 100%, and I can do it by clicking on each chart
and then manually selecting a "scale to 100%" option. Which is somewhat time
consuming when dealing with multiple charts. I'm wondering if anyone knows
of a code that can do this for me.

thank you

=====================
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: Changing stacked bar chart to "Scale to 100%"

pmulonge
Hello SPSSX community,
Thank goodnesss for this thread, as I need help with the same problem. I tried to use the ‘scale to 100% ‘ feature but it does not work. Now I hear about this IGRAPH function, but it is not in my PASW Statistics 18. Does one need to download it as a package?
Would you kindly tell me how and where I can get IGRAPH (from a reliable source – no virus) and put it in my SPSS 18.
The thing is all I would like is a stacked graph where each stack adds up to 100%. The parts within the stack given the value of one variables (e.g. Y1 Y2 Y3) given the category on the X axis i.e. given the value X, what are the proportions of Y1, Y2, Y3 within X. Is that really so hard to do with SPSS? I am so surprised.

Thank you.

Pancho Mulongeni
Pancho Mulongeni,
Research Assistant
Pharmaccess Foundation,
Namibia
Reply | Threaded
Open this post in threaded view
|

Re: Changing stacked bar chart to "Scale to 100%"

Bruce Weaver
Administrator
IGRAPH syntax still works in v18--you just cannot generate it by Pasting from the dialog.  However, unlike what has happened with other commands no longer available via the menus (e.g., MANOVA), it appears IGRAPH is completely abolished in v19 and beyond.  Here's the warning message I got just now when I ran an IGRAPH command (in v18):

Warnings
The IGRAPH procedure has been deprecated and will be removed in the next release. Use the syntax converter to convert IGRAPH syntax to GGRAPH. See the online help for information about the syntax converter.


pmulonge wrote
Hello SPSSX community,
Thank goodnesss for this thread, as I need help with the same problem. I tried to use the ‘scale to 100% ‘ feature but it does not work. Now I hear about this IGRAPH function, but it is not in my PASW Statistics 18. Does one need to download it as a package?
Would you kindly tell me how and where I can get IGRAPH (from a reliable source – no virus) and put it in my SPSS 18.
The thing is all I would like is a stacked graph where each stack adds up to 100%. The parts within the stack given the value of one variables (e.g. Y1 Y2 Y3) given the category on the X axis i.e. given the value X, what are the proportions of Y1, Y2, Y3 within X. Is that really so hard to do with SPSS? I am so surprised.

Thank you.

Pancho Mulongeni
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: Changing stacked bar chart to "Scale to 100%"

Jon K Peck
The warning message is incorrect.  IGRAPH remains available.  However, there is no need to use IGRAPH to get this type of chart.

Use the Chart Builder to create an ordinary stacked bar chart.  In the Chart Editor, click the scale to 100% icon (the last one on the right on the toolbar).  You can save this as a template, then, or modify the GPL code generated by the ChartBuilder if you need to do this many times.

HTH,
Jon Peck

Jon Peck
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621




From:        Bruce Weaver <[hidden email]>
To:        [hidden email]
Date:        05/12/2011 05:38 AM
Subject:        Re: [SPSSX-L] Changing stacked bar chart to "Scale to 100%"
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




IGRAPH syntax still works in v18--you just cannot generate it by Pasting from
the dialog.  However, unlike what has happened with other commands no longer
available via the menus (e.g., MANOVA), it appears IGRAPH is completely
abolished in v19 and beyond.  Here's the warning message I got just now when
I ran an IGRAPH command (in v18):

Warnings
The IGRAPH procedure has been deprecated and will be removed in the next
release. Use the syntax converter to convert IGRAPH syntax to GGRAPH. See
the online help for information about the syntax converter.



pmulonge wrote:
>
> Hello SPSSX community,
> Thank goodnesss for this thread, as I need help with the same problem. I
> tried to use the ‘scale to 100% ‘ feature but it does not work. Now I hear
> about this IGRAPH function, but it is not in my PASW Statistics 18. Does
> one need to download it as a package?
> Would you kindly tell me how and where I can get IGRAPH (from a reliable
> source – no virus) and put it in my SPSS 18.
> The thing is all I would like is a stacked graph where each stack adds up
> to 100%. The parts within the stack given the value of one variables (e.g.
> Y1 Y2 Y3) given the category on the X axis i.e. given the value X, what
> are the proportions of Y1, Y2, Y3 within X. Is that really so hard to do
> with SPSS? I am so surprised.
>
> Thank you.
>
> Pancho Mulongeni
>


-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/Changing-stacked-bar-chart-to-Scale-to-100-tp1082757p4390000.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
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: Changing stacked bar chart to "Scale to 100%"

Bruce Weaver
Administrator
Jon K Peck wrote
The warning message is incorrect.  IGRAPH remains available.  
--- snip ---

That's good to know--no need to modify old syntax that uses IGRAPH.  Thanks Jon.
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: Changing stacked bar chart to "Scale to 100%"

pmulonge
In reply to this post by Jon K Peck
Thank you for the answers, but let me clarify my concern:
I have used the scale to 100% feature in the GUI (when you click on the figure and then edit).
But the proportions in each bar are just wrong.
Let me explain:
I did the cross tab between two variables BP and 'High blood pressure'?
When I look at the crosstab notice the distribution of BP given the answer YES is 41.7 (normal) 29.2% (elevated) and 29.1% (high). Now I also have the bar graph between these same two variables, scaled to 100%. When I look at the stacked bar under YES I clearly see the proportions are different here for normal, elevated and high, they are what is in the crosstab. Clearly something is wrong with they way graph treats the variables, even though it adds up to 100%.
I hope this is clear and if anyone can help me put what I see in a crosstab onto a stacked bar graph, I will really appreciate it.
Pancho Mulongeni,
Research Assistant
Pharmaccess Foundation,
Namibia
Reply | Threaded
Open this post in threaded view
|

Re: Changing stacked bar chart to "Scale to 100%"

ViAnn Beadle
A crosstab can contain up to three different percentages--rows add up to
100%, columns add up to 100%, all cells add up to 100%. Which of these do
you want in your chart?

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
pmulonge
Sent: Friday, May 13, 2011 2:30 AM
To: [hidden email]
Subject: Re: Changing stacked bar chart to "Scale to 100%"

Thank you for the answers, but let me clarify my concern:
I have used the scale to 100% feature in the GUI (when you click on the
figure and then edit).
But the proportions in each bar are just wrong.
Let me explain:
I did the cross tab between two variables BP and 'High blood pressure'?
When I look at the crosstab notice the distribution of BP given the answer
YES is 41.7 (normal) 29.2% (elevated) and 29.1% (high). Now I also have the
bar graph between these same two variables, scaled to 100%. When I look at
the stacked bar under YES I clearly see the proportions are different here
for normal, elevated and high, they are what is in the crosstab. Clearly
something is wrong with they way graph treats the variables, even though it
adds up to 100%.
I hope this is clear and if anyone can help me put what I see in a crosstab
onto a stacked bar graph, I will really appreciate it.

--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/Changing-stacked-bar-chart-to-
Scale-to-100-tp1082757p4392530.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
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: Changing stacked bar chart to "Scale to 100%"

Jon K Peck
In reply to this post by pmulonge
My first guess is that there is a difference in the missing value treatment.  You might try creating a clustered bar directly from Crosstabs and then converting it to a stacked bar in the Chart Editor or comparing it with a clustered bar created with the Chart Builder to track this down.

HTH,

Jon Peck
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621




From:        pmulonge <[hidden email]>
To:        [hidden email]
Date:        05/13/2011 02:32 AM
Subject:        Re: [SPSSX-L] Changing stacked bar chart to "Scale to 100%"
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




Thank you for the answers, but let me clarify my concern:
I have used the scale to 100% feature in the GUI (when you click on the
figure and then edit).
But the proportions in each bar are just wrong.
Let me explain:
I did the cross tab between two variables BP and 'High blood pressure'?
When I look at the crosstab notice the distribution of BP given the answer
YES is 41.7 (normal) 29.2% (elevated) and 29.1% (high). Now I also have the
bar graph between these same two variables, scaled to 100%. When I look at
the stacked bar under YES I clearly see the proportions are different here
for normal, elevated and high, they are what is in the crosstab. Clearly
something is wrong with they way graph treats the variables, even though it
adds up to 100%.
I hope this is clear and if anyone can help me put what I see in a crosstab
onto a stacked bar graph, I will really appreciate it.

--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/Changing-stacked-bar-chart-to-Scale-to-100-tp1082757p4392530.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
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: Changing stacked bar chart to "Scale to 100%"

pmulonge
In reply to this post by ViAnn Beadle
Thank you, I am aware that it can do row or column percents and I know the syntax
/CELLS=COLUMN to get column percents or ROW to get row percents.
I am now looking to translate that into a graph (a stacked bar chart). See the next reply for details.
Thanks again.
Pancho Mulongeni,
Research Assistant
Pharmaccess Foundation,
Namibia
Reply | Threaded
Open this post in threaded view
|

Re: Changing stacked bar chart to "Scale to 100%"

pmulonge
In reply to this post by Jon K Peck
According to the help their is only one subcommand that gives a clustered bar chart from crosstabs
/BARCHART
I used it and it would be perfect, were it not for the y-axis that is labeled with 'counts' that range from 0 to 6000 (makes no sense especially if you only did %ages in the crosstab).

Apparently, BARCHART 'takes on no further specification', which means that's it - you either work with it or you move to something else. I am now looking for that something else.
Thanks for your help Jon, have a great weekend (its almost 5 o'clock in this part of the world).
Pancho Mulongeni,
Research Assistant
Pharmaccess Foundation,
Namibia
Reply | Threaded
Open this post in threaded view
|

Re: Changing stacked bar chart to "Scale to 100%"

ViAnn Beadle
In reply to this post by pmulonge
If you use Chart Builder, specify your percentage base using the variable
which defines the rows in the table.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
pmulonge
Sent: Friday, May 13, 2011 9:08 AM
To: [hidden email]
Subject: Re: Changing stacked bar chart to "Scale to 100%"

Thank you, I am aware that it can do row or column percents and I know the
syntax /CELLS=COLUMN to get column percents or ROW to get row percents.
I am now looking to translate that into a graph (a stacked bar chart). See
the next reply for details.
Thanks again.

--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/Changing-stacked-bar-chart-to-
Scale-to-100-tp1082757p4393372.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
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