OPTIONS PS=66 LS=64 NODATE NONUMBER; *********************************************************; *** Two factor ANOVA data with unbalanced cell counts ***; *********************************************************; *** Method I ***; DATA in; INPUT size $ color $ anxiety @@; CARDS; S R 160 S Y 134 S G 104 S B 86 S R 155 S Y 139 S G 175 S B 71 M R 175 M Y 150 M G 83 M B 110 M R 152 M Y 156 M G 89 M B 87 M R 167 M Y 159 M B 100 L R 180 L Y 170 L G 84 L B 105 L R 154 L Y 133 L G 86 L B 93 L R 141 L Y 128 L G 83 ; TITLE 'Reading in unbalanced data -- Method I'; PROC SORT DATA=in; BY size color; PROC PRINT DATA=in; *** Method II ***; DATA in; DO size = 'S', 'M', 'L'; DO color = 'R', 'Y', 'G', 'B'; DO rep = 1 to 3; input anxiety @@; IF anxiety NE . THEN OUTPUT; END; END; END; KEEP size color anxiety; CARDS; 160 155 . 134 139 . 104 175 . 86 71 . 175 152 167 150 156 159 83 89 . 110 87 100 180 154 141 170 133 128 84 86 83 105 93 . ; TITLE 'Reading in unbalanced data -- Method II'; PROC SORT DATA=in; BY size color; PROC PRINT DATA=in; RUN;