|
Technical Report #11: Calculating Complete-case Analysis Sample Size Bruce Ratner, Ph.D. The problem of missing values is well known to data analysts. And, it is always important to know beforehand the Complete-case Analysis Sample Size for variables under consideration. The SAS-code program, below, provides a quick way to calculate the latter sample size. ********** SAS-code Program ********** data IN; input ID 2. GENDER $1. MARITAL $1.AGE 2. INCOME 3.; cards; 01MS23123 02MM32345 03M 234 04 34 05FS 08FM34234 07F 237 08 M35 09 S 234 10MD ; run; data IN; set IN; MISSING_GENDER=MISSING(GENDER); MISSING_MARITAL=MISSING(MARITAL); run; data IN; set IN; NO_MISSING_NUMERIC_VARS=NMISS(AGE , INCOME ); NO_MISSING_CHAR_VARS =MISSING_GENDER+MISSING_MARITAL; NO_MISSING_VARIABLES=NO_MISSING_NUMERIC_VARS+NO_MISSING_CHAR_VARS; proc freq data=IN;table NO_MISSING_VARIABLES; run; The Complete-case Analysis Sample Size is the frequency count corresponding to NO_MISSING_VARIABLES = 0. 1 800 DM STAT-1, or e-mail at br@dmstat1.com. |
|