g**a 发帖数: 2129 | 2 data one;
input FirmID $ Year earnings $ Mean Variance ;
datalines;
BBB 2004 E1 100 8
BBB 2005 E2 300 10
BBB 2006 E3 600 12
BBB 2007 E4 530 30
BBB 2008 E5 410 28
;
run;
proc IML;
use one;
read all;
xmean=mean;
xvar=variance;
xyear=year;
Numrow=Nrow(xmean);
do y=1 to Numrow;
sim=rand('NORMAL', mean[y], sqrt(variance[y]));
do x=2 to 250 by 1;
sim=sim||rand('NORMAL', mean[y], sqrt(variance[y])); |
|