[R] logistic regression with percentages
david.clayton at mrc-bsu.cam.ac.uk
Mon Feb 12 13:27:35 CET 2001
Peter is only partly right in his reply below. Certainly glm() will not give
the right standard errors. However, you could use the gee() software, which
includes "robust" (information sandwich) standard errors based upon empirical
variances of residuals (rather than on a binomial assumption). I have my own
code to calculate information-sandwich standard errors after fitting a glm,
but its somewhat untidy.
However, this suggestion will only work is you have a large number of units
(otherwise there are insufficient df to estimate empirical variance).
> "Oscar" <orp at intras.es> writes:
> > Hello
> > I've got some data and I want to fit a binomial glm. The problem is that =
> > I don't have the number of successes or failures, I have only the =
> > percentages. If I want to make all these numbers integers, I have to =
> > multiply them for 1000, because there are some low percentages (0.05%). =
> > Besides, I don't know if this is correct.
> > Any help?
> > Thanks in advance, and sorry for my english
> > Julio G=F3mez
> If you really only have percentages, then your analysis will come out
> wrong whatever you do: It makes a substantial difference whether 50%
> means "1 of 2" or "316 of 632"!
> If you can get the total number in each group, you should *divide* the
> percentages by 100 to get probabilities and use the weight= argument
> to glm with the number of cases.
> O__ ---- Peter Dalgaard Blegdamsvej 3
> c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
> (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
> ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
> 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
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