Fitting Linear Models > Standard Least Squares Examples > Knotted Spline Effect Example
Publication date: 11/10/2021

# Knotted Spline Effect Example

Use the Knotted Spline Effect option to fit a segmentation of smooth polynomials to a specified effect. When you select this attribute, a window appears, enabling you to specify the number of knot points. (Knotted splines are implemented only for main-effect continuous terms.)

JMP follows the advice in the literature in positioning the points. The knotted spline is also referred to as a Stone spline or a Stone-Koo spline. See Stone and Koo (1985). If there are 100 or fewer points, the first and last knots are the fifth point inside the minimum and maximum, respectively. Otherwise, the first and last knots are placed at the 0.05 and 0.95 quantiles if there are 5 or fewer knots, or the 0.025 and 0.975 quantiles for more than 5 knots. The default number of knots is 5 unless there are 30 or fewer points. In that case, the default is 3 knots.

Knotted splines have the following properties in contrast to smoothing splines:

Knotted splines work inside general models with many terms, whereas smoothing splines are for bivariate regressions.

The regression basis is not a function of the response.

Knotted splines are parsimonious, adding only k – 2 terms for curvature for k knot points.

Knotted splines are conservative compared to pure polynomials in the sense that the extrapolation outside the range of the data is a straight line, rather than a polynomial.

There is an easy test for curvature.

#### Example Using the Knotted Spline Effect to Test for Curvature

To test for curvature, follow these steps:

1. Select Help > Sample Data Library and open Growth.jmp.

2. Select Analyze > Fit Model.

3. Select the ratio column and click Y.

4. Select the age column and click Add.

5. Select age in the Effects pane and select Attributes > Knotted Spline Effect.

6. For the number of knots, type 5 and click OK.

Figure 4.21 Fit Model Launch Window

7. Click Run.

8. Click the Response ratio red triangle and select Estimates > Custom Test.

In the Custom Test report, notice that there is only one column. You want three columns.

9. Click the Add Column button twice to produce a total of three columns.

10. In the first column, type 1 for age&Knotted@4.5.

11. In the second column, type 1 for age&Knotted@20.25.

12. In the third column, type 1 for age&Knotted@36.

Figure 4.22 Values for the Custom Test for Curvature

13. Click Done.

The small Prob > F value in the Custom Test report indicates that there is curvature.

Figure 4.23 Curvature Report