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.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.