Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: assertky available on SSC


From   David Kantor <[email protected]>
To   Statalist <[email protected]>
Subject   st: assertky available on SSC
Date   Mon, 13 Nov 2006 16:15:06 -0500

To all Statalisters:
I want to let you all know that my program -assertky- is available on SSC, thanks to Kit Baum.

This is a very simple little program but may be very useful. It merely sorts the dataset, and asserts that the sort variables uniquely identify all observations, which also means that the sort order is uniquely determined. This can be useful in in preparation for a -merge- or for certain -by- operations. The latter type of situation would be...
by varlist1 (varlist2): ...
where you want to be sure that the combination of varlist1 and varlist2 assure a unique sort. (This construct by itself does not assure a unique sort; I am not aware of any enhancements that may have come along in Stata 9, regarding this matter.)

The functionality can be replicated with -isid ... , sort missok-, but assertky may be easier to use. There are also options for identifying key violations -- finding the problem cases when the assertion fails.

I hope this is useful.
--David Kantor

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index