Weighting exemplar 5 in R
> 
> resp<-glm(cbind(AyrA_num,npop)~agegrp+gender+agegrp*agegrp+agegrp*gender+agegrp*agegrp*gender+sinc+sacc+
+ 
+                                              agegrp*sinc+agegrp*agegrp*sinc,data=data,family=binomial)
Warning message: 
non-integer counts in a binomial glm! in: eval(expr, envir, enclos) 
> 
> print(summary(resp))

Call:
glm(formula = cbind(AyrA_num, npop) ~ agegrp + gender + agegrp * 
    agegrp + agegrp * gender + agegrp * agegrp * gender + sinc + 
    sacc + agegrp * sinc + agegrp * agegrp * sinc, family = binomial, 
    data = data)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-1.5835  -0.8381  -0.6478   0.4631   4.1811  

Coefficients:
                 Estimate Std. Error z value Pr(>|z|)    
(Intercept)    -4.1010816  0.0763599 -53.707  < 2e-16 ***
agegrp          0.0198690  0.0092598   2.146 0.031895 *  
genderM        -0.6984941  0.0790275  -8.839  < 2e-16 ***
sinc           -0.0248137  0.0036854  -6.733 1.66e-11 ***
sacc            0.0427372  0.0236783   1.805 0.071088 .  
agegrp:genderM  0.0826131  0.0093893   8.799  < 2e-16 ***
agegrp:sinc     0.0015570  0.0004379   3.556 0.000377 ***
---
Signif. codes:  0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 11118  on 12472  degrees of freedom
Residual deviance: 10612  on 12466  degrees of freedom
AIC: 17694

Number of Fisher Scoring iterations: 5
 
> #
> # we now get the linear predictor
> #
> lp<-predict(resp)
 #
> # and make it into a predicted probability
> #
> phat<-1/(1+exp(-lp))
> #
>