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.
Event Study Using earnings announcement dateI have a data that looks as follow . Post1 = 0 is collapsed mean of date -45 to -1 for the event dat…
Bayes Stochastic Frontier AnalysisDear all, Does anyone have the Stata command to do Bayes Stochastic Frontier Analysis(SFA)?In Stata …
Help with graph, poisson regressionHello, I have ran a poisson regression for a paper that I have to write. My goal was to find the pr…
Logit FE regression in cross-sectional data.Dear Statalist, I have read about this topic in various discussions but I could not take a clear re…
Ceo transition from male to femaleDear community, I have an unbalance panel data where I want to create the following variables with …
Subscribe to:
Post Comments (Atom)
0 Response to forvalues and xtile.
Post a Comment