s-news
[Top] [All Lists]

question about predict.gam

To: s-news@lists.biostat.wustl.edu
Subject: question about predict.gam
From: Ping Zhang <pingzhang@avaya.com>
Date: Sun, 19 Oct 2003 14:57:29 -0400
References: <20031018015240.537264021AB@smtp.biostat.wustl.edu>
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02
I am fitting a Poisson glm model, say

r<-glm(O~ns(log(size),3)+x1+x2,data=indata,family=poisson)

I understand that the predict.glm() function is unreliable and the document says it is
safer to use predict.gam() since a data dependent transformation is used.
However, I have not been able to make it work. As a simple test,
if I pick a given row form the input dataset and call it "newdata".
If I run

predict.gam(r, type="response", newdata)

I expect to get the r$fitted.values for the corresponding row in indata.
I am getting answers that are far far away from what I expect.

Did I miss anything important? Is there anyway to make it work correctly or reliably?

Ping Zhang
Avaya labs


<Prev in Thread] Current Thread [Next in Thread>