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" <[email protected]>
To   [email protected]
Subject   Re: Re: st: How to loop over non-integers?
Date   Sun, 10 Jun 2007 15:57:53 -0500

On 6/10/07, [email protected] <[email protected]> wrote:
<snip>
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
<snip>

You could try:

sort  W
scalar alpha_hat = alpha[1]

or

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


Scott
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index