I have a longituidnal data (Called as SBP & DBP which are contineous variables)- which is collected on different dates and the date variable looks like 10SEP2010. I have sample ID for each patient.
I would like to classify first measurement of SBP, DBP of each observation into one dataset and last measurement of SBP, DBP of each observation into another dataset.
How can I do this?
Browse source dataset by patient_ID and sampling_date. Output first record of a group to one dataset and the last to another. something like code below.
data destination_dataset1 destination_dataset2;
by patient_id sampling_date;
if first.patient_id then output destination_dataset1;
if last.patient_id then output destination_dataset2;
"first" / "last" refer to a subgroup which means ordering. Your code does not browse the data set in an ordered manner (you should have a "by ... " clause in it.
I'd suggest you should read a little bit the basics to understand the mechanisms behind:
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.