Chapter Contents |
Previous |
Next |
The TPSPLINE Procedure |
The model has a parametric component (associated with the x1 variable) and a nonparametric component (associated with the x2 variable). The following statements fit a partial spline model.
data Measure; set Measure; x1sq = x1*x1; run; data pred; do x1=-1 to 1 by 0.1; do x2=-1 to 1 by 0.1; x1sq = x1*x1; output; end; end; run; proc tpspline data= measure; model y = x1 x1sq (x2); score data = pred out = predy; run;
Output 64.1.1 displays the results from these statements.
Output 64.1.1: Output from PROC TPSPLINE
As displayed in Output 64.1.1, there are five unique design points for the smoothing variable x2 and two regression variables in the model (x1,x1sq). The dimension of the null space (polynomial space) is 4. The standard deviation of the estimate is much larger than the one based on the model with both x1 and x2 as smoothing variables (0.445954 compared to 0.098421). One of the many possible explanations may be that the number of unique design points of the smoothing variable is too small to warrant an accurate estimate for h(x2).
The following statements produce a surface plot for the partial spline model:
title 'Plot of Fitted Surface on a Fine Grid'; proc g3d data=predy; plot x2*x1=p_y/grid zmin=9 zmax=21 zticknum=4; run;
The surface displayed in Output 64.1.2 is similar to the one estimated by using the full nonparametric model (displayed in Figure 64.5).
Output 64.1.2: Plot of TPSPLINE Fit from the Partial Spline Model
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.