# Re: [R] Estimating QAIC using glm with the quasibinomial family

From: Kunio takezawa <r.otasuke_at_gmail.com>
Date: Wed, 07 May 2008 11:40:37 +0900

R-users
E-mail: r-help_at_r-project.org

>My question is: Will this calculation be valid with the residual deviance
>returned by the glm() function using the quasibinomial family as
>reported in R?

Let me show you a simple example, assuming c=2.5:

function ()
{

xx <- c(1,2,3,4,5,6,7,8,9,10)
yy <- c(1,0,1,0,0,1,0,1,1,1)
data1 <- data.frame(x=xx, y=yy)
out1 <- glm(y~x, data=data1, family=binomial)    print(out1)
aic0 <- out1\$aic
print("aic0")
print(aic0)

dev1 <- out1\$deviance
aic1 <- dev1+ 2*2
print("aic1")
print(aic1)

c1 <- 2.5
qaic1 <- dev1/c1+ 2*2
print("qaic1")
print(qaic1)
}

The result is:

Call: glm(formula = y ~ x, family = binomial, data = data1)

Coefficients:

```(Intercept)            x
-0.7300       0.2131

Degrees of Freedom: 9 Total (i.e. Null);  8 Residual
Null Deviance:      13.46
Residual Deviance: 12.63        AIC: 16.63
[1] "aic0"
[1] 16.63054
[1] "aic1"
[1] 16.63054
```

[1] "qaic1"
[1] 9.052216

I hope that this R program will be of some help to you.

K. Takezawa

[[alternative HTML version deleted]]

R-help_at_r-project.org 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. Received on Wed 07 May 2008 - 02:55:08 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 07 May 2008 - 18:30:35 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.