Hi,
This might be very simple but I will like to find the median (IQR) of an age variable. The age variable is in character format and the code is three digits. Here is an example:
data have;
input Age $;
datalines;
042
043
055
035
065
066
070
098
;
run;
I thought about removing the 0 before converting data to numeric but I don't know how. Is this a meaning idea ?
data have;
input Age $;
datalines;
042
043
055
035
065
066
070
098
;
run;
data have1;
set have;
AgeNum=input(Age,3.);
run;
proc means data=have1 median qrange fw=8;
var AgeNum;
output out=want median= qrange= / autoname;
run;
/* end of program */
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.