I divided a variable in quintiles and I want to summarize a list of variables for each quintiles. I tried to use this loop but it doesn't seem to work:
xtile prof_quint = av_PSP_prof, nq(5)
tab prof_quint
order prof_quint, after (av_PSP_prof)
local quint_sum num_employees time_psp furthest_loc_time
foreach x of numlist 1/5 {
foreach y of local quint_sum {
sum `y' if prof_quint==`x'
}
}
Related Posts with nested loops
Show the formula that the -predict- command uses?Hello everyone! I'm new here and also very new to STATA, although I really enjoy statistics. I have…
Please advice how to combine the rates of few years together and compare with another interval?Hello, I am trying to combine the yearly rates reported for 2007, 2008 and 2009 together to compare…
Help Needed: Simple Linear Regression and Significance QuestionsHi Everyone! I'm relatively new to STATA and statistics, so I thought I would come to this forum fo…
bar graph / blabel()I'm creating bar graphs with similar code: graph bar var1 var2 var3 var4, /// over(race, relabel (1…
New version of kmest on SSCThanks as always to Kit Baum, a new version of the kmest package is now available for download from …
Subscribe to:
Post Comments (Atom)
0 Response to nested loops
Post a Comment