How do I confirm that a variable exists with exactly the name I state, not
as an abbreviation? If I say -cap confirm var x3- but I have a variable
x30, then I get _rc==0 even though x3 does not exist.
I'll give the context, in case there's a better way. Here's what I am
trying to do:
forval i=1/52 {
cap confirm var x`i'
if _rc!=0 gen x`i'=.
}
This NEARLY works...
==========================================================
Dr Keith B.G. Dear
Senior Fellow in Biostatistics
National Centre for Epidemiology and Population Health (NCEPH)
The Australian National University
Canberra, ACT 0200, Australia
Tel: 02 612 54865, Fax: 02 612 50740 http://nceph.anu.edu.au/Staff_Students/staff_pages/dear.php
CRICOS provider #00120C