The time variable must include the time for the end of the follow-up (31 dec 2013), regardless of the outcome. I am going to use age as a time-scale. So, the lowest age of age at;
* ADHD diagnosis
* emigration
* death
* end of follow-up (31 dec 2013)
How am i supposed to create this age-variable? I have the birth -date variable which is the following; bfoddat_SAS = input( put(X_bfoddat,8.), YYMMDD8.); the date is presented as: YYYYMMDD, and is numeric. However i don't know how to create the age variable?
*Variable for emigration*;
if MTYP=:'E' then EM=1;
else EM=0;
mig_year= (SUBSTR(MDATUM,1,4));
mig_year_num =input(mig_year,4.);
age_mig=(mig_year_num-bfodar);
*variabel for death*;
bfoddat_SAS = input( put(X_bfoddat,8.), YYMMDD8.);
dodsdatum_SAS= input (put(X_dodsdatum, 8.),YYMMDD8.);
if dodsdatum_SAS ne . then age_dod=INT(YRDIF(bfoddat_SAS,dodsdatum_SAS,'actual'));