I?m running some logistic regressions and I?ve been trying to include weights in the equation. However, when I run the model, I get this warning message: Here?s what it says: Warning message: In eval(expr, envir, enclos) : non-integer #successes in a binomial glm! I think it is because the weights are non-integer values. What is a good way to run logistic regressions in R when using non-integer weights? I?ve attached the output from the R console of the two different methods I've tried. The first regression is unweighted. The second regression includes the weights in glm. The third regression includes the weights in svyglm. However, despite using the same weights, I get contradicting results. Perhaps I am misunderstanding how to use one or both of these functions. I'd appreciate any help you can provide. Thanks Brad http://www.nabble.com/file/p25969499/Regressions%2Bwith%2BWeights.txt Regressions+with+Weights.txt -- View this message in context: http://www.nabble.com/Weighted-Logistic-Regressions-using-svyglm-tp25969499p25969499.html Sent from the R help mailing list archive at Nabble.com.
Fulton wrote:> I?m running some logistic regressions and I?ve been trying to include weights > in the equation. However, when I run the model, I get this warning message: > > Here?s what it says: Warning message: In eval(expr, envir, enclos) : > non-integer #successes in a binomial glm! > > I think it is because the weights are non-integer values. > > What is a good way to run logistic regressions in R when using non-integer > weights? > > I?ve attached the output from the R console of the two different methods > I've tried. > > The first regression is unweighted. The second regression includes the > weights in glm. The third regression includes the weights in svyglm. > However, despite using the same weights, I get contradicting results. > Perhaps I am misunderstanding how to use one or both of these functions. >You might be misunderstanding the use of weights in a binomial glm. An excerpt from ?glm: "For a binomial GLM prior weights are used to give the _number of trials_ when the response is the _proportion of successes_" -Peter Ehlers> I'd appreciate any help you can provide. > > Thanks > > Brad > > http://www.nabble.com/file/p25969499/Regressions%2Bwith%2BWeights.txt > Regressions+with+Weights.txt > >
tlumley at u.washington.edu
2009-Oct-20 21:20 UTC
[R] Weighted Logistic Regressions using svyglm
On Mon, 19 Oct 2009, Fulton wrote:> > I?m running some logistic regressions and I?ve been trying to include weights > in the equation. However, when I run the model, I get this warning message: > > Here?s what it says: Warning message: In eval(expr, envir, enclos) : > non-integer #successes in a binomial glm! > > I think it is because the weights are non-integer values.Yes> What is a good way to run logistic regressions in R when using non-integer > weights?You should use family=quasibinomial(). For svyglm() this is identical to binomial() except that it doesn't warn about non-integer weights. I'll update the documentation for svyglm() to make this explicit. -thomas Thomas Lumley Assoc. Professor, Biostatistics tlumley at u.washington.edu University of Washington, Seattle