Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Missing Values in Matrices


From   wgould@stata.com (William Gould)
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Missing Values in Matrices
Date   Wed, 25 Sep 2002 08:04:44 -0500

Nick Winter <nwinter@policystudies.com> reports, 

> I accidentally stumbled on the following behavior, in which Stata seems
> to be allowing a missing value in a matrix:
> [...]
>        . mat x=1e309
>
>        . mat list x
>
>        symmetric x[1,1]
>                c1
>        r1  1.#INF
>
>        . di x[1,1]
>        .
>
>        . gen myvariable=x[1,1]
>        (1141 missing values generated)
> [...]
> Does this work on other platforms?  Is this supported behavior?

While I am very sympathetic to Nick's desire to store missing values in
matrices, I was not aware of the above and it should be treated as a bug --
something we at StataCorp need to fix -- and not a feature.

What is in fact being stored in the matrix is a NaN and, in the -generate-
follow on -- where missing values are expected -- Stata's NaN protection code
is detecting the NaN and converting it to a missing value.  Somehow that NaN
snuck through matrix assignment, however, and unfortunately, the other matrix
routines are not up to dealing with it.

-- Bill
wgould@stata.com
*
*   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