[R] glm: quasi models with logit link function and binary data
Hong Ooi
Hong.Ooi at iag.com.au
Tue Nov 29 01:40:16 CET 2005
_______________________________________________________________________________________
Hm, I should have checked what would happen with binary data and not just continuous. Using glm with quasi(var="mu(1-mu)", link=logit) indeed fails with NAs/NaNs when y is binary.
--
Hong Ooi
Senior Research Analyst, IAG Limited
388 George St, Sydney NSW 2000
(02) 9292 1566
-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Sundar Dorai-Raj
Sent: Monday, 28 November 2005 11:20 PM
To: Björn Stollenwerk
Cc: R-help at stat.math.ethz.ch
Subject: Re: [R] glm: quasi models with logit link function and binary data
This is an issue with the starting values provided to glm. Take a look
at the difference between:
quasibinomial()$initialize
and
quasi("logit")$initialize
and where this is used in glm.fit and you should see the why the error
occurs. To avoid this, you can supply your own starting values from a
call to glm
mustart <- predict(glm(y ~ 1, binomial), type = "response")
glm(y ~ 1, quasi("logit"), mustart = mustart)
or just use:
glm(y ~ 1, quasi("logit"), mustart = rep(0.5, length(y)))
HTH,
--sundar
______________________________________________
R-help at stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
_______________________________________________________________________________________
The information transmitted in this message and its attachme...{{dropped}}
More information about the R-help
mailing list