# Smoothing splines with multiple independent variables in R

I'm using smooth.spline for some basic smoothing splines. However, I need to switch to a function that allows me to use multiple independent variables. I'm having trouble finding one, other than mars, which is giving me bizarre results so I think it may not be what I'm looking for. My stat background is very limited, and I don't think the type of spline matters too much, so I was wondering if there is a real basic smoothing spline like smooth.spline that works for multiple independent variables.

-
add comment

## 1 Answer

Have you considered generalized additive models (GAM)? It fits a sum of splines across your independent variables. The gam package in R is one good choice.

-
And mgcv package is an even better choice! –  Alex Aug 29 '11 at 5:49
Thanks for the suggestion. gam is giving me fairly-similar values to smooth.spline when I just use the one independent variable, but when I switched to two, it got weird. I'm using the smoothing modifier s() on each independent variable - is this correct? Let me play with it a bit more, and if I can't get it I'll update my OP with an example. Thanks! –  BigChief Aug 30 '11 at 0:46
add comment