I was able to create a new variable called 'Age' which = number of years of age the person was at the time of symptoms onset using this code:
data Age;
set HospitalDays;
Age = (dateSymptoms - DOB);
format Age years.
run;
It worked perfectly! however, even when I used format Age years. the numbers are displayed as days from DOB to symptoms vs years.
Formats won't get the job done in this case. They can display dates as year, but your variable Age is not a date.
In an earlier thread, you said your lab asked you to use a specific function to do this. What function was it, and did you try that? If not, please try it.
Formats won't get the job done in this case. They can display dates as year, but your variable Age is not a date.
In an earlier thread, you said your lab asked you to use a specific function to do this. What function was it, and did you try that? If not, please try it.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.