using a loop with CTABLES?

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

using a loop with CTABLES?

pbrewster@hotmail.com -
Hi all, I am trying to write code to create the same table that shows the
mean of DV for each value of several IVs (IV1..IVn).  The CTABLE code to do
this for IV1 is:

CTABLES
  /VLABELS VARIABLES=IV1 DV
  /TABLE IV1>DV [MEAN]
  /CATEGORIES VARIABLES=IV1 ORDER=A KEY=VALUE EMPTY=EXCLUDE.

What I would like to do is give SPSS the list of IVs (IV1..IVn ) and have it
produce this table for each: IV1 against DV, then IV2 against DV, and so
on....

How do I do this?

_________________________________________________________________
The MSN Entertainment Guide to Golden Globes is here.  Get all the scoop.
http://tv.msn.com/tv/globes2007/?icid=nctagline2
Reply | Threaded
Open this post in threaded view
|

Re: using a loop with CTABLES?

Mike P-5
Hi Paul,

I think you'll want something like this... (untested)

DEFINE !CTABS (IV1 = !CMDEND)
CTABLES
  /VLABELS VARIABLES=!IV1 DV
  /TABLE !IV1>DV [MEAN]
  /CATEGORIES VARIABLES=!IV1 ORDER=A KEY=VALUE EMPTY=EXCLUDE.
!ENDDEFINE.

!Ctabs TOT IV1 = n_1 n_2 n_3 .


i.e. a list of all iv's that you want

HtH

Mike

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Paul -
Sent: 20 January 2007 19:51
To: [hidden email]
Subject: using a loop with CTABLES?

Hi all, I am trying to write code to create the same table that shows
the mean of DV for each value of several IVs (IV1..IVn).  The CTABLE
code to do this for IV1 is:

CTABLES
  /VLABELS VARIABLES=IV1 DV
  /TABLE IV1>DV [MEAN]
  /CATEGORIES VARIABLES=IV1 ORDER=A KEY=VALUE EMPTY=EXCLUDE.

What I would like to do is give SPSS the list of IVs (IV1..IVn ) and
have it produce this table for each: IV1 against DV, then IV2 against
DV, and so on....

How do I do this?

_________________________________________________________________
The MSN Entertainment Guide to Golden Globes is here.  Get all the
scoop.
http://tv.msn.com/tv/globes2007/?icid=nctagline2

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. For more information on a proactive anti-virus
service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________