Statalist


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

Re: st: how to capture data (ID's) for use in macros


From   "Scott Merryman" <scott.merryman@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: how to capture data (ID's) for use in macros
Date   Mon, 12 May 2008 20:43:28 -0500

See -levelsof-

-levelsof id if tag ==0, local(levels)-

Scott

On Mon, May 12, 2008 at 6:58 PM, Jason Ferris <J.Ferris@latrobe.edu.au> wrote:
> Is there a way to capture data, that is similar to r(varlist)?
> For example I have found repeated ID's in 1 dataset of which I want to delete from 5 datasets.
> The code to find these for example:
> egen tag=tag(id)
> tab id if tag==0
>
> id         Freq.    Percent Cum.
> 4          1          25.00    25.00
> 9          2          50.00    75.00
> 21        1          25.00    100.00
> Total     4          100.00
>
> I would like the data 4, 9, 21 to be captured in a macro to be used later (i.e., to delete from other datasets).
> I am using Stata 10 on Dell intel duo.
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index