creating multiple graphs using loops - addition

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

creating multiple graphs using loops - addition

LUCINDA M TEAR
I'm sorry, I should have said that I understand that I can produce multiple graphs with the Examine command, but I want to also loop through the categorical /BY variable.

Thank you,

Lucinda
  ----- Original Message -----
  From: LUCINDA M TEAR<mailto:[hidden email]>
  To: [hidden email]<mailto:[hidden email]>
  Sent: Thursday, May 10, 2007 9:57 AM
  Subject: creating multiple graphs using loops


  Hello,

  I am new to programming in SPSS and am wondering if there is a way to produce multiple graphs (in my case today, boxplots) using any kind of loop or repeat statements.  I am using an older version of SPSS (11.5), so have Examine and Igraph for producing boxplots.  It looks like those two commands are not ammenable to loops, but I am not positive.

  Thank you,

  Lucinda Tear
Reply | Threaded
Open this post in threaded view
|

Re: creating multiple graphs using loops - addition

Robert Walker-4
Here's one way, using a macro, and assuming that your EXAMINE variable is
V1:

DATA LIST FREE / V1 TO V4 (4F1).
BEGIN DATA
1 2 3 2
3 2 3 2
1 2 2 2
2 3 1 3
3 2 2 2
1 3 3 2
1 2 1 2
2 1 1 1
3 3 3 3
2 1 2 1
END DATA.

* >> CREATE LOOP USING A MACRO: VLIST = YOUR VAR LIST.
* >> BRACKETS [ ] ENCLOSE YOUR VAR LIST.

DEFINE !TEST (VLIST=!ENCLOSE("[","]"))

* >> MACRO BODY: LOOP THROUGH VALUES IN YOUR VLIST
     ASSUMING THAT V1 IS THE "BY" VARIABLE.

!DO !Z !IN (!VLIST)
EXAMINE VARIABLES= V1 BY !Z
  /PLOT BOXPLOT STEMLEAF /COMPARE GROUP
  /STATISTICS DESCRIPTIVES /CINTERVAL 95 /NOTOTAL.
!DOEND

* >> END MACRO DEFINITION & EXECUTE.
!ENDDEFINE
!TEST VLIST [V2 V3 V4].
-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
LUCINDA M TEAR
Sent: Thursday, May 10, 2007 2:00 PM
To: [hidden email]
Subject: creating multiple graphs using loops - addition

I'm sorry, I should have said that I understand that I can produce multiple
graphs with the Examine command, but I want to also loop through the
categorical /BY variable.

Thank you,

Lucinda
  ----- Original Message -----
  From: LUCINDA M TEAR<mailto:[hidden email]>
  To: [hidden email]<mailto:[hidden email]>
  Sent: Thursday, May 10, 2007 9:57 AM
  Subject: creating multiple graphs using loops


  Hello,

  I am new to programming in SPSS and am wondering if there is a way to
produce multiple graphs (in my case today, boxplots) using any kind of loop
or repeat statements.  I am using an older version of SPSS (11.5), so have
Examine and Igraph for producing boxplots.  It looks like those two commands
are not ammenable to loops, but I am not positive.

  Thank you,

  Lucinda Tear
Reply | Threaded
Open this post in threaded view
|

Re: creating multiple graphs using loops - addition

Melissa Ives
In reply to this post by LUCINDA M TEAR
Couldn't you use SPLIT FILE to do this?

Melissa

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
LUCINDA M TEAR
Sent: Thursday, May 10, 2007 1:00 PM
To: [hidden email]
Subject: [SPSSX-L] creating multiple graphs using loops - addition

I'm sorry, I should have said that I understand that I can produce
multiple graphs with the Examine command, but I want to also loop
through the categorical /BY variable.

Thank you,

Lucinda
  ----- Original Message -----
  From: LUCINDA M TEAR<mailto:[hidden email]>
  To: [hidden email]<mailto:[hidden email]>
  Sent: Thursday, May 10, 2007 9:57 AM
  Subject: creating multiple graphs using loops


  Hello,

  I am new to programming in SPSS and am wondering if there is a way to
produce multiple graphs (in my case today, boxplots) using any kind of
loop or repeat statements.  I am using an older version of SPSS (11.5),
so have Examine and Igraph for producing boxplots.  It looks like those
two commands are not ammenable to loops, but I am not positive.

  Thank you,

  Lucinda Tear


PRIVILEGED AND CONFIDENTIAL INFORMATION
This transmittal and any attachments may contain PRIVILEGED AND
CONFIDENTIAL information and is intended only for the use of the
addressee. If you are not the designated recipient, or an employee
or agent authorized to deliver such transmittals to the designated
recipient, you are hereby notified that any dissemination,
copying or publication of this transmittal is strictly prohibited. If
you have received this transmittal in error, please notify us
immediately by replying to the sender and delete this copy from your
system. You may also call us at (309) 827-6026 for assistance.
Reply | Threaded
Open this post in threaded view
|

Re: creating multiple graphs using loops - addition

LUCINDA M TEAR
In reply to this post by Robert Walker-4
Thank you, Robert!  I'll have to ponder this to be sure I understand.  And,
to Melissa Ives, Now that you mention it, you are right.  I could
restructure the dataset and use split file.

Thank you both.


----- Original Message -----
From: "Robert Walker" <[hidden email]>
To: "'LUCINDA M TEAR'" <[hidden email]>; <[hidden email]>
Sent: Thursday, May 10, 2007 11:13 AM
Subject: RE: creating multiple graphs using loops - addition


> Here's one way, using a macro, and assuming that your EXAMINE variable is
> V1:
>
> DATA LIST FREE / V1 TO V4 (4F1).
> BEGIN DATA
> 1 2 3 2
> 3 2 3 2
> 1 2 2 2
> 2 3 1 3
> 3 2 2 2
> 1 3 3 2
> 1 2 1 2
> 2 1 1 1
> 3 3 3 3
> 2 1 2 1
> END DATA.
>
> * >> CREATE LOOP USING A MACRO: VLIST = YOUR VAR LIST.
> * >> BRACKETS [ ] ENCLOSE YOUR VAR LIST.
>
> DEFINE !TEST (VLIST=!ENCLOSE("[","]"))
>
> * >> MACRO BODY: LOOP THROUGH VALUES IN YOUR VLIST
>      ASSUMING THAT V1 IS THE "BY" VARIABLE.
>
> !DO !Z !IN (!VLIST)
> EXAMINE VARIABLES= V1 BY !Z
>   /PLOT BOXPLOT STEMLEAF /COMPARE GROUP
>   /STATISTICS DESCRIPTIVES /CINTERVAL 95 /NOTOTAL.
> !DOEND
>
> * >> END MACRO DEFINITION & EXECUTE.
> !ENDDEFINE
> !TEST VLIST [V2 V3 V4].
> -----Original Message-----
> From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
> LUCINDA M TEAR
> Sent: Thursday, May 10, 2007 2:00 PM
> To: [hidden email]
> Subject: creating multiple graphs using loops - addition
>
> I'm sorry, I should have said that I understand that I can produce
> multiple
> graphs with the Examine command, but I want to also loop through the
> categorical /BY variable.
>
> Thank you,
>
> Lucinda
>   ----- Original Message -----
>   From: LUCINDA M TEAR<mailto:[hidden email]>
>   To: [hidden email]<mailto:[hidden email]>
>   Sent: Thursday, May 10, 2007 9:57 AM
>   Subject: creating multiple graphs using loops
>
>
>   Hello,
>
>   I am new to programming in SPSS and am wondering if there is a way to
> produce multiple graphs (in my case today, boxplots) using any kind of
> loop
> or repeat statements.  I am using an older version of SPSS (11.5), so have
> Examine and Igraph for producing boxplots.  It looks like those two
> commands
> are not ammenable to loops, but I am not positive.
>
>   Thank you,
>
>   Lucinda Tear
>
>
>
>