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 ?
Descriptive statistic in panel analysis multiple ifsHello to all, I’m using STATA 16. I have a panel data frame with 2 waves. Before and while the Coron…
Plotting result of table functionSorry a very basic question. To get a table I run: table year city [pw=E], c(mean W) and get the …
Failure Rate using 'strate' at multiple exit pointsHi Everone, I am stuck on a problem. I want to graph the failure rate at varying time point viz. 1,…
Creating two groups based on a continuous variable OK, for the sake of transparency, this is not a work issue... I am a clinician-scientist and just c…
Continuous or discrete variable?Hello. I have a question regarding a variable I have constructed. For a number of countries, I have…
Subscribe to:
Post Comments (Atom)
0 Response to How to jump out a forvalue loop after finding a specific value ?
Post a Comment