Code: Program Data have; infile cards dsd; length County_FIPS $5. Survey_Question $11.; input County_FIPS$ Survey_Question$; cards; 22001,1 (yes) 22001,1 (yes) 22001,2 (no) 22001,1 (yes) 22003,9 (refused) 22003,1 (yes) 22003,1 (yes) 22005,1 (yes) 22005,2 (no) ; proc sql; select County_FIPS,sum(Survey_Question contains 'no')/count(*) as per format=percent8.2 from have group by County_FIPS; quit; Log: Program Notes (3) 1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 53 54 Data have; 55 infile cards dsd; 56 length County_FIPS $5. Survey_Question $11.; 57 input County_FIPS$ Survey_Question$; 58 cards; NOTE: The data set WORK.HAVE has 9 observations and 2 variables. NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 68 ; 69 proc sql; 70 select County_FIPS,sum(Survey_Question contains 'no')/count(*) as per format=percent8.2 71 from have 72 group by County_FIPS; 73 quit; NOTE: PROCEDURE SQL used (Total process time): real time 0.02 seconds cpu time 0.03 seconds 74 75 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 85 Results: Program 22001 25.00% 22003 0.00% 22005 50.00%
... View more