This is my code - Unfortunately when I tried to run the new variable, it did categorize it but it did not rename them in proc format *Creation of a new categorical from Quantitative; data Work.IMPORT; set work.IMPORT; if 1 <=age <=17 then AgeN="1"; else if 18 <=age <=39 then AgeN="2"; else if 40<=age <=55 then AgeN="3"; else if age >=56 then AgeN="4"; run; *Step 2; proc format; value AgeFormat 1='Adolescent' 2='Young Adult' 3='MiddleAge' 4='Older Adult'; run; *Step 3; data WORK.IMPORT; set WORK.IMPORT; format AgeN AgeFormat.; run; proc freq data=Work.import; title "Table 5 :Frequency Table of New Categorical AgeC"; tables AgeN; run; *Bar Chart of New Categorical Variable AgeC; PROC sgplot DATA = work.import; VBAR AgeC/ datalabel stat=percent fillattrs=(color=grey); TITLE1 "Figure 7: Relative Frequency Bar Chart of New Categorical AgeC"; xaxis label='AgeC' labelattrs=(size=12); yaxis label='Percentage of Victims Killed by Police' labelattrs=(size=12); RUN;
... View more