数据形式大约为:
firm date at
A 20090331 89
A 20090630 100
A 20090930 85
B 20080630 4
B 20080930 10
我用expand但是总是出错。
proc sort data=temp; by firm date; run;
proc expand data=temp out=temp1 from=qtr to=month;
convert at / observed = total;
by firm;
id date;
run;作者: shiyiming 时间: 2011-1-24 16:52 标题: Re: 有没有简单的quarterly data变monthly的方法? 发现问题,不同公司的季度末日期经常变化,所以没法用expand。比如会出现
firm date at
C 20091031 80
C 20091231 90
ERROR:Duplicate time interval found at observation number 135 in the data set WORK.TEMP, according
to the FROM=QTR option and the ID variable values. The current ID is date=20091231 and the
previous is datadate=20091031, which are within the same QTR interval.