Several bugs (no solutions, yet). These might be well known. 1) If one does, e.g., mymod <- lm(y ~ x); formula(mymod) then one does not get back the formula (one gets, Error: invalid formula) 2) if x is of mode numeric, then the model formula mymod <- lm(y ~ x + x^2) is not processed as S would do it. The model is fit ignoring the x^2 term, however mymod$call includes the x^2 term. This seems to be a bug (or maybe feature) in applying model formulae operators to numeric quantities. I expect (from experience with S) that x^2 will be interpreted as a math operator. Whatever the right thing to do is, it needs to be documented. Regards, --Mike Mike Meyer, Department of Statistics, Carnegie Mellon University =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-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 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Mike Meyer <mikem at stat.cmu.edu> writes:> > Several bugs (no solutions, yet). These might be well known. > > 1) If one does, e.g., mymod <- lm(y ~ x); formula(mymod) > then one does not get back the formula (one gets, Error: invalid formula)Yep. Seems that we need a formula.lm<-function(x)formula(x$terms)> > 2) if x is of mode numeric, then the model formula > mymod <- lm(y ~ x + x^2) > is not processed as S would do it. The model is fit ignoring the x^2 term,We had that topic a while back. I think it was concluded that it is a feature, because mixing model formulas and arithmetic ditto is bad practice. (I don't have any strong feeling about this, personally. As long as R won't introduce those awful Helmert contrasts as default...) -- 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 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=