[R] plot.gam

Thomas Lumley thomas at biostat.washington.edu
Fri Apr 7 17:13:01 CEST 2000


On Fri, 7 Apr 2000, Werner Stahel wrote:

> 
> I have just fitted a lm model containing a bs smooth term.
> I asked Martin how I could see the estimated function.
> He said that such a possibility -- 
> which is available in S-Plus' plot.gam --
> was on your list of desirable functions.
> This is a vote to give it high priority.

You *can* see the estimated function with predict(,type="terms")
using 
eg
	model<-lm(y~bs(x,6)+z)

	tm<-predict(model,type="terms")

	plot(x,tm[,"bs(x, 6)"]

(or for a curve plot)

	oo<-order(x)
	plot(x[oo],tm[oo,"bs(x, 6)"]
   

If you want pointwise standard errors use
	predict(model, type="terms",se.fit=TRUE)



    -thomas

Thomas Lumley
Assistant Professor, Biostatistics
University of Washington, Seattle

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list