SPSS Statistics

 View Only

 STATS SPLINES - problem with BOUNDS

Robert Lundqvist's profile image
Robert Lundqvist posted Wed April 22, 2026 09:21 AM

I am trying to use the STATS SPLINES extension. To get a set of splines which can be used for predictions, I need to set up fixed parameters so that the same spline variables can be reused. It seems as if the subcommand BOUNDS should make this possible. Everything works fine without the BOUNDS command, but when it is added using the following syntax, it stops:

STATS SPLINES VARIABLES=diameter ID=Subject DATASET=splines
/TRANSFORMATION TYPE=NATURALSPLINE DF=3  BOUNDS=5 25
/OPTIONS OUTNAMES=VARNAME DISPLAYKNOTS=YES.

The error message displayed is the following: 

missing values and NaN's not allowed if 'na.rm' is FALSE

Error: End of procedure 
In addition: Warning message: 
In arglist["Boundary.knots"] <- bounds : 
  number of items to replace is not a multiple of replacement length

Is there something wrong with my setup or is the extension broken?

Jon Peck's profile image
Jon Peck IBM Champion

I can't be sure without having your data, but I think I have fixed this.  It will get posted on the Extension Hub once the fix is confirmed, but download this file

STATS SPLINES.spe

and install it via Extensions > Install Local Extension Bundle

and try it out.

Please let me know whether it works or not.  If it does not work, I will need a data sample that shows the failure.

Robert Lundqvist's profile image
Robert Lundqvist

The new splines extension has hopefully been installed as intended, there were no error messages. But it still does not work. I have tried with both the original dataset and the simulated data for which I want to make predictions. For generating the data and the spline part I have used the following syntax:

NEW FILE.
INPUT PROGRAM.
LOOP diameter=20 TO 80 BY 2.
END CASE.
END LOOP.
END FILE.
END INPUT PROGRAM.
EXECUTE.
DATASET NAME spline_test.

STATS SPLINES VARIABLES=diameter DATASET=splines
/TRANSFORMATION TYPE=NATURALSPLINE DF=5 BOUNDS=20 80
/OPTIONS OUTNAMES=VARNAME DISPLAYKNOTS=YES.

Anything in the setup which I have misunderstood? 

Jon Peck's profile image
Jon Peck IBM Champion

This is what I get with the updated command.  What do you see?

image
Robert Lundqvist's profile image
Robert Lundqvist

Strange. I get the same error message as before. It runs as intended when there is no BOUNDS option, so the extension works at least partially.
I also tried to uninstall the extension through the Extension Hub followed by a new install, but the result was the same. Could it be the communication with R that causes this?

image
Jon Peck's profile image
Jon Peck IBM Champion

 I don't know what went wrong, but try installing this version

STATS SPLINES.spe   

(link corrected)

using Extensions > Install Local Extension Bundle

Don't go to the Extension Hub

Robert Lundqvist's profile image
Robert Lundqvist

Thanks! I switched to another computer, and the extension runs there. It's still strange that it won't work on the first machine, but it will be left as a small mystery.

Jon Peck's profile image
Jon Peck IBM Champion

Did you get that latest update?  Maybe the first machine still has the older one.