Message-ID: <CAJ55+dLzJ_v_17ZchLP--LofddO-+1qDWb9PbkU-9R_QYuNLig@mail.gmail.com>
Date: 2011-10-11T19:11:15Z
From: Thomas Lumley
Subject: SLOW split() function
In-Reply-To: <CAPr7RtX7_7gx8tqk-th=FHQAc7fHMr3GNio5nj21TsHDSS9_uQ@mail.gmail.com>
On Wed, Oct 12, 2011 at 4:56 AM, ivo welch <ivo.welch at gmail.com> wrote:
> thanks, josh. ?in my posting example, I did not need anything except
> coefficients. ?(when this is the case, I usually do not even use
> lm.fit, but I eliminate all missing obs first and then use solve
> crossprod(y,cbind(1,x)) crossprod(cbind(1,x)).) ?this is pretty fast.)
solve(cbind(1,x), y) should be even faster, and more numerically stable,
[and less likely to make certain people want to cast you into the
outer darkness, where there is SAS and gnashing of teeth]
> alas, I will need to figure how to get coef standard errors faster in
> this case. ?summary.lm() is really slow.
The code from summary.lm that actually computes the standard errors is
fairly efficient; you could extract that.
-thomas
--
Thomas Lumley
Professor of Biostatistics
University of Auckland