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
Create binary variable if string contains any of the followingHi, I have a variable "CaseDescription1". It's a string variable, with very long text description o…
State by Year Fixed Effects and Annual State ControlsIn my econometric model the identifying variation is at the state, year, and factory level. When I i…
Calculate the mean of simulations by groups with panel dataHello everyone, My dataset contains: - mcruns (50 Monte Carlo simulations) - lgacode (50001 to 501…
Funnelplot for proportions after "metaprop"Dear, thank you in advance for the time you dedicate to me. I'm doing an extensive meta-analysis of…
Spearman Rank CorrelationThe following code calculates average monthly cross sectional Pearson Product moment Correlations. N…
Subscribe to:
Post Comments (Atom)
0 Response to nested loops
Post a Comment