Date: Thu, 18 Oct 2001 08:10:56 -0400
Reply-To: Richard Ristow <wrristow@MINDSPRING.COM>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Richard Ristow <wrristow@MINDSPRING.COM>
Subject: Re: Compute MAX syntax
In-Reply-To: <NFBBKGPILJJLBEFGFEFEAEKOCAAA.jkenty@lynx.neu.edu>
Content-Type: text/html; charset="us-ascii"
<html>
At 03:03 PM 10/17/2001 -0400, Jessica Kenty wrote:<br>
<br>
<blockquote type=cite class=cite cite><font face="arial" size=2 color="#0000FF">I
have a syntax question about computing a variable that is the maximum
value found for several other variables. </font><br>
<br>
<font face="arial" size=2 color="#0000FF">I want to find the maximum
years of education for individuals in my longitudinal file
(1968-1999). People are not asked their "highest level of
education" every year though, so no one variable is ever a complete
education intake for any given year. I need to pull the highest
value reported over time to compute a variable called
"maxeduc". (i.e. max (educ68, educ69,
educ70...educ99) ) This is relatively simple, except I have
"missing values" of 97, 98, 99 -- so some people who have an
instance of missing data end up with a maxeduc = 97, 98, or 99. How
do I take the max, but tell SPSS to ignore values that = 97, 98, 99 which
are missing? Note: I have already denoted these values as
"missing values" for these variables in SPSS & that did not
make a difference when pulling the max value.</font></blockquote><br>
Hmmmm. Actually, MAX is clearly documented as taking the maximum of the
VALID values of its arguments -- from the HELP files,<br>
.
<dl>
<dd>MAX(value,value[,...]) Numeric or string. Returns the maximum value
of its arguments that have valid values. This function requires two or
more arguments. You can specify a minimum number of valid arguments for
this function to be evaluated.<br><br>
</dl>Further, it will return the maximum of the valid values even if some
arguments are missing.<br><br>
I just tried it on a very simple test set, and it works as
documented.<br><br>
To debug, try creating MAXEDUC, as you've done, and saving the resulting
file. Then,<br><br>
* DISPLAY DICTIONARY on your data, or simply check the definitions for
your EDUCyy variables, to make sure that 97, 98 and 99 are set as missing
values for all of them<br><br>
* Filter or select cases where MAXEDUC is 97, 98, or 99, and list values
of the EDUCyy variables and MAXEDUC for these cases.<br><br>
It's not clear what is happening to you, but this should shed some
light.<br><br>
-Richard Ristow</html>
|