Dear all, I'm analyzing a binary outcome using glm() with a binomial distribution and a logit link, and have now reached the point where I'd like to do some model checking. Since my data are in binary form I'd like to collapse over the cross-classification of the factors before the model checking. Are there any nice and simple ways doing this? If so, how? If not, I'd be grateful for receiving some hints on how this can be accomplished. Many thanks, Henric --------------------------------------------------------------------------------------- Henric Nilsson, Statistician Statisticon AB, ?stra ?gatan 31, SE-753 22 UPPSALA Phone (Direct): +46 (0)18 18 22 37 Mobile: +46 (0)70 211 68 36 Fax: +46 (0)18 18 22 33 <http://www.statisticon.se>
Grouping binary data
4 messages · Henric Nilsson, Brian Ripley, vito muggeo +1 more
On Thu, 19 Jun 2003, Henric Nilsson wrote:
Dear all, I'm analyzing a binary outcome using glm() with a binomial distribution and a logit link, and have now reached the point where I'd like to do some model checking. Since my data are in binary form I'd like to collapse over the cross-classification of the factors before the model checking. Are there any nice and simple ways doing this? If so, how? If not, I'd be grateful for receiving some hints on how this can be accomplished.
Look at loglm1.data.frame in package MASS, or xtabs: each work by setting up a suitable call to table. If you want to sum up over cases with the same factors (not what is usually meant by collapsing), take a look at multinom (package nnet) which has options to do this for multinomials (and Bernoulli is a special case).
Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Dear Henric, The following paper deals with goodness-of-fit test for sparse (and even binary) data: Kuss O. Global goodness-of-fit tests in logistic regression with sparse data, Statist Med, 2002, 21:3789-3801. It should not too hard to write code for some non-standard and (probably under-used) GoF statistics... hope this helps you, best, vito ----- Original Message ----- From: Henric Nilsson <henric.nilsson at statisticon.se> To: <r-help at stat.math.ethz.ch> Sent: Thursday, June 19, 2003 2:35 PM Subject: [R] Grouping binary data Dear all, I'm analyzing a binary outcome using glm() with a binomial distribution and a logit link, and have now reached the point where I'd like to do some model checking. Since my data are in binary form I'd like to collapse over the cross-classification of the factors before the model checking. Are there any nice and simple ways doing this? If so, how? If not, I'd be grateful for receiving some hints on how this can be accomplished. Many thanks, Henric ---------------------------------------------------------------------------- ----------- Henric Nilsson, Statistician Statisticon AB, ?stra ?gatan 31, SE-753 22 UPPSALA Phone (Direct): +46 (0)18 18 22 37 Mobile: +46 (0)70 211 68 36 Fax: +46 (0)18 18 22 33 <http://www.statisticon.se> ______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
I too am interested in analysis of sparse data, and I couldn't find this journal easily, but I found an Oliver Kuss presentation that likely summarizes the material. You can find that presentation here: http://www.stats.gla.ac.uk/~goeran/euroworkshop/webpages/2002/slides/oliver.pdf (Also, apparently there is a SAS/IML macro that was discussed at SUGI 26.) douglas
Vito Muggeo wrote:
Dear Henric, The following paper deals with goodness-of-fit test for sparse (and even binary) data: Kuss O. Global goodness-of-fit tests in logistic regression with sparse data, Statist Med, 2002, 21:3789-3801. It should not too hard to write code for some non-standard and (probably under-used) GoF statistics... [...]