Re: [Rd] discrepancy between lm and MASS:rlm

2011-03-14 Thread Vadim Ogranovich
fit$contrasts <- attr(x, "contrasts") fit$xlevels <- .getXlevels(mt, mf) fit$na.action <- attr(mf, "na.action") if (model) fit$model <- mf if (!x.ret) fit$x <- NULL if (y.ret) fit$y <- y fit } -Original

Re: [Rd] discrepancy between lm and MASS:rlm

2011-03-14 Thread William Dunlap
> -Original Message- > From: r-devel-boun...@r-project.org > [mailto:r-devel-boun...@r-project.org] On Behalf Of Vadim Ogranovich > Sent: Monday, March 14, 2011 10:37 AM > To: 'r-devel@r-project.org' > Subject: [Rd] discrepancy between lm and MASS:rlm > &

[Rd] discrepancy between lm and MASS:rlm

2011-03-14 Thread Vadim Ogranovich
Dear R-devel, There seems to be a discrepancy in the order in which lm and rlm evaluate their arguments. This causes rlm to sometimes produce an error where lm is just fine. Here is a little script that illustrate the issue: > library(MASS) > ## create data > n <- 100 > dat <- data.frame(x=rep(