Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • keeping the last observation only

    I have different individuals and want to keep the last observation only. any commands?

  • #2
    Last observation of each individual? Then try
    Code:
    bysort pid (tim): keep if _n == _N
    where pid is the person's identiffier and tim is a variable that increases with time. Otherwise, if the last observation overall, then try
    Code:
    sort tim, stable
    keep in l

    Comment


    • #3
      Thanks!

      Comment

      Working...
      X