Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: slow execution of duplicates drop varlist, force

From   Kristoffer Milonas <>
To   "" <>
Subject   st: slow execution of duplicates drop varlist, force
Date   Tue, 26 Jun 2012 15:16:52 +0000

Dear list users,
I wonder why the syntax duplicates drop varlist,force takes so long time on large datasets compared to doing it manually. 

Suppose for instance that varlist is groupvar1 groupvar2 ... groupvark. It seems to me that I can then drop duplicates manually by typing 
sort groupvar1 ... groupvark
keep if groupvar1!=groupvar1[_n-1] | ... | groupvark!=groupvark[_n-1].

The latter is much faster when I try (using both versions 10 and 11 of Stata). Am I missing some finer points that the duplicates drop command takes into account?


Kristoffer Milonas

Ph.D. Student in Finance
Stockholm School of Economics

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index