Re: [R] function for between-groups covariance matrix?

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Mon, 07 Apr 2008 07:24:31 +0100 (BST)

If this is a large dataset, you probably do not want the covariance matrix but some decomposition of it. What are you intending to do with it?

If you look at the code for MASS:::lda.default you will see how discriminant analysis can be done more stably without ever computing the covarinace matrix.

But if you need it, it is simple: form the group means (see lda.default) and take their covariance (possibly weighted by group size, depending which definition you are using).

On Mon, 7 Apr 2008, toby wrote:

> Hi
>
> Is anyone aware if there is a function already available that calculates the
> between-groups COvariance matrix, say in a discriminant analysis setting, or in
> a manova setting.
>
> Maybe as a helper function to some other major function.
>
> Otherwise I would have to program it myself (probably resulting in some awkward
> code performing horribly on this large dataset).
>
> Thanks Toby
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
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

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Mon 07 Apr 2008 - 06:27:14 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 07 Apr 2008 - 06:30:26 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive