/* Attitudinal survey. For each respondent, it counts total number */ /* of 3=Agree (A), 4=Strongly Agree (SA), 5=Very Strongly Agree (VSA) */ /*responses, and total number of SA, VSA responses */ data doencount4; input q1-q10; ct4=0; ct5=0; array q q1-q10; do over q; if q ge 4 then ct4+1; *Demo of implicit RETAIN; if q ge 5 then ct5+1; end; datalines; 5 5 4 2 4 4 6 4 3 4 1 1 3 3 2 1 3 6 6 6 5 2 3 2 5 6 5 6 6 3 4 6 6 6 4 3 1 2 2 5 2 1 4 6 3 3 5 4 4 3 3 6 6 2 4 5 3 1 1 5 4 3 4 5 6 5 3 4 3 2 4 1 2 4 3 2 2 3 4 3 3 4 2 4 1 2 1 6 6 4 5 6 4 2 2 6 6 4 6 6 1 4 1 4 2 1 1 3 5 6 5 1 1 1 3 6 6 4 2 6 6 1 5 2 2 5 2 4 5 6 4 2 2 6 2 2 1 3 6 6 4 6 5 3 1 2 3 2 2 5 4 3 4 4 1 3 1 2 5 2 5 3 2 4 2 2 2 5 5 3 6 1 5 4 6 3 4 3 6 4 2 2 3 3 6 2 1 6 4 3 6 4 2 4 5 6 5 6 4 6 ; run; proc print data=doencount4; run; proc freq data=doencount4; table ct4 ct5; run; /* Convert missing values to 0 (absence) for 169 vegetation plots */ /* with a wide variety of prefixes. Rows represent vegetation types */ data distno; set distjacc; array x p10s17p1--pss9p169; do over x; if x=. then x=0; end; run;