# What does the dashed bounds mean when plotting a contour plot with R GAM?

At the moment I'm trying to interpret the green and red dashed lines in a contour plot when visualizing a generalized additive model (GAM) with R. These two lines seem to be something like confidence bands, but I'm not sure how to interpret these dashed lines in a contour plot.

Does anybody have experiences with contour plots using R, specifically when fitting GAM?

• Some example code would help a lot. – mpiktas Aug 24 '11 at 12:39
• There are several ways to obtain a contour plot in R, and there are several ways of fitting a GAM in R. As @mpiktas indicated: please (give some example code to) clarify your question. – Nick Sabbe Aug 24 '11 at 18:12

I'm guessing that you mean the red and green contours in the last example figure produced by

library(mgcv)
example(plot.gam)


which looks likes this: The generalized additive model produces a fitted surface defined by the black contours. The help file (from ?plot.gam) says:

...surfaces at +1 and -1 standard errors are contoured and overlayed on the contour plot for the estimate.

You have an estimated SE at each position (x1,x2); adding one SE to the fitted surface, at each point (x1,x2), gives you another surface, which is depicted using the green dotted contours. Subtracting one SE from the fitted surface gives you another surface, which is depicted using the red dashed curves.

• Note: I googled "contourplot gam"; the first result was the help file for plot.gam in package mgcv. I ran library(mgcv);example(plot.gam) within R and saw the figure above, at which point the question made sense. – Karl Aug 24 '11 at 18:49