Statalist The Stata Listserver


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

Re: Re: st: shorthand


From   "Austin Nichols" <austinnichols@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: Re: st: shorthand
Date   Mon, 5 Jun 2006 10:17:52 -0400

...
You could also use -egen n=rownonmiss(a10*) [, strok]- and -list if
n==0- or see -help mf_missing- and related links.

On 6/5/06, Austin Nichols <austinnichols@gmail.com> wrote:
Timothy Mak--
If you wind up with logical==0 everywhere, you might have included a
string variable in your varlist... try also

gen byte allmiss = 1
ds a10*
foreach v in `r(varlist)' {
 qui replace allmiss = 0 if !mi(`v' )
 }
list if allmiss==1

but are you sure you want to list all variables in all observations
where all a10* are missing?  You will be listing a lot of dots...
maybe you want to

gen byte allmiss = 1
qui ds
local allvars `r(varlist)'
qui ds a10*
local avars `r(varlist)'
local tolist: list allvars - avars
foreach v of local avars {
 qui replace allmiss = 0 if !mi(`v' )
 }
list `tolist' if allmiss==1
*
*   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