On Fri, 17 Apr 1998 mike_fleming at nass.usda.gov wrote:> > Does R have a function like the S(plus) function, lmsreg, Least Median > of Squares Regression? I am using R-0.61. >Not at the moment. There have been occasional noises from people indicating that they might write these functions (there is S and C/FORTRAN available), but I don't know if anything has happened. BTW, lmsreg is deprecated even in S-PLUS. Least trimmed squares (ltsreg) has almost the same breakdown point and is much more efficient. We don't have ltsreg either. Thomas Lumley ------------------------------------------------------+------ Biostatistics : "Never attribute to malice what : Uni of Washington : can be adequately explained by : Box 357232 : incompetence" - Hanlon's Razor : Seattle WA 98195-7232 : : ------------------------------------------------------------ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Does R have a function like the S(plus) function, lmsreg, Least Median
of Squares Regression? I am using R-0.61.
Thank you,
Mike Fleming
mfleming at nass.usda.gov
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
The "assign" attribute for model matrices has mutated in S-PLUS (probably in 3.3 or 3.4) -- the model code is obviously not subject to enough evolutionary pressure to keep mutations down. Now it returns a list with elements named for each model term, giving the vector of column numbers arising from that term> y<-1:10 > x<-1:10 > attr(model.matrix(~y+factor(x)),"assign")$"(Intercept)": [1] 1 $y: [1] 2 $"factor(x)": [1] 3 4 5 6 7 8 9 10 11 I don't think we necessarily want to change from our attr(,"assign"), which follows Chambers & Hastie, but we may want to be able to create a compatible version. This can be done by the following function, which needs the terms object as well as the model matrix attrassign<-function(mmat,tt){ if (!inherits(tt,"terms")) stop("need terms object") aa<-attr(mmat,"assign") if (is.null(aa)) stop("argument is not really a model matrix") ll<-attr(tt,"term.labels") if (attr(tt,"intercept")>0) ll<-c("(Intercept)",ll) aaa<-factor(aa,labels=ll) split(order(aa),aaa) } Perhaps we should add another attribute ("S.assign") to model matrices? Thomas Lumley ------------------------------------------------------+------ Biostatistics : "Never attribute to malice what : Uni of Washington : can be adequately explained by : Box 357232 : incompetence" - Hanlon's Razor : Seattle WA 98195-7232 : : ------------------------------------------------------------ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._