[R] how to fit a weighted logistic regression?

Kerry Bush kerryrekky at yahoo.com
Wed Dec 15 05:22:53 CET 2004


I tried lrm in library(Design) but there is always
some error message. Is this function really doing the
weighted logistic regression as maximizing the
following likelihood:

\sum w_i*(y_i*\beta*x_i-log(1+exp(\beta*x_i)))

Does anybody know a better way to fit this kind of
model in R?

FYI: one example of getting error message is like:
> x=runif(10,0,3)
> y=c(rep(0,5),rep(1,5))
> w=rep(1/10,10)
> fit=lrm(y~x,weights=w)
Warning message: 
currently weights are ignored in model validation and
bootstrapping lrm fits in: lrm(y ~ x, weights = w) 

although the model can be fit, the above output
warning makes me uncomfortable. Can anybody explain
about it a little bit?

Best wishes,
Feixia




More information about the R-help mailing list