Saturday, October 8, 2016

Finding First and Last Observations

  • In a drug dataset, records are available of patients taken drugs on different days. 
  • We want to find out what was the first visit of the patient and last visit of the patient and check his weight.
  • Steps to find out first and last observations:
    • Sort the drug dataset by patient isr.
    • Use Set and By and find the first and last observations.
    • The First and Last observations will be available as new columns with values 1 in the newly created dataset.
  • Remember, You have to "use a BY statement, in conjunction with a SET statement, to identify the first and last observations among a group of observations".

No comments:

Post a Comment