Date: Tue, 22 May 2001 15:39:59 -0400
Reply-To: Mark Casazza <casazzam@ADELPHI.EDU>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Mark Casazza <casazzam@ADELPHI.EDU>
Subject: Re: Easy compute problem.
Content-Type: text/plain; charset="Windows-1252"
Hi Diane,
As long as you ran the execute after the compute it should work. However,
depending on how many missing values you have, it could be that all of your
aggregate data is missing as a result of how you defined the missing and how
you did the compute. SPSS has two ways to add variable values and they
produce different results. For example, if you write:
compute v1=v2+v3+v4.
and any of the constitutent variables (v2, v3, v4) are missing v1 will be
missing. If you write:
compute v1=sum(v2, v3, v4).
variables with missing values will be ignored and v1 will be the sum of
variables with valid values. Also as a time saver, if all of your variables
are next to each other in the data set, you could use:
compute v1=sum(v2 to v4).
HTH
Mark V. Casazza
Office of Research, Assessment & Planning
Adelphi University
Levermore Hall, #307
Garden City, NY 11530
phone: (516) 877-3231
fax: (516) 877-3237
email: casazza@adelphi.edu
"Those who cast the votes decide nothing.
Those who count the votes decide everything."
-Joseph Stalin
----- Original Message -----
From: "Cohen,Diane" <dc42@EXCHANGE1.DREXEL.EDU>
Newsgroups: bit.listserv.spssx-l
To: <SPSSX-L@LISTSERV.UGA.EDU>
Sent: Tuesday, May 22, 2001 10:41 AM
Subject: Easy compute problem.
> Dear Listserve: I want to obtain a total number of symptoms of various
> listed illneses. The target variable is hsx5yrs. The list consists of 19
> symptoms (hsa97 through hsa115). This is the syntax I created:
> COMPUTE hsx5yrs = hsa97 + hsa98 + hsa99 + hsa100 + hsa101 + hsa102 +
hsa103
> + hsa104 + hsa105 + hsa106 + hsa107 + hsa108 + hsa109 + hsa110 + hsa111 +
> hsa112 + hsa113 + hsa114 + hsa115 .
> EXECUTE .
>
> It worked the first time, but I added cases and wanted to run it again.
It
> no longer works. The only change I made was to change missing values from
> "0" to "9".
>
> I tried the syntax COMPUTE hsx5yrs = hsa97 thru hsa115. Didn't work. In
> addition, I wrote a new syntax as above to compute hsb97 thru hsb115 which
> also didn't work.
>
>
> Any ideas why it worked the first time but won't any longer?? By the way,
> the cells are not blank after "run". They have a "." inside.
>
> Diane deNewbie
>