黃河泉 发表于 2019-4-6 07:10 
请 (ssc install) ascol。
 gen date=date(time,"YMD")
.  destring code,replace
code: all characters numeric; replaced as long
. format date %td
. xtset code date
       panel variable:  code (unbalanced)
        time variable:  date, 01apr2010 to 31jan2013, but with gaps
                delta:  1 day
. bys code (date): gen t = _n 
. xtset code t
       panel variable:  code (unbalanced)
        time variable:  t, 1 to 688
                delta:  1 unit
. gen lcl = log(cl)
. gen r = D.lcl*100
(179 missing values generated)
. ascol r, returns(log) keep(vars) tomonth timevar(date) panelvar(code) generate(R)
这是指令
------------------ copy up to and including the previous line ------------------
Listed 10 out of 4041 observations
用了ascol后,中间缺了好几个月份,本来应该是从2010年4月到2013年1月的,日数据也是2010年4月1日到2013年1月31日的,调整后就莫名地缺了好几个月份,请问老师这是怎么回事?