[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

From |
David Kantor <dkantor@jhu.edu> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: RE: RE: highest scalar of a matrix |

Date |
Fri, 06 Jun 2003 11:31:40 -0400 |

At 03:05 PM 6/6/2003 +0100, Joao Pedro W. de Azevedo wrote:

Both Nick Winter & Nick Cox replied.> > I'm looking for a function or a routine in Stata7 which would > > give me the > > highest scalar of a matrix

I would just add a warning. In Nick Winter's program,

> if `M'[`r',`c']>`val' {

> scalar `val'=`M'[`r',`c']

will pick up missing values if any are present in `M', which is possible in Stata 8 (even if your program

states version 7).

Unless you want to count a missing as a maximal value, that condition should be

if ~mi(`M'[`r',`c']) & (`M'[`r',`c'] > `val | mi(`val') ) {

Why did I throw in that condition mi(`val') ? Because `val' is pre-loaded with `M'[1,1], so it, too, may be missing, until it is replaced when the first nonmissing value is encountered.

(Now, given this more robust test, you could pre-load `val' with missing, rather than `M'[1,1].)

I am not familiar with the -matmax- program by Jeroen Weesie, so I don't know whether it takes this approach.

-- David

David Kantor

Institute for Policy Studies

Johns Hopkins University

dkantor@jhu.edu

410-516-5404

*

* 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/

**Follow-Ups**:**RE: st: RE: RE: highest scalar of a matrix***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

**References**:**st: RE: highest scalar of a matrix***From:*"Nick Winter" <nwinter@policystudies.com>

**st: RE: RE: highest scalar of a matrix***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

- Prev by Date:
**st: Stata Software for Generalized Linear Measurement Error models** - Next by Date:
**st: Selecting part of a LARGE file** - Previous by thread:
**st: RE: RE: highest scalar of a matrix** - Next by thread:
**RE: st: RE: RE: highest scalar of a matrix** - Index(es):

© Copyright 1996–2017 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |