[R] lm with data=(means,sds,ns)

Prof Brian Ripley ripley at stats.ox.ac.uk
Sun Apr 18 14:05:20 CEST 2004


On Sun, 18 Apr 2004 Ted.Harding at nessie.mcc.ac.uk wrote:

> Thanks, Brian!
> 
> On 18-Apr-04 Prof Brian Ripley wrote:
> > The short answer is no, as there is no way to recover the fitted values
> 
> Well, the fitted values (a + b*x_i) would be available, as would be
> the estimates and SEs of coefficients, sums of squares, and relevant
> F ratios and P values.

Many of those are calculated from the residuals ....

> > and residuals so you can't get a proper fit object of class "lm" (and 
> > hence get `summaries and all').
> 
> Residuals granted. However, much of what is useful in 'summary.lm'
> would be supported. So also (which is what I really wanted a lazy
> route to) would be the requisite summary statistics to generate
> confidence and prediction bands as in 'predict.lm'.

But the residual sum of squares is calculated from the residuals, so you 
are missing the estimate of sigma^2.

> > Your pseudo-data method needs to fix the u_i to be mean zero,
> > variance one in the sample.  That is probably the quickest method. 
> > The elegant one is to create a new class "groupedlm" and write a
> > constructor etc for it
> 
> That's the sort of thing I feared! No time for that at the moment,
> though one day I may find it to be an absorbing exercise in extending
> my R skills and understanding.
> 
> Anyway, I'm grateful to know what the position is. At least I can now
> feel happy about having to roll up my sleeves and get stuck in the
> hard way.
> 
> Best wishes,
> Ted.
> 
> 
> --------------------------------------------------------------------
> E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk>
> Fax-to-email: +44 (0)870 167 1972
> Date: 18-Apr-04                                       Time: 12:26:51
> ------------------------------ XFMail ------------------------------
> 
> ______________________________________________
> R-help at 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
> 
> 

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list