Chau Tak Wai
>
> First, thank you very much for the intelligent methods suggested for
> updating my dataset.
>
> Now, I have another problem. I would like to produce an
> error list by
> variable. I try to use the following command variable by variable:
>
> list id x1 if (condition for x1 to have problem)
>
> However, the problem is that, even no observation has
> problem, there are
> still some output. (command and header -- id x1 ) Since there are
> hundreds of variables involved in this household servey and
> the report
> will be very long if I retain those lines. Deleting them
> manually one by
> one is also quite time-consuming. Do you know any more
> efficient methods
> that I can perform the above task?
This is a large area. Two suggestions only:
I like using -assert- to assert what should be true.
You can -capture- its result and -list- conditional
on there being a problem.
capture assert sex == 0 | sex == 1
if _rc {
list sex if !(sex == 0 | sex == 1)
}
Alternatively, tag problems and save the -list-
until later.
gen problem = <x1 shows problem 1>
replace problem = problem | <x1 shows problem 2>
.
.
.
list if problem
Nick
[email protected]
*
* 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/