Hello, upon a question in a practice exam, I am stumped on this: Open the existing program, program48.sas from folder C:\cert\errors. At any time, you may save your corrected program as program48 in C:\cert\programs. This program is intended to: Create 3 groups for Cvar: A-G is Group=1; H-N is Group=2; O-Z is Group=3 . All variations of the variable should be in the same group, i.e. “A” and “a” should be in Group=1. Calculate the average of X and Y by Group. Here is my code below: data groups;
set cert.input48;
if upcase(cvar) in ('A','B','C','D','E','F','G') then group=1;
else if upcase(cvar) in ('H','I','J','K','L','M','N') then group=2;
else group=3;
format y 10.;
run;
/* Calculate the average of X and Y by Group */
/* What is the average of X and Y for Group 2? */
proc means data=groups MEAN maxdec=2;
class group;
var x y;
run; Upon running this, I get: 1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 72 73 proc means data=groups MEAN maxdec=2; 74 class group; 75 var x y; ERROR: Variable y in list does not match type prescribed for this list. 76 run; NOTE: The SAS System stopped processing this step because of errors. NOTE: PROCEDURE MEANS used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 77 78 79 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 91 I've tried converting y to numeric but I do not know if this was the right move. Any help is appreciated. Thank you!
... View more