# Are both of these generalized additive models?

I've been reading about generalised additive models. I've been using this data (which is a reformatted version of data from Hastie's website), and running my code in R. This data essentially consists of whether a patient has or does not have coronary heart disease (the variable to be modelled) and several patient characteristics. For the sake of this question, the two I am interested in are sbp (sytolic blood pressure) and chol.ratio (the ratio of two types of cholesterol). I've been trying to model chd with logistic regression.

Looking at scatterplots sbp seems non-linearly related to the logit, so I've modelled it with splines as follows:

Using gam:

data1 <- read.csv("coris.csv", sep = ",", stringsAsFactors = F,
require(gam)
gam.object <- gam(chd ~ s(sbp, 5) + chol.ratio, data = data1,


And using the Design package:

require(design)
rcs.object <- lrm(chd ~ rcs(sbp, 6) + chol.ratio, data = data1)


I can plot the subsequent models in 3d using the rcl() package, and the outputs are very similar - the model using GAM is:

The plane represents the fitted model over a range of the predictor variables, and the points are the actual fitted model, the z axis to the right is the cholesterol ratio, and the x axis to the left is the sytolic blood pressure, and the vertical axis is the logit.

and the model using lrm with a rcs is :

So - with the lrm command are you actually fitting a generalized additive model if you specify a spline with rcs()? If not, why not, and how do the two approaches differ?

• Thanks. In the 3d versions of the above, the gam model looks smoother than the lrm one with rcs, but it's not obvious in the images (I did try to take them from a good angle). Does the roughness penalty account for the increased smoothness in the gam model? – Andrew Dec 15 '11 at 10:03