Statalist


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

RE: st: RE: RE: tokenize and missing


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: RE: RE: tokenize and missing
Date   Tue, 29 Jan 2008 18:08:27 -0000

-listmissing- as specified takes options of -list-, which gives you some
scope for tuning what is displayed. 

It would be quite easy to add your own option to -list- other variables
too. As you say, the best way to get exactly what you want is, long
term, to program it yourself. 

Nick 
[email protected] 

Ronnie Babigumira

Thanks Nicks

This is similar to the Maarten's first solution (albeit without using
-nmissing-). However, what I really wanted was

1. Identify and list the variables that are missing (your -listmissing-
proposed below does this)
2. However, restrict the maximum number of variables listed per batch to
5 (fits the display)
3. To be able to list some other variables in addition to the missing
cases (such as the unit identifier e.g

-listmissing idcode -

idcode age educ
1	0	.
2	.	1


For now, Maartens code has been the [expletive deleted]. However, I can
see much promise in marrying the two. I can also see that 
it is finally time for me to do that which I have put off for forever,
start doing some stata programming. Guess it is 
time to enroll in a netcourse

Ronnie



Nick Cox wrote:
> Bug fix: 
> 
> *! NJC 1.0.1 28 January 2008 
> program listmissing	
> 	version 8 
> 	syntax [varlist] [if] [in] [, *] 
> 	marksample touse, novarlist 
> 	qui count if `touse' 
> 	if r(N) == 0 error 2000 
> 
> 	qui foreach v of local varlist { 
> 		count if `touse' & missing(`v') 
> 		if r(N) local vlist `vlist' `v' 
> 	} 
> 
> 	local Vlist : subinstr local vlist " " ",", all 
> 	list `vlist' if missing(`Vlist'), `options'  
> end
> 

*
*   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