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'));
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.);
Wow, this is confusing. You want the years (age) between this bfoddat_SAS variable and December 31, 2013? You have not stated that explicitly. Is that the question? Or have I misunderstood completely?
Side comment: there's really no point is adding _SAS to a variable name, every variable you use is a SAS variable. Save yourself some typing and save yourself the possibility of typographical errors by not adding _SAS to variable names.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.