Re: [R] extracting residuals from glm object

2009-05-12 Thread Marc Schwartz
On May 12, 2009, at 3:50 AM, utkarshsinghal wrote: Hi All, Can anybody explain why the following three ways of extracting residuals from a glm object are giving me different outputs: > idv = runif(1000,0,1) > dv = rbinom(1000,1,0.5) > d = data.frame(idv,dv) > fit = glm(dv~idv, data=d, famil

[R] extracting residuals from glm object

2009-05-12 Thread utkarshsinghal
Hi All, Can anybody explain why the following three ways of extracting residuals from a glm object are giving me different outputs: > idv = runif(1000,0,1) > dv = rbinom(1000,1,0.5) > d = data.frame(idv,dv) > fit = glm(dv~idv, data=d, family=binomial) > head(residuals(fit)) 1 2