Date: Wed, 21 Sep 2005 11:00:41 -0700
Reply-To: Kim Jinnett <kjinnett@ibiweb.org>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Kim Jinnett <kjinnett@ibiweb.org>
Subject: Re: syntax for creating new var
In-Reply-To: <000001c5bed1$3de27220$1d02a8c0@dell>
Content-Type: text/plain; charset="US-ASCII"
Dear listers,
I'm trying to create a set of 8 dummy variables from one variable that was
coded with values 1 to 8. I'm having trouble dealing with the missing
values appropriately. If the original variable "intgtype" has a missing
value, I want the new variable to have a missing value as well. Where do I
insert the missing value statement and what should it look like? I'm sure
there is a much more efficient way to write the code below as well.
Thanks, Kim
COMPUTE wstdltd=0.
COMPUTE awstdltd=0.
COMPUTE stdltd=0.
COMPUTE astdltd=0.
COMPUTE whstdltd=0.
COMPUTE awhstltd=0.
COMPUTE hstdltd=0.
COMPUTE ahstdltd=0.
IF intgtype=3 wstdltd=1.
if intgtype=4 awstdltd=1.
if intgtype=1 stdltd=1.
if intgtype=2 astdltd=1.
if intgtype=7 whstdltd=1.
if intgtype=8 awhstltd=1.
if intgtype=5 hstdltd=1.
if intgtype=6 ahstdltd=1.
|