my problem is that I want to display a funcion in SAS with proc G3D and I need the data in the same order than lake. But, I have to take X and Y from an uniform law. I'm able to generate Y with IML but not X.
proc iml;
xmax=2;
xmin=-2;
range=xmax-xmin;
Y=j(range,1,0);
X=j(range,1,0);
X1=j(range*range,1,0);
do i=1 to range;
call randgen(u,'uniform');
Y[i,1]=xmin+u*range;
end;
do i=1 to range/2;
y=y//y;
end;
do i=1 to range;
call randgen(u1,'uniform');
X[i,1]=xmin+u1*range;
end;
do i=1 to range;
do n=1 to range*range;
X1[n,1]=X[i,1];
end;
end;
print X1;
run;
quit;
The idea is to have the axis X1 (which represents the variable x of the function) like the X from sashelp.lake : with a repeated value for each repetition.