Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Missing values and functions

34 views
Skip to first unread message

Hari

unread,
Dec 13, 2005, 4:33:31 AM12/13/05
to
Hi,

I have seen the 4 functions Missing, Sysmis (both kind of boolean in
nature) and Nmiss and Nvalid in SPSS PDF document.

Usually if I want to compute a new variable equal to sysmis, then I
write

Compute Flag = $sysmis.
exe.

On the other hand if I want to recode a particular value in a
particular variable to sysmis I would use

recode F (97 = sysmis).
exe.

Also I can use

Count Flag3 = w e r t (sysmis).
exe.

for counting number of system missing values in variables w, e, r and t
(I know I can use Nmiss here)

My doubt is as to why we use a "$" sign in front of sysmis in compute
syntax while no such dollar in case of recode, count syntax etc?

Again if i want to put 45 in a variable gh if variable e has system
missing values then if can be used as

if (sysmis(e)) Gh = 45.
exe.

In case of If syntax why couldnt we have something like
if (e = $ sysmis) gh = 45.

The above if syntax (similar to using a $ in compute syntax) doesnt
yield an error but neither does it make gh = 45 when e is system
missing.

Also, we have Nmiss for counting system values and Nvalid for counting
valid values (by running some syntaxes I see that 'valid" stands for
non-system missing values and hence 'valid' includes user defined
values also for counts). Dont we have an equivalent function for
counting values which are neither user nor system missing?

Now let's say I want to count number of user or system missing values
in a range of variables.
I can do it in 2 ways:-

a) compute fwerg1 = nmissing (w,e).
exe.

b) count fwerg2 = w e (missing)
exe.

Now the number of Non-zero observations in fwerg1 or fwerg2 would give
us the answer. My doubt is while writing a) the argument list was
delineated by commas (as specified in PDF) but for b) the various
variables have been delineated by a space. Why does SPSS have different
rules for specifying list of variables in different syntaxes?

Regards,
Hari
India

JKPeck

unread,
Dec 14, 2005, 9:31:43 AM12/14/05
to
SPSS has functions, such as MISSING(...) that can be used in general
transformation expressions in Compute etc and that in most cases allow
expressions as arguments.

It also has special variables such as $SYSMIS, $DATE etc that can be
used in transformation expressions. They have a $ prefix in order to
distinguish them from user variables, since the context is otherwise
not sufficient for this. Where keywords appear such as in RECODE,
these are keywords - neither variables nor expressions.

Regards,
Jon Peck
SPSS

0 new messages