Hello everybody, I have a silly question, but I've been working on it since 3 days.
In the sashelp.lake database we have the same X repeated the length of Y times. And I have to do something like that to represent a function with proc g3d (in order to have z = y*x).
If you could please tell me how sashelp.lake is created is gonna be very helpful.
Thanks
No idea how LAKE dataset was generated but perhaps something like:
data test1;
do width=0 to 10 by 0.5 ;
do length=0 to 7 by 0.5 ;
z= width*length ;
output;
end;
end;
run;
No idea how LAKE dataset was generated but perhaps something like:
data test1;
do width=0 to 10 by 0.5 ;
do length=0 to 7 by 0.5 ;
z= width*length ;
output;
end;
end;
run;
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.
Since the SASHELP.Lake has exactly 3 variables, Width, Length and Depth I am not sure at all what you mean by " X repeated the length of Y times".
If you want to make graph using Proc G3D the data available should work. The X and Y variables could be either of Width and Length and the Z variable would be Depth.
Proc g3d data=sashelp.lake; plot width*length=depth; run; quit;
Nearly 200 sessions are now available on demand in the Innovate Hub.
Watch Now →SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.