Using macros with scatter plots

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

Using macros with scatter plots

Kevin Bladon
Hello,

I am wondering if it is possible to write a macro that would graph scatter
plots for groups of cases within a single column?

For instance, with the following data:

Species     Height     Diameter
Aw          10         9
Aw          11         10
Aw          9          9
Pb          12         10
Pb          11         11
Pb          13         15

would it be possible to write a macro that would produce two scatter plots
(1 for species Aw and 1 for species Pb) of diameter (x-axis) and height
(y-axis)?    Suggestions?

Many thanks in advance!
Reply | Threaded
Open this post in threaded view
|

Re: Using macros with scatter plots

Beadle, ViAnn
why do you want to use a macro here? Simple syntax will do this assuming your data contains these 3 variables:
 
GRAPH
  /SCATTERPLOT(BIVAR)=height WITH diameter  /PANEL COLVAR=species COLOP=CROSS
  /MISSING=LISTWISE .

You'll get two scatterplots side by side for each species.

________________________________

From: SPSSX(r) Discussion on behalf of Kevin Bladon
Sent: Wed 8/16/2006 9:40 AM
To: [hidden email]
Subject: Using macros with scatter plots



Hello,

I am wondering if it is possible to write a macro that would graph scatter
plots for groups of cases within a single column?

For instance, with the following data:

Species     Height     Diameter
Aw          10         9
Aw          11         10
Aw          9          9
Pb          12         10
Pb          11         11
Pb          13         15

would it be possible to write a macro that would produce two scatter plots
(1 for species Aw and 1 for species Pb) of diameter (x-axis) and height
(y-axis)?    Suggestions?

Many thanks in advance!
Reply | Threaded
Open this post in threaded view
|

Re: Using macros with scatter plots

Beadle, ViAnn
If you're going to have more than two species, then you should use split files because you'll get really tiny charts with paneling of more than two values. You can access it from the Data>Split File menu and then paste the command to see the syntax involved.

________________________________

From: Kevin Bladon [mailto:[hidden email]]
Sent: Wed 8/16/2006 10:07 AM
To: Beadle, ViAnn
Subject: RE: Using macros with scatter plots



Hi ViAnn,

If I have more than two species, will the code that you provided me
produce scatterplots for all of the species? This is the reason why I
wanted to run a macro, so that I do not have to write the code to
produce scatterplots of diameter and height for each of 15 species
separately.

Thanks,
kevin.

On Aug 16, 2006 08:56, "Beadle, ViAnn" wrote:

>why do you want to use a macro here? Simple syntax will do this
>assuming your data contains these 3 variables:
>
>GRAPH
>/SCATTERPLOT(BIVAR)=height WITH diameter /PANEL COLVAR=species
>COLOP=CROSS
>/MISSING=LISTWISE .
>
>You'll get two scatterplots side by side for each species.
>
>________________________________
>
>From: SPSSX(r) Discussion on behalf of Kevin Bladon
>Sent: Wed 8/16/2006 9:40 AM
>To: [hidden email]
>Subject: Using macros with scatter plots
>
>
>
>Hello,
>
>I am wondering if it is possible to write a macro that would graph
>scatter
>plots for groups of cases within a single column?
>
>For instance, with the following data:
>
>Species Height Diameter
>Aw 10 9
>Aw 11 10
>Aw 9 9
>Pb 12 10
>Pb 11 11
>Pb 13 15
>
>would it be possible to write a macro that would produce two scatter
>plots
>(1 for species Aw and 1 for species Pb) of diameter (x-axis) and height
>(y-axis)? Suggestions?
>
>Many thanks in advance!
>
>


Kevin Bladon, Ph.D., A.Ag.
Resource Analyst
Silvacom Ltd.
3825 - 93 Street
Edmonton, AB
T6E 5K5
Phone: 780.462.3238
Fax: 780.462.4726
E-mail: [hidden email]
www.silvacom.com
Reply | Threaded
Open this post in threaded view
|

Re: Using macros with scatter plots

Kevin Bladon
Thanks!�  Works great! Very clean syntax.

On Aug 16, 2006 09:18, "Beadle, ViAnn" wrote:

>If you're going to have more than two species, then you should use
>split files because you'll get really tiny charts with paneling of more
>than two values. You can access it from the Data>Split File menu and
>then paste the command to see the syntax involved.
>
>________________________________
>
>From: Kevin Bladon [mailto:[hidden email]]
>Sent: Wed 8/16/2006 10:07 AM
>To: Beadle, ViAnn
>Subject: RE: Using macros with scatter plots
>
>
>
>Hi ViAnn,
>
>If I have more than two species, will the code that you provided me
>produce scatterplots for all of the species? This is the reason why I
>wanted to run a macro, so that I do not have to write the code to
>produce scatterplots of diameter and height for each of 15 species
>separately.
>
>Thanks,
>kevin.
>
>On Aug 16, 2006 08:56, "Beadle, ViAnn" wrote:
>
>>why do you want to use a macro here? Simple syntax will do this
>>assuming your data contains these 3 variables:
>>
>>GRAPH
>>/SCATTERPLOT(BIVAR)=height WITH diameter /PANEL COLVAR=species
>>COLOP=CROSS
>>/MISSING=LISTWISE .
>>
>>You'll get two scatterplots side by side for each species.
>>
>>________________________________
>>
>>From: SPSSX(r) Discussion on behalf of Kevin Bladon
>>Sent: Wed 8/16/2006 9:40 AM
>>To: [hidden email]
>>Subject: Using macros with scatter plots
>>
>>
>>
>>Hello,
>>
>>I am wondering if it is possible to write a macro that would graph
>>scatter
>>plots for groups of cases within a single column?
>>
>>For instance, with the following data:
>>
>>Species Height Diameter
>>Aw 10 9
>>Aw 11 10
>>Aw 9 9
>>Pb 12 10
>>Pb 11 11
>>Pb 13 15
>>
>>would it be possible to write a macro that would produce two scatter
>>plots
>>(1 for species Aw and 1 for species Pb) of diameter (x-axis) and
>>height
>>(y-axis)? Suggestions?
>>
>>Many thanks in advance!
>>
>>
>
>
>Kevin Bladon, Ph.D., A.Ag.
>Resource Analyst
>Silvacom Ltd.
>3825 - 93 Street
>Edmonton, AB
>T6E 5K5
>Phone: 780.462.3238
>Fax: 780.462.4726
>E-mail: [hidden email]
>www.silvacom.com
>
>
>


Kevin Bladon, Ph.D., A.Ag.
Resource Analyst
Silvacom Ltd.
3825 - 93 Street
Edmonton, AB
T6E 5K5
Phone: 780.462.3238
Fax: 780.462.4726
E-mail: [hidden email]
www.silvacom.com