nullifeq
0
0
Edited Sep 1, 2015
Usage 1:
[vector]
x
←
nullifeq(
[vector]expr,
[scalar]val1[,
[scalar]val2... ]
)
Returns vector x where:
x
i is set to
null if expr
i equals any of val
1 ... val
N.
Otherwise x
i is set to expr
i.
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.