Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Sergiy Radyakin <serjradyakin@gmail.com> |
To | "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |
Subject | Re: st: efficient listing of data, to perform audit |
Date | Fri, 25 Oct 2013 01:38:14 -0400 |
On Fri, Oct 25, 2013 at 12:21 AM, Michael McCulloch <mm@pinestreetfoundation.org> wrote: > I have data of the following structure, with >100 observations, and >200 variables: > > var1 var2 var3 var4 > obs1 1 3 . . > obs2 . . 5 2 > obs3 2 3 1 6 > > Rather than visually browsing the table, and manually typing list var1 var2 for each observation where I visually detect data... Michael is the above sentence complete? I feel something is missing from it. What is it that you are detecting? > > Is there a way to efficiently create a series of lists, something to the effect of: > > . list anyVAR anyOBS? Michael this is not clear. But here are a few examples sysuse auto list ** lists ALL vars and ALL observations list price ** list ONE (any) particular variable for ALL observations list in 10 ** list ALL variables in ONE (any) particular observation list price in 10 ** list ONE variable in ONE observation list price weight if missing(rep78) ** list particular variables in ALL observations satisfying CONDITION You can substitute list for browse in the above if you want to display the results in a scrollable window. Finally, if you mean how to list all the elements of the original dataset that are not missing, consider the -reshape- command. convert from wide to long: clear input var1 var2 var3 var4 1 3 . . . . 5 2 2 3 1 6 end generate id=_n reshape long var, i(id) j(idx) list, sepby(id) keep if !missing(var) list, sepby(id) Produces this: +----------------+ | id idx var | |----------------| 1. | 1 1 1 | 2. | 1 2 3 | |----------------| 3. | 2 3 5 | 4. | 2 4 2 | |----------------| 5. | 3 1 2 | 6. | 3 2 3 | 7. | 3 3 1 | 8. | 3 4 6 | +----------------+ Best, Sergiy Radyakin > > > > Best wishes, > Michael McCulloch > > -- > Pine Street Foundation, since 1989 > 124 Pine Street | San Anselmo | California | 94960-2674 > P: (415) 407-1357 | F: (206) 338-2391 | http://www.PineStreetFoundation.org > > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/faqs/resources/statalist-faq/ > * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/