Previously, I posted the this post http://www.statalist.org/forums/foru...ative-to-xtile, but did not recieve a reply. The slow speed of xtile, especially with by option, captivated me for quite some time. As a solution to my problem, I have written astile package with the following results when applied to the following generated data.
the result of astile and xtile are:
I would appreciate your comments on the technical aspect of my package and its efficiency.
Code:
set obs 10 gen id=_n expand 1000 bys id: g time=_n tsset id time gen ri=0 replace ri=-.01 if id==1 replace ri=-.02 if id==2 replace ri=-.03 if id==3 replace ri=.08 if id==8 replace ri=.09 if id==9 replace ri=.1 if id==10
Code:
timer on 1 egen q1=xtile(ri), by(time) nq(10) timer off 1 timer on 2 astile ri, gen(q2) nq(10) timer off 2 timer list 1 1: 109.85 / 1 = 109.8460 . timer list 2 2: 10.34 / 1 = 10.3420
Comment