I have a data-set that is combined from two different datasets, by append. I have a variable for time and date in each of the original datasets, and now I have two variables with time and date. How can I combine these (they have the same format)? And then I want to make a new variable that shows only the year, so I can sort observations within a patientID, on year.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str9 PatientID float(dato2 date2) "1" 19981 . "1" 20394 . "2" 20922 . "2" . 20149 "2" . 19308 "3" . 20579 "3" 19756 . "4" 20579 . "4" . 19471 "4" 19797 . end format %tdCCYY-NN-DD dato2 format %tdCCYY-NN-DD date2
Cathrine
0 Response to Combine two time and date variables, and creating a yearly (readable) variable
Post a Comment