I receive this message "ERROR: Invocation of unresolved module TRAPINTEGRAL." I am not sure why I got this message ? I am attaching my data file along with my SAS code.
Thanks for helping
proc iml;
start Gama(k) global(m,R);
s1=0;
do j=k to m;
s1=s1+(R[j]+1);
end;
return(s1);
finish;
********************************;
***** Trapezoidal Method *******;
********************************;
start TrapIntegral(x,y);
N = nrow(x);
dx = x[2:N] - x[1:N-1];
meanY = ( y[2:N] + y[1:N-1] )/2;
return( dx` * meanY );
finish;
*********************************************************************************************************;
libname lib "C:\Users\amal\Dropbox\Rola-PHD\Kernel\Hani Real Life Data";
* One way to read the data in SAS;
data lomax;
set lib.lomaxnew;
WP_grid=(Y-X);
run;
proc iml;
*** To use the Data in SAS/IML we need to write "use", "read", and "close";
Use Lomax;
read all var {WP_grid};
Close Lomax;
m=nrow(WP_grid);
************************;
*** Complete Data ***;
************************;
create A_p var {"WP_grid"};
append;
close A_p;
submit;
Data A_P1;
set A_p;
run;
proc kde data=A_p1 out=prog_data gridl=0.1 gridu=2 method=srot;
var WP_grid ;
run;
endsubmit;
Use prog_data;
read all var {WP_grid density};
Close prog_data;
Area_p= TrapIntegral(WP_grid , density);* the estiamted value of R is the area under the curve;
print Area_p;
quit;