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
Getting RR and CI ; when one of the cells is 0 (similar to Exlogistic command)Dear Statalisters, Any advise Getting RR and CI using generalised linear models ; when one of the ce…
Multinomnial logit latent class model in panel dataHi all: I want to apply multinominal logit latent class model in my panel data. I know gsem, lc() o…
Parameter constraints in MLE estimation for SFAHello, I'm using the following commands after which I would like to set up constraints for the param…
syntax for calculating mean eGFR loss using joint model (-stjm-)Dear Stata users, I am trying to calculate mean eGFR loss/year using joint model which uses both th…
Commands to estimate models with variables at different levels?Hi folks, imagine I have a panel data set in which the dependent variable is continuous and is measu…
Subscribe to:
Post Comments (Atom)
0 Response to nested loops
Post a Comment