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 ?
Forest plots - how do I move the null reference line in meta forest?Hi, I am trying to make a Forest plot of odds ratios. The studies cannot be combined, I'm only tryi…
Resetting IndexHello, I have a panel dataset containing three vars: nation, year, and a variable called 'event' wh…
Calculating sample size with more parametersHello, I am trying to calculate sample size with the parameters below. I used the code below to cal…
Sum Data from multiple variablesHello, I'm trying to create a new variable that is equal to the sum of several other variables. The…
Panel data with missing valuesHi everyone, I am wondering if anyone can suggest a method to analyze data in the following format: …
Subscribe to:
Post Comments (Atom)
0 Response to How to jump out a forvalue loop after finding a specific value ?
Post a Comment