| Date: | Wed, 27 Feb 2002 11:07:00 -0000 |
| Reply-To: | Chris Stride <C.B.Stride@sheffield.ac.uk> |
| Sender: | "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU> |
| From: | Chris Stride <C.B.Stride@sheffield.ac.uk> |
| Subject: | macro question |
| Content-type: | text/enriched; charset=US-ASCII |
<color><param>0100,0100,0100</param>Hi,
I'm trying to write macro to perform crosstabulations of and non-par
difference tests between a series of pairs of items.
e.g.
time 1 measurements; x1 y1 z1,
time 2 measurements; x2 y2 z2
So far I've written the following macro which works for a single pair
of items:
DEFINE !USECHA1 (TIME1 !TOKENS(1) / TIME2 !TOKENS(1))
crosstabs !TIME1 by !TIME2 /cells = count row col /stats = chisq.
NPAR TEST /WILCOXON=!TIME1 with !TIME2 (PAIRED) /SIGN=
!TIME1 with !TIME2 (PAIRED) /MISSING ANALYSIS.
!ENDDEFINE.
However I'd like to extend this so that I can put lists of time 1 and
time 2 items in. I've got as far as
DEFINE !USECHA3 ( TIME1 !CHAREND ('/') / TIME2 !CMDEND ).
crosstabs !TIME1 by !TIME2 /cells = count row col /stats = chisq.
NPAR TEST /WILCOXON=!TIME1 with !TIME2 (PAIRED) /SIGN=
!TIME1 with !TIME2 (PAIRED) /MISSING ANALYSIS.
*!ENDDEFINE.
... but the obvious problem with this is the crosstab bit: if I run
usecha3 time1 = x1 y1 z1 / time2 = x2 y2 z2
I end up with crosstabs of x1 by each of x2, y2 and z2, y1 by each
of x2, y2 and z2 etc, cos unlike the NPAR test command I can't
specify 'pairs' of items for CROSSTABS.
Can anyone see a way I can get this to work in the way I want - I
guess the answer lies via looping but I can't get beyond that!
cheers
Chris
<nofill>
C.B.Stride@Sheffield.ac.uk
*** daytime: 0114 2223262 ***
*** FAX: 0114 2727206 ***
"Watford FC Supporters - South Yorkshire branch"
|