NVALID / NMISS on STRING variables

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

NVALID / NMISS on STRING variables

Jignesh Sutar
If MISSING VALUES can be defined on STRING variables then why do NMISS and NVALID accept only NUMERIC variables and not allow for STRING variables?


get file="C:\Program Files\IBM\SPSS\Statistics\22\Samples\English\Employee data.sav".
freq gender.
missing values gender ("f").
freq gender /* Note gender is classified correctly assigned under missing */.

compute Check1=nvalid(gender). 
 
 * >Error # 4310 in column 29.  Text: ) 
>The numeric argument required for the function specified was not supplied. 
 * >Execution of this command stops. 

compute Check2=nmiss(gender). 
 
 * >Error # 4310 in column 28.  Text: ) 
>The numeric argument required for the function specified was not supplied. 
 * >Execution of this command stops.



From CSR:

NMISS. NMISS(variable[,..]). Numeric. Returns a count of the arguments that have system- and
user-missing values. This function requires one or more arguments, which should be variable names inthe active dataset.

NVALID. NVALID(variable[,..]). Numeric. Returns a count of the arguments that have valid, nonmissing values. This function requires one or more arguments, which should be variable names in the active dataset.
===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD