Re: [R] R versus SAS: lm performance

About this list Date view Thread view Subject view Author view Attachment view

From: Peter Dalgaard (
Date: Tue 11 May 2004 - 23:13:51 EST

Message-id: <>

Prof Brian Ripley <> writes:

> > Hmm. Shouldn't be all that much faster, but it will produce the Type I
> > SS as you go along, whereas R probably wants to fit the 15 different
> > models.
> Nope, R can read off the Type I SSQs from the QR decomposition so only one
> fit is done. (Effectively you remove the effect of one column at a time,
> and you get the change in residual/regression SSq as a side effect. Take
> a look at anova.lm, which just aggregates squared effects over terms.)

OK, thanks.
> > I'm still surprised that R/S-PLUS manages to use a full 15 minutes on
> > a single response variable. It might be due to the singularities --
> > the SAS code indicated that there was a nesting issue with the "A"
> > factor in the last 4-factor interaction. If so, a reformulation of the
> > model might help.
> I think we need to understand this better. My guess (but only a guess) is
> that the model matrix has very many columns and is highly singular. If
> the singularity is by design, a reformulation will help.

It's certainly not a completely balanced factorial:


so it could be one in several way, but not with a main effects with 4 DF.

An even less well-founded guess is that it might help to replace the
last term with interaction(Ar,Ba,Ti,Pr,drop=TRUE) (if I remembered the
names correctly).

   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (             FAX: (+45) 35327907

______________________________________________ mailing list PLEASE do read the posting guide!

About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Mon 31 May 2004 - 23:05:09 EST