[R] GLM Contingency table regressions - more details.

Paul M. Jacobson pmj at jciconsult.com
Sun Aug 11 13:30:52 CEST 2002


I have a contingency table with a 0/1 variable (fwr) that flags a particular
condition, a weight variable (cnt) and other variables (e.g. zz)
characterizing that observation of the table.
I am trying to use GLM. By converting the variables to factors and running
the following regression:
fwr1<-factor(fwr)
zz1<-factor(zz1)
res1<-glm(fwr1 ~ zz1,weights=cnt,family=binomial)

Is that appropriate?  The issue is getting the appropriate regression
diagnostics.  The alternative would be to aggregate the dataset and
calculate the sample proportions for the true/false of fwr using the case
weights.  In other words, combine each pair of rows in the contingency
dataset that are identical except for the fwr and use the cnt weights as the
true/false proportions.  Would that give me better results.

Paul M. Jacobson
Jacobson Consulting Inc.
80 Front Street East, Suite 720
Toronto, ON, M5E 1T4
Voice:  +1(416)868-1141
Farm: +1(519)463-6061/6224
Fax: +1(416)868-1131
E-mail: pmj at jciconsult.com
Web:  http://www.jciconsult.com/

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list