Boxplots: Panels for Different Variables

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

Boxplots: Panels for Different Variables

Gary Rosin
I'm using SPSS v. 15.0.1.  I have two numeric variables with
different scales (148-174, 0.20-0.95).  I have a categorical
variable (0/1 ).

I can generate *separate* boxplots for each numeric variable
that compares the two cateories.

What I'd like to do is panel/stack the two boxplots in a single
chart/graph.  I haven't been able to find a way to do this via
the GUI.  I haven't found any hints the syntax reference
manual.

Can I do this, or am I asking for the impossible?

Thanks,

Gary


     ---

Prof. Gary S. Rosin                 [hidden email]
South Texas College of Law
1303 San Jacinto             Voice:  (713) 646-1854
Houston, TX  77002-7000    Fax:           646-1766
Reply | Threaded
Open this post in threaded view
|

Re: Boxplots: Panels for Different Variables

ViAnn Beadle
If you want to use the GUI to create boxplots of different variables with
Chart Builder, you have to transform your data via the VARSTOCASES command.
Alternatively, you can create them with handcrafted GPL. This example syntax
compares two interval variables--gas and horse paneled by categories of
origin using the cars.sav sample file:

GGRAPH
/GRAPHDATASET NAME="graphdataset" VARIABLES=origin mpg horse
MISSING=LISTWISE REPORTMISSING=NO
/GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
SOURCE: s=userSource(id("graphdataset"))
DATA: origin=col(source(s), name("origin"), unit.category())
DATA: mpg=col(source(s), name("mpg"))
DATA: horse=col(source(s), name("horse"))
DATA: id=col(source(s), name("$CASENUM"), unit.category())
ELEMENT: schema(position(bin.quantile.letter(("Horsepower"*horse+
"Miles per Gallon"*mpg)*origin)), label(id)))
END GPL.

This example compares categories with the interval variables placed in
separate panels:

GGRAPH
/GRAPHDATASET NAME="graphdataset" VARIABLES=origin mpg horse
MISSING=LISTWISE REPORTMISSING=NO
/GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
SOURCE: s=userSource(id("graphdataset"))
DATA: origin=col(source(s), name("origin"), unit.category())
DATA: mpg=col(source(s), name("mpg"))
DATA: horse=col(source(s), name("horse"))
DATA: id=col(source(s), name("$CASENUM"), unit.category())
ELEMENT:
schema(position(bin.quantile.letter(origin*horse*"Horsepower"+origin*mpg*"Mi
les Per Gallon")), label(id)))
END GPL.

Note that if you want independent scales for the scale variables, you'll
need to change the crossing operator (*) to a nesting operator (/) for the
string defining each variable.


-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Gary Rosin
Sent: Monday, July 23, 2007 4:31 PM
To: [hidden email]
Subject: Boxplots: Panels for Different Variables

I'm using SPSS v. 15.0.1.  I have two numeric variables with
different scales (148-174, 0.20-0.95).  I have a categorical
variable (0/1 ).

I can generate *separate* boxplots for each numeric variable
that compares the two cateories.

What I'd like to do is panel/stack the two boxplots in a single
chart/graph.  I haven't been able to find a way to do this via
the GUI.  I haven't found any hints the syntax reference
manual.

Can I do this, or am I asking for the impossible?

Thanks,

Gary


     ---

Prof. Gary S. Rosin                 [hidden email]
South Texas College of Law
1303 San Jacinto             Voice:  (713) 646-1854
Houston, TX  77002-7000    Fax:           646-1766
Reply | Threaded
Open this post in threaded view
|

Selecting the first time a value occurs

Gary Oliver
Hi

I am tangled up in IF syntax for the following problem. Each participant
is given a value over 40 rounds. The value may range from 0 to 10. I am
interested in knowing which round they first give a value > 0.

I am unsure whether to create 40 variables corresponding to the each of
the 40 rounds and trying to write the first value into it, or, creating
a single variable which contains the value for each case. The latter has
the advantage of avoiding missing values.

Suggestions appreciated

Warm regards/gary
Reply | Threaded
Open this post in threaded view
|

Re: Selecting the first time a value occurs

Spousta Jan
Hi Gary,

Suppose you have 40 variables (r1 to r40) corresponding with the rounds. One possible solution is like this:

Compute firstpositive = 0.
Do repeat var = r1 to r40 / round = 1 to 40.
- If (firstpositive = 0 and var > 0) firstpositive = round.
End repeat.
Execute.
Var lab firstpositive "Round they first give a value > 0".

Regards

Jan

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Gary Oliver
Sent: Tuesday, July 24, 2007 8:47 AM
To: [hidden email]
Subject: Selecting the first time a value occurs

Hi

I am tangled up in IF syntax for the following problem. Each participant is given a value over 40 rounds. The value may range from 0 to 10. I am interested in knowing which round they first give a value > 0.

I am unsure whether to create 40 variables corresponding to the each of the 40 rounds and trying to write the first value into it, or, creating a single variable which contains the value for each case. The latter has the advantage of avoiding missing values.

Suggestions appreciated

Warm regards/gary



_____

Tato zpráva a všechny připojené soubory jsou důvěrné a určené výlučně adresátovi(-ům). Jestliže nejste oprávněným adresátem, je zakázáno jakékoliv zveřejňování, zprostředkování nebo jiné použití těchto informací. Jestliže jste tento mail dostali neoprávněně, prosím, uvědomte odesilatele a smažte zprávu i přiložené soubory. Odesilatel nezodpovídá za jakékoliv chyby nebo opomenutí způsobené tímto přenosem.

This message and any attached files are confidential and intended solely for the addressee(s). Any publication, transmission or other use of the information by a person or entity other than the intended addressee is prohibited. If you receive this in error please contact the sender and delete the message as well as all attached documents. The sender does not accept liability for any errors or omissions as a result of the transmission.

-.- --