Solved – What does the dashed bounds mean when plotting a contour plot with R GAM

nonparametricrregression

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?

Best Answer

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:

enter image description here

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.

Related Question