Hi,

I would like to plot the gam function for the following:

	GAM1<-gam(Sources~lo(Depth, span=0.5, degree=1) + Station, family=gaussian())
	
	plot.gam(GAM1,residuals=TRUE, rugplot=FALSE, se=TRUE). 

I could do this fine when Station wasn't a variable. But now that I am required to include Station as a variable as a part of the analysis, the plot.gam keeps on giving the following warning: 

"residuals do not match x in "partial for Station" preplot object" and the graph produced is "Station vs. Partials for Station" - a straight line with a cross on it. 

I also tried to use as.factor(Station) instead of Station, and this time, while there is no warning message, the graph produced is "as.factor(Station) vs. Partials for as.factor(Station)". That is NOT the graph I want. The graph I am interested in shows the smoothing curve for "Sources vs. depth" at span 0.5. But for some reason, R automatically proceeds to the preplot graph.


Is there any way I could obtain the smoothing curve for "Sources vs. depth" at span 0.5, while still including Station as a categorical variable (which is a requirement for this analysis)?

Thanks,

Aishwarya



	[[alternative HTML version deleted]]

