Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 73283

How to check if I have duplicates without perfectly duplicated obs

$
0
0
Dear All,

I am a long data, with duplicated IDs, as there are obs for different dates. I would like to check if there are difference between the variables for each ID and Date (as my title say: duplicates without perfectly duplicated obs)

Code:
  
 input id date char1 char2 char3 char4
1 1/1/2009 4 5 4 0  
1 2/22009 4 5 5 10
1 3/3/2009 4 5 4 10
1 4/4/2009 4 5 4 10
 1 5/5/2009 4 5 4 10  
end
I have tried to use duplicates, but I have more than 40 variables, so it is practical to use

I have also tried to use collapse (checked the help in stata) but don't know if its the correct way to go.

Code:
ds date, not
collapse (lastnm) `r(varlist)', by(date)
Thank you for your help in advance.

Viewing all articles
Browse latest Browse all 73283

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>