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.
fisher's exact test does not reproduce the results in the literatureHello, I am trying to reproduce the results in the literature using fisher's exact test to compare …
To make Trajectory Plot directly using WIDE data format without reshaping to long formatDear all, Is there any easy command or way to make a trajectory plot using WIDE format without resh…
5-class latent class model and memory problems r(3900)Dear Statalister, i am running the following 5-class latent class model on a dataset of about 19.00…
The occurance of autocorrelation and heteroscedasticity in a panel data OLS regressionHello everyone, I am currently running an OLS panel data regression with industry and time fixed ef…
reclink functionHi guys, hope you are enjoying festivities. So basically I am trying to perform a fuzzy matching b…
Subscribe to:
Post Comments (Atom)
0 Response to forvalues and xtile.
Post a Comment