bug in glm (PR#397)
holzer@stat.math.ethz.ch
holzer@stat.math.ethz.ch
Mon, 10 Jan 2000 18:07:03 +0100 (MET)
Prof Brian Ripley writes:
> > Date: Mon, 10 Jan 2000 11:53:50 +0100 (MET)
> > From: holzer@stat.math.ethz.ch
> >
> > Dear R-team
> >
> > As I didn't get any answer to my bug-report last week I have taken the
> > effort and extracted a minimal data set from my data (see below) where the
> > following bug occurs:
> >
> > > glm(SKR.ein.aus ~ ., family = binomial, data = bugdata, na.action = na.omit)
> > Error in names<-.default(*tmp*, value = ynames) : names attribute must be the
> same length as the vector
> Indeed, thank you (we needed an example). Alter
>
> names(w) <- ynames
>
> to
> names(w) <- ynames[good]
>
> and
>
> names(fit$effects) <-
> c(xxnames[seq(fit$rank)], rep("", nobs - fit$rank))
>
> to
> names(fit$effects) <-
> c(xxnames[seq(fit$rank)], rep("", sum(good) - fit$rank))
>
> as the vector w is dropping observations with fitted probs 0 or 1.
This is actually a solution I thought of as well. However it has the
disadvantage that plot (and other functions?) gets problems:
> fit.tst <- glm(SKR.ein.aus ~ ., family = binomial, data = bugdata)
Warning messages:
1: fitted probabilities of 0 or 1 occurred in: (if (is.empty.model(mt))
glm.fit.null else glm.fit)(x = X, y = Y,
.
.
.
7: Algorithm did not converge in: (if (is.empty.model(mt)) glm.fit.null else glm.fit)(x = X, y = Y,
> plot(fit.tst)
Warning messages:
1: longer object length
is not a multiple of shorter object length in: sqrt(w) * r
2: longer object length
is not a multiple of shorter object length in: r/sqrt(1 - hii)
3: longer object length
is not a multiple of shorter object length in: sqrt(w) * r
4: longer object length
is not a multiple of shorter object length in: sqrt(w) * r
5: longer object length
is not a multiple of shorter object length in: e/(s * (1 - h))
6: longer object length
is not a multiple of shorter object length in: (e/(s * (1 - h)))^2 * h
Maybe there is another solution?
Nevertheless, thanks for the help!
____________________________________________________________
Peter Holzer phone: + 41 1 632 46 34
Seminar fuer Statistik, LEO C14 fax: + 41 1 632 12 28
(Leonhardstr. 27) <holzer@stat.math.ethz.ch>
ETH (Federal Inst. Technology)
8092 Zurich http://www.stat.math.ethz.ch/~holzer/
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._