LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (October 2001)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To: Jessica Kenty <jkenty@LYNX.DAC.NEU.EDU>
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> &nbsp; <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.&nbsp; </font><br> &nbsp;<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).&nbsp; People are not asked their &quot;highest level of education&quot; every year though, so no one variable is ever a complete education intake for any given year.&nbsp; I need to pull the highest value reported over time to compute a variable called &quot;maxeduc&quot;.&nbsp; (i.e.&nbsp; max (educ68, educ69, educ70...educ99) )&nbsp; This is relatively simple, except I have &quot;missing values&quot; of 97, 98, 99 -- so some people who have an instance of missing data end up with a maxeduc = 97, 98, or 99.&nbsp; How do I take the max, but tell SPSS to ignore values that = 97, 98, 99 which are missing?&nbsp; Note:&nbsp; I have already denoted these values as &quot;missing values&quot; for these variables in SPSS &amp; 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>


Back to: Top of message | Previous page | Main SPSSX-L page