[18619] in s-news-athena

home help back first fref pref prev next nref lref last post

[S] Summary: Offset in GLM

daemon@ATHENA.MIT.EDU (=?iso-8859-1?Q?"G=E9rald_Jean"?=)
Tue Jul 13 13:50:13 1999

From: =?iso-8859-1?Q?"G=E9rald_Jean"?= <Gerald.Jean@spgdag.ca>
To: s-news@wubios.wustl.edu
Message-Id: <852567AD.005638FF.00@mail.spgdag.com>
Date: Tue, 13 Jul 1999 13:35:39 -0400
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit


Thanks to Hong Ooi, Nick Ellis, Bill Venables, Andy White and Alan
Zaslavsky who responded to my question regarding the use of "offset" in the
function "glm".  Basically they all suggested the same solution, i.e. using
the predictions rather than the glm object as argument to offset.

> ttt.glm2 <- glm(formula = cost ~ car.age + offset(predict(ttt.glm1)),
family = Gamma,
+ data = claims, weights = number, na.action = na.omit)

Following you will find the original posting.

Thanks again,

Gérald

Hello S-users,

I'am trying to fit a GLM while holding some of the coefficients fixed.
I thought that the offset function was doing just that?

For example Chambers and Hastie in their "Statistical Models in S" have
an example:

y ~ dose + age + offset(prior.fit)

where I assumed that prior.fit was an earlier fit with different
variables.

But if I do the following:

> ttt.glm1 <- glm(formula= cost ~ age + type, family = Gamma,
+ data = claims, weights = number, na.action = na.omit)

> ttt.glm2 <- glm(formula = cost ~ car.age + offset(ttt.glm1), family =
Gamma,
+ data = claims, weights = number, na.action = na.omit)

Error: Length of variable 3 is 21 != length of row names (128)
Dumped

Obviously I am not using the proper syntax, can someone help?

Thank you very much,

Gérald Jean
Analyste-conseil (statistiques), Actuariat
télephone            : (418) 835-8839
télecopieur          : (418) 835-5865
courrier électronique: gerald.jean@spgdag.ca


-----------------------------------------------------------------------
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

home help back first fref pref prev next nref lref last post