nullifeq

0     0     Edited Sep 1, 2015
Usage 1:
[vector] x nullifeq( [vector]expr, [scalar]val1[, [scalar]val2... ] )

Returns vector x where:
xi is set to null if expri equals any of val1 ... valN.
Otherwise xi is set to expri.

This is commonly used to exclude values such as N/A or Don't Know from the base by converting e.g. 99's to null.

Examples:
nullifeq(income,99)
nullifeq(income,98,99)
pctin(nullifeq(income,98,99),1)


Usage 2:
[scalar]x nullifeq( [scalar]expr, [scalar]val )

Returns null if expr equals val.
Otherwise returns expr.



Leave a Comment

Please sign in to leave a comment.