80 likes | 219 Views
proc iml ; n= 100 ; bivariate=j(n, 2 , 0 ); mu={ 2 , 4 }; cov={ 3 1 , 1 5 }; seed= 0 ; do i= 1 to n; bivariate[i,]=( mu+root(cov)`*normal(j(nrow(cov), 1 ,seed)) )`; end; print bivariate; quit ;. proc iml ; n= 100 ; mu={ 2 , 4 };
E N D
prociml; n=100; bivariate=j(n,2,0); mu={2 ,4}; cov={31,15}; seed=0; do i=1 to n; bivariate[i,]=( mu+root(cov)`*normal(j(nrow(cov),1,seed)) )`; end; print bivariate; quit;
prociml; n=100; mu={2 ,4}; cov={31,15}; seed=0; /* module */ start bivariate; bivariate= mu+root(cov)`*normal(j(nrow(cov),1,seed)); finish; start replace; bivariate_gen[i,]=bivariate`; finish; bivariate_gen=j(n,2,0); do i=1 to n; run bivariate; run replace; end; print bivariate_gen; quit;