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
How to use esttab to display the independent variables under other name?I have a multi regressions as below and using esttab at the end to produce a publication-style repor…
How to make the coefficients displaying more aesthetic ?When I run the variable x on variable y, I have the coefficient of x is 0.0000569*** (15.28) I am …
Margins expressionFor a panel fe regression where the IV and DV have both been log-transformed, I would like to know h…
which option in esttab that display number of observation with comma?When running esttab to got the table of results, I faced the problem of displaying the number of obs…
for loop in mataDear statalist members I am new to Mata language, in the code below i simulate a VAR(2) using Stata …
Subscribe to:
Post Comments (Atom)
0 Response to nested loops
Post a Comment