|
If she makes the missing individual year codes system missing, my guess is
that the MAX function will return a value of system missing for maxeduc
any time that any of the individual year values is system missing. That is
NOT the same thing as "ignoring" missing values. In order for the max
function to "ignore" missing values in the sense meant by Jessica, I
believe that the MAX
function must treat the individual year missing values as
valid but very small. Similarly, the MIN function would have to treat
missing values as very large.
I am assuming that there is a MIN function, and that either function
"reasons" that the larger of a valid value and a missing value cannot be
determined. -- I used to have to use IF statements to calculate that sort
of thing, back in the stone age when I developed my skills. Indeed I go
back to the area when IF statements would treat the value of any missing
value as a user specified number called "TMISS". (The default was to set
TMISS to zero.) Right around the time of SPSS-X, all of that changed, and
I had to re-write hundreds of SYNTAX commands in order to run my programs.
(Sound familiar?) All that SPSS would have had to do in order to save me
hundreds of hours of work would have been to retain the OPTION of letting
the user specify a TMISS value, but make the default to treat the value as
missing, and return a value for the result of system missing. (Clearly
that would still be quite a useful thing to have available for situations
like Jennifer's. Are you listening, SPSS programmers?) As I said on the PS
of my previous message -- been there; done that!
--- Pow
***************************************************************************
Powhatan J. Wooldridge, Assoc. Professor, Nursing, State Univ. NY at Buffalo
On Wed, 17 Oct 2001 kmcdonald@dmhmrsas.state.va.us wrote:
> You can also use recode to make the variables system missing. User defined
> missing values can only be "ignored" when you can specify missing in the
> command syntax (such as anova), they don't apply to functions.
>
> RECODE educ68 to educ99 (97=SYSMIS) (98=sysmis) (99=sysmis) into newed68 to
> newed99.
> compute maxeduc=max(newed68 to newed99).
> exe.
>
>
> -----Original Message-----
> From: Powhatan J. Wooldridge, Ph.D. [mailto:pjw@ACSU.BUFFALO.EDU]
> Sent: Wednesday, October 17, 2001 5:05 PM
> To: SPSSX-L@LISTSERV.UGA.EDU
> Subject: Re: Compute MAX syntax
>
>
> Since you say that you have no problem computing the maximum value, I will
> just deal with how to have the computer "ignore" your missing value codes
> without returning an answer of system missing any time that any of the
> values you are comparing is missing. (What would happen if you used a
> sequence of IF commands to select the maximum, for example.) The answer is
> simple -- recode your positively numbered missing value codes to
> corresponding negatively numbered codes (thus 99 will become -99, etc.).
> After you've calculated maxeduc, either recode the negatives back to
> positives (what I did when I was using IF commands to make the
> comparisons) or just do new missing values for the individual values (a
> single syntax command will do it).
>
> -- Pow
>
> PS: Be SURE to put in a missing values designation for your computed
> maximum (maxeduc) that specifies that values < 0 for the computed maximum
> AND values > 20 (or whatever) are missing. That way, if ALL the values for
> educ68, educ69, educ70, etc. are missing, the computed maximum will also
> be missing; and if you fail to recode a positive missing value because
> someone mis-typed 91 for 97 (or whatever), it will also be missing.
>
> If you forget to do that, and you're doing a parametric analysis; your
> results will be almost completely meaningless if you treat even a few - 99
> values or plus 99 values as valid. CHECK by running a frequencies table
> for maxeduc, to make ABSOLUTELY sure that you don't have any missing value
> outliers on either the plus or the minus side that are being counted as
> valid.
>
> Been there; done that. :-(
>
> ***************************************************************************
> Powhatan J. Wooldridge, Assoc. Professor, Nursing, State Univ. NY at Buffalo
>
>
> On Wed, 17 Oct 2001, Jessica Kenty wrote:
>
> > HI,
> >
> > I have a syntax question about computing a variable that is the maximum
> > value found for several other variables.
> >
> > 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.
> >
> > Thanks for your help in advance!
> >
> > Jessica
> >
> > Jessica Kenty
> > Research Assistant
> > Assets & Educational Inequality Project
> > Northeastern University
> > Boston, MA
> >
> >
> >
> >
>
>
|