[R] ANOVA help
Prof Brian Ripley
ripley at stats.ox.ac.uk
Tue Aug 12 11:58:25 CEST 2008
On Tue, 12 Aug 2008, Gareth Campbell wrote:
> Hmm, I have my elements (as in chemical elements) as columns and my samples
> as rows. This is the normal way round for all my other analyses. I think I
> figured it out... I have 6 groups, all of about 10-12 samples and each with
> 31 elements. So for each group there are many more elements than samples
> and it makes the analysis impossible due to the problems of the singular
> covariance matrix, if I've got that right.
> Is that the problem?
If this is a MANOVA with 31 responses (elements) then the problem is that
those responses are linearly dependent after subtracting group means (and
quite possibly before). With 86 samples this is not normal (MANOVA is
using a common covariance matrix for each group, not one for each group).
I do wonder what your aim is: this seems to be using MANOVA to do LDA.
> 2008/8/12 S Ellison <S.Ellison at lgc.co.uk>
>
>> Rank deficiency is usually an indication of under-determination, if I've
>> got it right.
>>
>> But something is clearly odd, because with 31-column matrix of 86 rows,
>> you should have 86 residuals for each of 31 models, not 31 residuals.
>> Could your matrix be the wrong way round?
>>
>>
>>>>> "Gareth Campbell" <gcam032 at gmail.com> 11/08/2008 23:38 >>>
>> Thanks for that, the error I get when I use manova is this:
>>
>> Error in summary.manova(fit) : residuals have rank 30 < 31
>>
>> What does this mean??
>>
>> When I call the formula I get 31 residuals and 31 residual standard
>> errors.
>> Not sure why I get this error?
>>
>> Thanks
>>
>> Gareth
>>
>>
>> 2008/8/11 S Ellison <S.Ellison at lgc.co.uk>
>>
>>> test="Wilks" is available in summary.manova, but not in summary.aov;
>>> could that be the problem? I find in ?summary.manova the example
>> makes a
>>> clear distinction between these three summaries...
>>>
>>> fit <- manova(Y ~ rate * additive)
>>> summary.aov(fit) # univariate ANOVA tables
>>> summary(fit, test="Wilks") # ANOVA table of Wilks' lambda
>>> summary(fit) # same F statistics as single-df
>> terms
>>>
>>> Another common variable in anova using R is the way contrasts are
>> set;
>>> you might check that with your colleague?.
>>>
>>> Steve E
>>>
>>>>>> "Gareth Campbell" <gcam032 at gmail.com> 08/10/08 11:43 PM >>>
>>> Hi,
>>>
>>> I'm doing anova on a matrix of multivariate data where I want to
>> assess
>>> the
>>> effect of each column (element).
>>>
>>> My matrix is 86 rows x 31 columns. I've created a grouping factor
>> of
>>> length
>>> 86 containing group assignments of 6 types.
>>>
>>> Then I run:
>>>
>>> x<- aov(matrix~grouping.factor)
>>> summary(aov.fit.raw, test="Wilks")
>>>
>>> This is working fine enough, but I'm getting different results to
>>> someone
>>> who I'm comparing with - am I doing what I think I am doing here??
>>>
>>> What I think I'm doing is - take the first column (element) and then
>>> look at
>>> that element between the 6 groups and report F, Pvalue etc..., then
>> move
>>> onto the 2nd column and repeat.
>>>
>>> Thanks
>>>
>>>
>>>
>>> --
>>> Gareth Campbell
>>> PhD Candidate
>>> The University of Auckland
>>>
>>> P +649 815 3670
>>> M +6421 256 3511
>>> E gareth.campbell at esr.cri.nz
>>> gcam032 at gmail.com
>>>
>>> [[alternative HTML version deleted]]
>>>
>>> ______________________________________________
>>> 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.
>>>
>>>
>>> *******************************************************************
>>> This email and any attachments are confidential. Any use, copying or
>>> disclosure other than by the intended recipient is unauthorised. If
>>> you have received this message in error, please notify the sender
>>> immediately via +44(0)20 8943 7000 or notify postmaster at lgc.co.uk
>>> and delete this message and any copies from your computer and
>> network.
>>> LGC Limited. Registered in England 2991879.
>>> Registered office: Queens Road, Teddington, Middlesex, TW11 0LY, UK
>>>
>>
>>
>>
>> --
>> Gareth Campbell
>> PhD Candidate
>> The University of Auckland
>>
>> P +649 815 3670
>> M +6421 256 3511
>> E gareth.campbell at esr.cri.nz
>> gcam032 at gmail.com
>>
>> *******************************************************************
>> This email and any attachments are confidential. Any u...{{dropped:24}}
>
> ______________________________________________
> 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
More information about the R-help
mailing list