Sample 25605: Using partial spline interpolation with PROC G3GRID
This sample code uses a partial spline interpolation method on the GRID statement of PROC G3GRID, using eight nearest neighbors for computing the estimates of the first and second derivatives. The output data set generates a smoother surface plot than the surface plot that results from the default interpolation.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This sample code uses a partial spline interpolation method on the GRID statement of PROC G3GRID, using eight nearest neighbors for computing the estimates of the first and second derivatives. The output data set generates a smoother surface plot than the surface plot that results from the default interpolation.
The graphics output in the Results tab was produced using SASĀ® 9.2. Submitting the sample code with releases of SAS prior to SAS 9.2 might produce different results.
/* Set the graphics environment */
goptions reset=all border cback=white htitle=12pt;
/* Create data set WORK.NUMS using */
/* a set of randomly sampled points */
data nums;
keep x y z;
do i=1 to 30;
x=10*ranuni(33)-5;
y=10*ranuni(35)-5;
z=sin(sqrt(x*x+y*y));
output;
end;
run;
/* Process points with PROC G3GRID */
proc g3grid data=nums out=partial;
grid y*x=z / partial
near=8
axis1=-5 to 5 by .5
axis2=-5 to 5 by .5;
run;
/* Define a title for the graph */
title1 'Surface Plot After Partial Interpolation';
/* Produce the graph */
proc g3d data=partial;
plot y*x=z;
run;
quit;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.

This example specifies a partial spline interpolation method on the GRID statement, using eight nearest neighbors for computing the estimates of the first and second derivatives. The output data set generates a smoother surface plot than the surface plot that results from the default interpolation.
| Type: | Sample |
| Topic: | Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Elements ==> Symbols/Interpolation SAS Reference ==> Procedures ==> G3D SAS Reference ==> Procedures ==> G3GRID
|
| Date Modified: | 2005-09-22 03:03:15 |
| Date Created: | 2005-05-23 14:18:30 |
Operating System and Release Information
| SAS System | SAS/GRAPH | All | 8 TS M0 | n/a |