I don't know what -dup- and -duplicated- are. Perhaps Sharoon means
-dups- from SJ and the official Stata command -duplicates-.
Neither command is really applicable. Despite the use of the word
"duplicates" here to describe the problem the observations you want to
-drop- are not _defined_ by being duplicates on -id- or on -date- or on
-price- or on two or three of those.
Other posters have given good solutions, so I need not add more.
Nick
[email protected]
Sharooon
I have a data set with the following format:
id date price
1 1 400
2 1 500
2 2 450
2 3 450
3 2 600
3 3 .
Where I have multiple id's observed at different dates, and not
necessarily the same date. What I would like, is to delete all but the
most recent date and fill in the price with the most recent price
observed.
For example:
id date price
1 1 400
2 3 450
3 3 600
Any clues on how to do this? I've played around with dup and duplicated
but still haven't found anything.
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/