cd "C:\Users\GagaLee\Desktop\ga"
local ff : dir . files "*.dta"
dis `"`ff'"'
mat ga=J(48,2,.)
local x=1
foreach i of local ff {
use `i'
local N=_N
forvalue a=1(1)`N'{
sum vo2_2 if inrange(_n,`a',(`a'+30))
local xxx=r(sd)/r(mean)
mat ga[`x',1]=`a' if inrange(`xxx',0,0.15)
mat ga[`x',2]=r(mean) if inrange(`xxx',0,0.15)
if inrange(`xxx',0,0.15) break
}
local ++x
}
Related Posts with How to jump out a forvalue loop after finding a specific value ?
VECM - Johansen test and derivation of Cointegration Ecuation.Greetings again Stata Users. I'm here with a probably dumb question, but stills a question. How to …
Is Stata 16 coming out anytime soon ?Hi, I'm now using an older version of Stata(11) and planning to purchase a new version. Since Stata …
Referencing first non-omitted level of factor variable?I'm trying to put a title over a factor variable by using the refcat command of esttab. However, the…
Force the study entry date from an exposed subject to a matched non-exposed subjectDear Statalisters, I wish to perform a survival analysis comparing exposed and non-exposed subjects…
Using Restricted Maximum Likelihood in random-effects meta-analysis for binary outcomesI'm coming from R, so I'm hoping to find an easy way to get a similar output with Stata. I know that…
Subscribe to:
Post Comments (Atom)
0 Response to How to jump out a forvalue loop after finding a specific value ?
Post a Comment