Statalist The Stata Listserver

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

Re: Re: st: How to loop over non-integers?

From   "Scott Merryman" <>
Subject   Re: Re: st: How to loop over non-integers?
Date   Sun, 10 Jun 2007 15:57:53 -0500

On 6/10/07, <> wrote:
The code below nearly gets there. From the plot of the Wald statistic
against alpha, the smallest element of alpha (on this coarse grid) is
alpha_hat = 29. I could

not work out how to use the minimum function to extract this value. I tried
things like --- scalar alpha_hat = min(alpha) --- but that won't work.
What's the trick

You could try:

sort  W
scalar alpha_hat = alpha[1]


sum W, meanonly
if W == r(min) {
	 scalar alpha_hat = alpha

*   For searches and help try:

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