Hello! I have a dataset with income and expense throughout several years (1992, 1994, ... 2016)
I want to generate deciles. I know xtile doesn't work with by(). I tried using egen but it doesnt support weights and my data has weights. I thought i'd use forvalues however it doesn't seem to work either.
My code is:
forvalues i=1992(2)2016 {
xtile decil=income [w=factor] if year==`i', nq(10)
}
The problem I find is that the code stops at 1992, that is that I have deciles for 1992 only.
Can someone help me please?
Related Posts with forvalues and xtile.
mixed model with endogenous variableHello everyone, I have multilevel data (individuals nested within municipalities). In my database I…
Varying variables in datasets causes loop over files in folder to break downHi list, I have a number of datasets for different years in a folder - the files are called data200…
Fixed effects model/interpretationHi all, I am doing a fixed effects model in stata in order to find out what factors affect house pr…
coefficent is significant,but marginal effect is not significantWhen I used meologit to finish my regression, the coefficient of the variables was significant. But …
Saving parts of a model after Bayesian analysisDear all, Assume that one runs a model using the bayes prefix. This model includes also a large num…
Subscribe to:
Post Comments (Atom)
0 Response to forvalues and xtile.
Post a Comment