Re: [R] R versus SAS: lm performance

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

From: Peter Dalgaard (p.dalgaard@biostat.ku.dk)
Date: Tue 11 May 2004 - 23:13:51 EST


Message-id: <x2ad0f3y40.fsf@biostat.ku.dk>

Prof Brian Ripley <ripley@stats.ox.ac.uk> 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:

1344=2*2*2*2*2*2*3*7

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
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907

______________________________________________ R-help@stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


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