|
Song,
I don't know IML, thus won't attempt to modify your code. But, that said,
couldn't you just modify the same functions you are already using. I.e.,
use something like:
%let nummiss=.2;
If ranUni(0) lt &nummiss then call missing(whatever_variable)
else assign random value to whatever_variable
Art
------
On Tue, 3 Feb 2009 13:19:56 -0800, Song <sounpra@YAHOO.COM> wrote:
>Hi All -
>
>If I have generated a sample data as follows:
>
>/**********************************************************/
>%let simsize=10; %let seed=112; %let g1=25;
>%let g2=25; %let p=5;
>proc iml;
> sig1=I(&p);
> sig2=2*I(&p);
> mu1=shape({0},&p,1);
> mu2=t({2 0 0 0 0});
> m=j(&simsize*(&g1+&g2),&p+2,0);
>
> do j=1 to &simsize;
> sim=j(&g1+&g2,1,j);
> group1=j(&g1,1,1);
> group2=j(&g2,1,2);
> call vnormal(z1,mu1,sig1,&g1,j+&seed);
> call vnormal(z2,mu2,sig2,&g2,j*&seed);
>
>z=z1//z2;
>group=group1//group2;
>m[((j-1)*(&g1+&g2))+1:(j*(&g1+&g2)),]=sim||group||z;
>end;
>create sample from m[colname={sim group x1 x2 x3 x4 x5}];
>append from m;
>quit;
>/
>************************************************************************/
>
>How can I create a dataset containing missing at random data such that
>approximately XX% of data are missing within each simulation?
>
>Thanks,
>
>Song
|