Presenting data in a bar chart

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

Presenting data in a bar chart

Paul Sillitoe
Using PASW Statistics v17.0.2, I have a problem with knowing how to be able to present some data in
a bar chart using the Chart Builder.

I wish to present data in three bars, following the principles of the following illustration. The
actual dataset is much larger and complex, but this is the only point at issue.

I am using one variable with four data values: Absent, Red, Black, and Red and Black, but I wish to
present the data in three bars as follows:

For the following values:

Absent = 40, Red = 20, Black = 25, Red and Black = 15

I wish to present three gars which display:

Absent = 40, Red = 35, Black = 40

I would be grateful to know how to select the Red and Black data values so that they will be added
to the individual Red and Black bars. I anticipate that there is a simple solution that is obvious
to those more experienced.

Thank you.

Paul Sillitoe

=====================
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: Presenting data in a bar chart

John F Hall
Have a look at the AUTORECODE command on pages 229 ff of the syntax
reference guide. This can recode your values to numeric and save a lot of
typing out of alpha values.

However for now you could try something like (untested, and others will have
more elegant solutions, but the US is at least 5 hours behind).  If you have
embedded blanks, it gets more complex.  You may need to substitute your own
varnames for v1, v2 v3 and v4 below.  From your data editor click:

File > New > syntax

. . . then write:

recode v1       ('Absent' = 1)
                ('Red' = 2)
                ('Black' = 3)
                (Red and Black' =4)
        into  v2.
compute v3 = v2.
Compute v4 = v2.
if (v2 = 2) and (v3 = 4) v4 = 2.
if (v2 = 3) and (v3 = 4) v4 =3.
Val lab v4 1 'Absent' 2 'Red' 3 'Black' .
freq v4 /for not/ bar .

and then Run > All

If you have any other values you need to think about how to deal with them.

John F Hall

[hidden email]
www.surveyresearch.weebly.com






-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Paul Sillitoe
Sent: 18 October 2011 12:24
To: [hidden email]
Subject: Presenting data in a bar chart

Using PASW Statistics v17.0.2, I have a problem with knowing how to be able
to present some data in
a bar chart using the Chart Builder.

I wish to present data in three bars, following the principles of the
following illustration. The
actual dataset is much larger and complex, but this is the only point at
issue.

I am using one variable with four data values: Absent, Red, Black, and Red
and Black, but I wish to
present the data in three bars as follows:

For the following values:

Absent = 40, Red = 20, Black = 25, Red and Black = 15

I wish to present three gars which display:

Absent = 40, Red = 35, Black = 40

I would be grateful to know how to select the Red and Black data values so
that they will be added
to the individual Red and Black bars. I anticipate that there is a simple
solution that is obvious
to those more experienced.

Thank you.

Paul Sillitoe

=====================
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: Presenting data in a bar chart

David Marso
Administrator
In reply to this post by Paul Sillitoe
Paul,
  I suspect it will be required to replicate your "Red and Black" instances into two ("Red" and "Black" ).

DO IF _yourvar_ EQ "Red and Black".
+  XSAVE OUTFILE 'somefilename.sav'.
END IF.
EXECUTE.

ADD FILES / FILE * / FILE 'somefilename.sav' / IN=RB.
DO IF  _yourvar_ EQ "Red and Black".
+  IF RB EQ 0 _yourvar_="Red".
+  IF RB EQ 1 _yourvar_ ="Black".
END IF.

--do your graph--
HTH, David
--
Paul Sillitoe wrote
Using PASW Statistics v17.0.2, I have a problem with knowing how to be able to present some data in
a bar chart using the Chart Builder.

I wish to present data in three bars, following the principles of the following illustration. The
actual dataset is much larger and complex, but this is the only point at issue.

I am using one variable with four data values: Absent, Red, Black, and Red and Black, but I wish to
present the data in three bars as follows:

For the following values:

Absent = 40, Red = 20, Black = 25, Red and Black = 15

I wish to present three gars which display:

Absent = 40, Red = 35, Black = 40

I would be grateful to know how to select the Red and Black data values so that they will be added
to the individual Red and Black bars. I anticipate that there is a simple solution that is obvious
to those more experienced.

Thank you.

Paul Sillitoe

=====================
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
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: Presenting data in a bar chart

David Marso
Administrator
In reply to this post by John F Hall
"compute v3 = v2.
Compute v4 = v2.
if (v2 = 2) and (v3 = 4) v4 = 2.
if (v2 = 3) and (v3 = 4) v4 =3. "

Gotta Love it!!!!
So,  somehow V2  is equal to both 2 and 3 or to both 3 and 4?
I think my head is about to explode ;-)
AUTORECODE is on pg 129 of my syntax reference ;-)
Are they (SPSS/IBM/Bug Brother )using a larger font or something?  
Can't be that much added since version 11.5 (or are they actually presenting a few useful examples these days)?.
--
John F Hall wrote
Have a look at the AUTORECODE command on pages 229 ff of the syntax
reference guide. This can recode your values to numeric and save a lot of
typing out of alpha values.

However for now you could try something like (untested, and others will have
more elegant solutions, but the US is at least 5 hours behind).  If you have
embedded blanks, it gets more complex.  You may need to substitute your own
varnames for v1, v2 v3 and v4 below.  From your data editor click:

File > New > syntax

. . . then write:

recode v1       ('Absent' = 1)
                ('Red' = 2)
                ('Black' = 3)
                (Red and Black' =4)
        into  v2.
compute v3 = v2.
Compute v4 = v2.
if (v2 = 2) and (v3 = 4) v4 = 2.
if (v2 = 3) and (v3 = 4) v4 =3.
Val lab v4 1 'Absent' 2 'Red' 3 'Black' .
freq v4 /for not/ bar .

and then Run > All

If you have any other values you need to think about how to deal with them.

John F Hall

[hidden email]
www.surveyresearch.weebly.com






-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Paul Sillitoe
Sent: 18 October 2011 12:24
To: [hidden email]
Subject: Presenting data in a bar chart

Using PASW Statistics v17.0.2, I have a problem with knowing how to be able
to present some data in
a bar chart using the Chart Builder.

I wish to present data in three bars, following the principles of the
following illustration. The
actual dataset is much larger and complex, but this is the only point at
issue.

I am using one variable with four data values: Absent, Red, Black, and Red
and Black, but I wish to
present the data in three bars as follows:

For the following values:

Absent = 40, Red = 20, Black = 25, Red and Black = 15

I wish to present three gars which display:

Absent = 40, Red = 35, Black = 40

I would be grateful to know how to select the Red and Black data values so
that they will be added
to the individual Red and Black bars. I anticipate that there is a simple
solution that is obvious
to those more experienced.

Thank you.

Paul Sillitoe

=====================
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
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: Presenting data in a bar chart

ViAnn Beadle
In reply to this post by David Marso
I'm in the process of installing things so here's the general approach
without the gory details.

1. create three vars 0/1 vars for absent, black, and red.
2. define a multiple dichotomy response set containing the three vars.
3. use Chart Builder and select the set for the x axis.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
David Marso
Sent: Tuesday, October 18, 2011 9:36 AM
To: [hidden email]
Subject: Re: Presenting data in a bar chart

Paul,
  I suspect it will be required to replicate your "Red and Black" instances
into two ("Red" and "Black" ).

DO IF _yourvar_ EQ "Red and Black".
+  XSAVE OUTFILE 'somefilename.sav'.
END IF.
EXECUTE.

ADD FILES / FILE * / FILE 'somefilename.sav' / IN=RB.
DO IF  _yourvar_ EQ "Red and Black".
+  IF RB EQ 0 _yourvar_="Red".
+  IF RB EQ 1 _yourvar_ ="Black".
END IF.

--do your graph--
HTH, David
--

Paul Sillitoe wrote:

>
> Using PASW Statistics v17.0.2, I have a problem with knowing how to be
> able to present some data in a bar chart using the Chart Builder.
>
> I wish to present data in three bars, following the principles of the
> following illustration. The actual dataset is much larger and complex,
> but this is the only point at issue.
>
> I am using one variable with four data values: Absent, Red, Black, and
> Red and Black, but I wish to present the data in three bars as
> follows:
>
> For the following values:
>
> Absent = 40, Red = 20, Black = 25, Red and Black = 15
>
> I wish to present three gars which display:
>
> Absent = 40, Red = 35, Black = 40
>
> I would be grateful to know how to select the Red and Black data
> values so that they will be added to the individual Red and Black
> bars. I anticipate that there is a simple solution that is obvious to
> those more experienced.
>
> Thank you.
>
> Paul Sillitoe
>
> =====================
> To manage your subscription to SPSSX-L, send a message to
> LISTSERV@.UGA (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
>


--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/Presenting-data-in-a-bar-chart
-tp4913192p4914170.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