Hey guys, Sas shows me a waring that Do group statements were not executed due to missing END at the time of Quit, BUT although I have checked it for several times, I still cannot find the problem. proc iml;
load D;
load RR;
load LL;
start LLH(st,fi,S);
b_1=(S[st:(fi-1),4]`)*S[(st+1):fi,4]/((S[st:(fi-1),4]`)*S[st:(fi-1),4]);
b_2s=S[(st+1):fi,4]-b_1*S[st:(fi-1),4];
b_2=b_2s[:];
sigma_s1=S[(st+1):fi,4]-b_1*S[st:(fi-1),4]-b_2;
sigma_s2=sigma_s1##J((fi-st),1,2);
sigma=(fi-st-1)/(fi-st-2)*sigma_s2[:];
if sigma=0 then LLF=.;
else do;
LLF=(-0.5*(fi-st-1))*log(2*arcos(-1)*sigma)-1/(2*sigma)*((S[st:(fi-1),4]`)*S[st:(fi-1),4]);
end;
return(LLF);
finish LLH;
fname = "split1":"split2320";
do i = 1 to ncol(fname);
dsname = "spl1." + strip(fname[i]);
use (dsname);
do t=1 to 120;
g=D[t,1];
read all where(COL2=g) into SS;
if nrow(SS)=0 then RR[i,t]=.;
else do;
st=1;
fi=15;
M_sf=J(1,2,0);
do until (fi>240);
if abs(LLH(st,fi+1,SS)/LLH(st,fi,SS)-1)>0.1
then do;
M_sf[1,1]=st;
M_sf[1,2]=fi;
stfi=stfi//M_sf;
st=fi+1;
fi=fi+15;
if st>225
then do;
M_sf[1,1]=st;
M_sf[1,2]=240;
stfi=stfi//M_sf;
end;
else do;
fi=fi+1;
if fi>240
then do;
M_sf[1,1]=st;
M_sf[1,2]=240;
stfi=stfi//M_sf;
end;
end;
end;
do tt=1 to nrow(stfi);
b_1=(S[st:(fi-1),4]`)*S[(st+1):fi,4]/((S[st:(fi-1),4]`)*S[st:(fi-1),4]);
b_2s=S[(st+1):fi,4]-b_1*S[st:(fi-1),4];
b_2=b_2s[:];
sigma_s1=S[(st+1):fi,4]-b_1*S[st:(fi-1),4]-b_2;
sigma_s2=sigma_s1##J((fi-st),1,2);
r_11=sigma_s2;
r_1=r_1+r_11;
r_22=((S[(st+1):fi,4]-S[(st+1):fi,4][:])`)*(S[(st+1):fi,4]-S[(st+1):fi,4][:]);
r_2=r_2+r_22;
end;
RR[i,t]=r_1/r_2;
end;
end;
close;
end;
store RR;
create ba.RR from RR;
append from RR;
quit;
... View more