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;
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.