Hi, I would like to make such a version of this function 'mhatx1' which omits x=i from the sum i.e. computes t4
start mhatx1(m,p,h,pi,e);
t4=j(m,1);
do x=1 to nrow(p);
i=T(1:m);
temp1=x-i;
ue=Kmod(temp1,h,pi,e)#p;
le=Kmod(temp1,h,pi,e);
t4
end;
return (t4);
finish;
If I understand your quetion, there are several ways to accomplish what you are asking. The method to choose depends on whether you want to modify the computation of ue and le, or just the sums.
Here are some functions that are good to know about:
I think the REMOVE function is all you need here.
If I understand your quetion, there are several ways to accomplish what you are asking. The method to choose depends on whether you want to modify the computation of ue and le, or just the sums.
Here are some functions that are good to know about:
I think the REMOVE function is all you need here.
Thank you! That REMOVE was what I was looking for, even though I just ended up removing t'th solutions of the inner functions ue and le from summations:
start mhatx2(m,p,h,pi,e);
t5=j(m,1);
do x=1 to nrow(p);
i=T(1:m);
temp1=x-i;
ue=Kmod(temp1,h,pi,e)#p;
le=Kmod(temp1,h,pi,e);
t5
end;
return (t5);
finish;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.
Find more tutorials on the SAS Users YouTube channel.