I wish to ask if any can help correct the bold section of the code below????
THANKS
Data sim;
Input A B;
cards;
1 3
2 7
3 10
4 12
;
Run;
proc iml;
use sim;
read all var{A B} into DM;
close;
A = DM[,1]; B = DM[,2];
n = nrow(DM);
start Func(x);
return( exp(2-x)#[cdf("Normal", x-10)-cdf("Normal", x-4)]*exp(-x) );
finish;
answer = j(nrow(DM),1);
do i = 1 to nrow(DM);
call quad(result, "Func", A || B,);
answer = result;
end;
create kaplan1n var{A B Answer };
append;
quit;
I see, This works,
Data sim;
Input A B;
cards;
1 3
2 7
3 10
4 12
;
Run;
proc iml;
use sim;
read all var{A B} into DM;
close;
A = DM[,1]; B = DM[,2];
n = nrow(DM);
start Func(x);
return( exp(2-x)#(cdf("Normal", x-10)-cdf("Normal", x-4))*exp(-x) );
finish;
answer = j(nrow(DM),1);
do i = 1 to nrow(DM);
call quad(result, "Func", A || B,);
answer = result;
end;
create kaplan1n var{A B Answer };
append;
quit;
It doesn't like the square brackets. Why are they there?
I see, This works,
Data sim;
Input A B;
cards;
1 3
2 7
3 10
4 12
;
Run;
proc iml;
use sim;
read all var{A B} into DM;
close;
A = DM[,1]; B = DM[,2];
n = nrow(DM);
start Func(x);
return( exp(2-x)#(cdf("Normal", x-10)-cdf("Normal", x-4))*exp(-x) );
finish;
answer = j(nrow(DM),1);
do i = 1 to nrow(DM);
call quad(result, "Func", A || B,);
answer = result;
end;
create kaplan1n var{A B Answer };
append;
quit;
Thanks Tom.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.