1) I am typing some iml inside SAS base; I wonder why there is the need for the module IMl/studio?
2) From below, when I use iml to compute values,eg. n_by_na and n_by_nb, then continue with some SAS procedure. After that, I want to use iml again, the previous variables(eg. n_by_na and n_by_nb)are lost from memory.
What is the standard way to do this?
Thank you
IML Newbie
------------------------------------------
/*determine the n_a and n_b*/
proc iml;
reset log print;
N=938;
N_a=731;
N_b=207;
Ssqu_a=0.00009162;
Ssqu_b=0.08779198;
e=0.009;
z=1.75;
/*tempo1=N_a*Ssqu_a+N_b*Ssqu_b;
tempo2=(N_a*Ssqu_a);
tempo3=(N_a*Ssqu_b);*/
n_by_na= ( N_a* sqrt(Ssqu_a) +N_b*sqrt(Ssqu_b) )/( N_a*sqrt(Ssqu_a) );
n_by_nb= (N_a*sqrt(Ssqu_a)+N_b*sqrt(Ssqu_b))/(N_b*sqrt(Ssqu_b));
nsample=(z##2)/(e##2)*( n_by_na*(N_a/N)##2*Ssqu_a + n_by_nb*(N_b/N)##2*Ssqu_b );
nsample_a= ( N_a*sqrt(Ssqu_a) ) /( N_a* sqrt(Ssqu_a) +N_b*sqrt(Ssqu_b) )*nsample;
nsample_b= ( N_b*sqrt(Ssqu_b) ) /( N_a* sqrt(Ssqu_a) +N_b*sqrt(Ssqu_b) )*nsample;
/*end:determine the n_a and n_b*/
DATA SAMPLE_SET_A;
SET imput_out_MCMC;
WHERE(RISKGRP_logit='a');
RUN;
DATA SAMPLE_SET_B;
SET imput_out_MCMC;
WHERE(RISKGRP_logit='b');
RUN;
proc iml;
reset log print;
y_bar=(N_a/N) *0.0013578 + (N_b/N) *0.3169460; /*After that, I want to use iml again*/
var_y_bar=(1-nsample_a/N_a)*(N_a/N)##2*(Ssqu_a)/nsample_a+ (1-nsample_b/N_b)*(N_b/N)##2*(Ssqu_b)/nsample_b;