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.
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 16. 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.