Using the NMISS Function in SAS and SPSS


    To delete subjects from an analysis if they are missing data on any of a set of variables, use SAS's NMISS function. For example, in the below program I exclude from the data set any case that is missing data on any of the dependent variables in the three univariate analyses that are done.

data sol; infile 'D:\Old-Data\JURY91\jury91.dat';
input crime 1 pa 2 sd 3 ss 4 sent 5-6 serious 7 phyattr 13;
IF NMISS(OF SENT SERIOUS PHYATTR) > 0 THEN DELETE;
proc glm; class crime pa sd; model phyattr serious sent=crime|pa|sd / ss3;

    One can also use the MANOVA option in PROC GLM to exclude subjects that are missing data on any of the dependent variables, as illustrated in the below program.

data sol; infile 'jury91 data *';
input crime 1 pa 2 sd 3 ss 4 sent 5-6 serious 7 phyattr 13;
proc glm MANOVA; class crime pa sd ss;
model phyattr serious sent=crime|pa|sd|ss / ss3;

    NMISS can also be used to modify the operation of SAS functions. See The SUM and MEAN Functions in SAS and SPSS.


    In SPSS the MEAN function allows one to specify that a result is calculated only for cases with a certain minimum of nonmissing values. It is written: MEAN.n(VAR1,VARn).

Back to the SAS Help Page

Back to the SPSS Links Page

Visit Karl's Index Page


Contact Information for the Webmaster,
Dr. Karl L. Wuensch



This page most recently revised on 24. March 2005.