Date: Mon, 17 Jul 2006 16:54:06 -0400
Reply-To: Gene Maguin <email@example.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Gene Maguin <firstname.lastname@example.org>
Subject: Re: mean
Content-Type: text/plain; charset="us-ascii"
There are several ways, I believe, to go at this. Let va1 and vb1 be two
variables from your list of 158. There are two cases to consider. 1) a case
that is missing for va1 is also missing for vb1 and vice versa. 2) case 1 is
If case 1 is true, then you can use Aggregate (which you should read about
in the documentation).
Compute tag=1. /* this is the trick.
Aggregate /outfile=*/break=tag/va1 vb1=mean(va1 vb1).
Do repeat x=va1/y=vb1/z=diff1.
+ compute z=x-y.
If case 2 is true (i.e., case 1 is not true), then, depending on the
following choice, you may have a more difficult job. If va1 is missing for
some cases but vb1 is not, you can either make the missing value status of
va1 and vb1 consistent on a case-by-case basis or ignore that inconsistency.
Making the missing value status consistent means modifying the dataset so
that case 1 is true.
To do that (enforce consistency), insert this code before the 'trick'
Do repeat x=va1/y=vb1.
+ if (sysmis(va1)) vb1=$sysmis.
+ if (sysmis(vb1)) va1=$sysmis.
If case 1 is true or missing value status consistency doesn't matter, then
another way might be to use the OMS commands to export the output of a
descriptives command and then operate on that new dataset. However, I have
not done this. Someone else can comment.