- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
It doesn't like the square brackets. Why are they there?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Tom.