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.
Power calculation for sensitivity of a diagnostic testHi, I want to test the sensitivity of a rapid test & need to calculate the desired sample size.…
npregress series: How can I fit an additively seperable model with more than one variable per additive function?Hey, Im trying to fit a semiparametric model with npregress series. The model I want to fit should …
translate option to change result color in .pdf-fileThe command translator query smcl2pdf shows a table of tunable parameters that can be set either by …
Using xtreg, error "Panels are not nested in clusters"Dear users, I would like to find out how shocks affect household consumption. I have a balanced pane…
Lagged response modelDear Statalisters, I am using a longitudinall dataset in which my main outcome is "QI score" (measu…
Subscribe to:
Post Comments (Atom)
0 Response to forvalues and xtile.
Post a Comment