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
forvalues with indefinite end valueI would like to use a do loop to read in a series of excel files, save them as .dta files, then appe…
Coefplot, only plotting some of the variablesHi, I have a problem with Coefplot. I have tried the different answers I have found here from earli…
xtpcse command with unbalanced dataHi all, I have unbalanced tscs data and want to use xtpcse but the regression won't run and I get t…
Interaction term and lincomHi all, I am running a basic interaction model y=b0 + b1X1 + b2D + b3X1*D. where D is a dummy varia…
ZIPPKG: module to create ZIP archives of community-contributed content for offline distribution now on SSCDear Statalist community, thanks, as always, to KitBaum, a new user written command named zippkg is…
Subscribe to:
Post Comments (Atom)
0 Response to nested loops
Post a Comment