s-news
[Top] [All Lists]

Re: [splus-users,14044] [S] gam(lo()) and predict.gam()

To: s-news@wubios.wustl.edu
Subject: Re: [splus-users,14044] [S] gam(lo()) and predict.gam()
From: Takezawa Kunio <takezawa@affrc.go.jp>
Date: Mon, 29 May 2000 14:06:04 +0900
In-reply-to: <200005290316.MAA28793@cabbage.math.keio.ac.jp>
References: <200005290316.MAA28793@cabbage.math.keio.ac.jp>
Sender: owner-s-news@wubios.wustl.edu
Hi! S-plus users.
E-mail: s-news@wubios.wustl.edu

   I have just received appropriate advice from  
Dr. Rachel Fewster  (Department of Statistics, 
University of Auckland). I really appreciate it.
   The program below works well.
-------------------- Program (C) --------------------
function()
{
        xx <- seq(from = 1, by = 1, to = 10)
        ex <- seq(from = 3, by = 0.3, length = 12)
        yy <- sin(xx) + 2
        data1 <- data.frame(x = xx, y = yy)
        span1 <- 0.4
        formula.name <- paste("y ~ lo(x, span =", span1, ")")
        fit.gam <- gam(formula.name, data = data1, family = "poisson", x = T, 
model = T)
        data2 <- data.frame(x = ex)
        ey <- predict.gam(fit.gam, data2)
        ey
}
-------------------- End of Program (A) --------------------
   Pleas note that "data1" is not on working directory.
This "formula.name" technique seems to have the wide range of
applications.

   *****    Kunio Takezawa, Ph.D. (takezawa@affrc.go.jp)    *****
  *****            Research Information Section              *****
 **** Hokuriku National Agricultural Experiment Station, JAPAN ****
*****     <http://www.inada.affrc.go.jp/~takezawa/patent-e.html>    *****
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [splus-users,14044] [S] gam(lo()) and predict.gam(), Takezawa Kunio <=