I have a dataset where patients have specific ID-numbers. They also have one specific ID for every time they have been admitted to the hospital, which means that there are several of the same ID's but with different dates. I only need the first admission, so i need to figure out how i drop all variables with the same ID except the ID-number with the first admission. I hope that makes sense and that you can help. Thank you.
Example:
ID: 0000012354 Admissiondate: 04 mar 13
ID: 0000012354 Admissiondate: 07 jun 14
ID: 0000012354 Admissiondate: 12 jan 16
All the best
Jonas
Related Posts with How do i drop all dates, except the earliest date for specific ID variables
Renaming every 3 variableHi, I am trying to rename every three variable in my dataset such that the first three variable X1 X…
Time invariant variables in hybrid modelDear all, I am studying on the determinants of labour productivity and I am using the hybrid model…
Creating an IF or Conditional commandHi All, It is my first time in this forum and I'm hoping you will be able to assist me. My study i…
Lee bounds with multiple treatment groupHi, I'm working with a dataset with high attrition rate and am considering using Lee bounds to esti…
ITSA command - stationarityHello all, I am using the -itsa- command for a time series regression with covariates. My time seri…
Subscribe to:
Post Comments (Atom)
0 Response to How do i drop all dates, except the earliest date for specific ID variables
Post a Comment