Dear All,
Not sure I should post this here or in IML. My question is quite simple: for the below code with 3 data steps I get data UV1, however could I reach the same target with ONLY ONE data step? I tried the Call Streaminit, but it seems I can't reach my expectation. Please help me if you can. Appreciated!!!
%let n_patient=25;/*Half NUmber of subjects enrolled*/
%let loop=20;/*Total number of loops conducted in the simulation*/
/***First Group***/
%let sigma1=1.5;/*Patient group sigma*/
%let sigma0=1;/*Healthy group sigma*/
%let mu1=1; /*Patient group mean of measurements*/
%let mu0=0; /*Healthy group mean of measurements*/
/***2nd Group***/
%let sigma1_=1.5;/*Patient group sigma*/
%let sigma0_=1;/*Healthy group sigma*/
%let mu1_=1; /*Patient group mean of measurements*/
%let mu0_=0; /*Healthy group mean of measurements*/
/***END***/
/***Sample 1 theory values***/
%let AUC_Theory=%sysfunc(round(%sysfunc(probnorm(%sysevalf((&mu1.-&mu0.)/%sysfunc(sqrt(%sysevalf(&sigma1.**2+&sigma0.**2)))))),0.00001));
/***Sample 2 theory values;***/
%let AUC_Theory_=%sysfunc(round(%sysfunc(probnorm(%sysevalf((&mu1_.-&mu0_.)/%sysfunc(sqrt(%sysevalf(&sigma1_.**2+&sigma0_.**2)))))),0.00001));
%put &AUC_Theory;
%put AUC_Theory=&AUC_Theory.
sigma1=&sigma1.;
***%let cor=10;/*Number of correlation coefficients used; Correlation coefficient =rho/10*/
data UV0;
do sampleID=1 to &loop.;
do i=1 to &n_patient.;
seed=2**sampleID;
U=rannor(seed);
V=rannor(seed);
goldstandard_P=1;
goldstandard_H=0;
output;
end;
end;
run;
/*Used to calculate Sample 1;**/
data UV0_1;
set UV0;
do rho=0,1;
output;
end;
run;
/*Calculate the measurement for sample 1;*/
data UV1(keep=sampleID rho i U V SBJ1N_P SBJ1N_H goldstandard_P goldstandard_H);
set UV0_1;
sigma1=&sigma1.;
sigma0=&sigma0.;
mu1=&mu1.;
mu0=&mu0.;
SBJ1N_P=sigma1*U+mu1;
SBJ1N_H=sigma0*((rho/10)*U+sqrt(1-(rho/10)**2)*V)+mu0;
run;
... View more