[R] How to put the dependent variable in GLM proportion model

Greg Snow Greg.Snow at intermountainmail.org
Tue Feb 27 22:06:43 CET 2007



-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at intermountainmail.org
(801) 408-8111
 

The first one should be:
> n <- (S+F)
> share <- S/(S+F)
> glm(share~x, family=quasibinomial, weights=n)

This should give you results more comparable to the second one.  Either
way is acceptable.  

Hope this helps,

> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch 
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of 
> Serguei Kaniovski
> Sent: Tuesday, February 27, 2007 6:37 AM
> To: r-help at stat.math.ethz.ch
> Subject: [R] How to put the dependent variable in GLM proportion model
> 
> 
> Hello everyone,
> 
> I am confused about how the dependent variable should be 
> specified, e.g.
> say S and F denote series of successes and failures. Is it
> 
> share<-S/(S+F)
> glm(share~x,family=quasibinomial)
> 
> or
> 
> glm(cbind(S,F)~x,family=quasibinomial)
> 
> The two variants produce very different dispersion parameter 
> and deviances.
> The book by Crawley, the only one R-book a have, says the 
> second variant is correct for proportions data.
> 
> Serguei
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> 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
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list