I am trying to create two age variables for the age at the time of a diagnostic test.
I have a variable BirthD (date of birth) (formatted as %td), and I have the variable Test_Date (date of the diagnostic test) (formatted as dd/mm/yyyy).
The first age variable I am trying to create is age in years and the second age variable I am trying to create is the number of months lived at that time. I am trying to make it so both age variables are rounded down to an integer value (i.e. if someone was 23 months and 12 days at the time, the age in years would be 1, and the age in months would be 23).
Any help with coding for this would be greatly appreciated - I seem to keep running into errors!
I have a variable BirthD (date of birth) (formatted as %td), and I have the variable Test_Date (date of the diagnostic test) (formatted as dd/mm/yyyy).
The first age variable I am trying to create is age in years and the second age variable I am trying to create is the number of months lived at that time. I am trying to make it so both age variables are rounded down to an integer value (i.e. if someone was 23 months and 12 days at the time, the age in years would be 1, and the age in months would be 23).
Any help with coding for this would be greatly appreciated - I seem to keep running into errors!
Comment