Tell me more ×
Cross Validated is a question and answer site for statisticians, data analysts, data miners and data visualization experts. It's 100% free, no registration required.

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?

share|improve this question
2  
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

1 Answer

up vote 4 down vote accepted

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.

share|improve this answer
1  
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
Thanks for your answer! – MarkDollar Aug 25 '11 at 14:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.