Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
Marta García-Granero <mgarciagranero@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: Mata Behaviour for Missing Data and Op. Logic |

Date |
Tue, 11 Jun 2013 12:54:49 +0200 |

Hi Matthew El 11/06/2013 11:53, Matthew McKay escribió:

Dear StataList, I am debugging some MATA code that I have written and I have come across an issue: I am iterating over a list of values: [0 0.2 0.1 .... Etc] and comparing each element with some cutoff level (ie 0.2). I am finding that if there are any missing items in the original list: [0 0.1 . 0.2 0.3]; Then items that are missing evaluate to TRUE when greater than the cutoff. (. > 0.2) -> 1 And evaluates to false when less than the cutoff (. < 0.2) -> 0 I had assumed that if data was 'missing' it would either return 'missing' or return FALSE in both comparison cases! Can anyone explain this to me? (i.e. is missing (.) considered to be infinitely large?)

Yes, that's exactly what happens. From the help for missing: Description Stata has 27 numeric missing values:

and

. list if age > 60 & age < .

. list if age >=. HTH, Marta GG * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/

**References**:**st: Mata Behaviour for Missing Data and Op. Logic***From:*Matthew McKay <matthew.mckay@anu.edu.au>

- Prev by Date:
**Re: st: RE: error with xtset** - Next by Date:
**RE: st: RE: error with xtset** - Previous by thread:
**st: Mata Behaviour for Missing Data and Op. Logic** - Next by thread:
**st: error with xtset** - Index(es):