Re: st: RE: Stata doesn't complain about non-existent value label

Clyde Schechter--
Whenever you are testing equality, it is up to you to make sure that
both sides of the double equal sign make sense, e.g. have the same
precision (so you don't wind up with a false negative comparing 1 and
1+epsdouble for example). In your case, you might want to check that
the RHS of the == is there, with e.g. -confirm- as illustrated in the
cut-and-paste example here:
conf n `="Alive":live_statusw'
la def live_statusw 1 "Alive"
conf n `="Alive":live_statusw'
On 7/17/08, Nick Cox <n.j.cox@durham.ac.uk> wrote:
> Good question. Here's a stab.
<snip>
> You can't expect a syntax checker to have a data checker in thrall....
>
> Nick
> n.j.cox@durham.ac.uk
>
> Clyde Schechter
>
> This isn't a question--it's a warning about something that bit me, and a
> hope that Stata will change it in the future. (Or perhaps somebody will
> explain why it's actually a useful feature.)
>
> The following command:
>
> gen obs_interval = last_follow_up - first_visit if live_status ==
> "Alive":live_statusw
>
> resulted in obs_interval being set to missing for all observations
> because
> there is no such value label in the dataset as live_statusw.
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/