[Rd] For wishlist: sanity checks for subsets in lm, glm (PR#515)

Peter Dalgaard BSA p.dalgaard@biostat.ku.dk
12 Apr 2000 12:12:59 +0200

plummer@iarc.fr writes:

> to preserve cond as a logical vector, as documented in the help for
> data.frame.  However, it is still very unpleasant behaviour, and no
> warnings were issued.  I can't help thinking that some sanity checks on
> the subset argument could have helped me.
> So I suggest that the subset argument should either be
> * A logical vector of the same length as the number of rows in the data
>   frame, or
> * A numeric vector of unique integers
> to ensure that we really do get a subset of the data frame. The more
> flexible behaviour of "[.data.frame" really isn't required here.

Might be a good idea. Mind you, Splus 3.4 does exatly the same thing,
and I'm a little worried that the uniqueness assumption might kill
some bootstrapping applications:

 glm(y ~ x, data=test.data, subset=sample(seq(along=y),replace=T))

   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
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