Skip to content

dropterm in MANOVA for MLM objects

7 messages · Vickie S, John Fox

#
Dear Vicki,

I think that the Anova() function in the car package will do what you want
(and will also properly handle models with more structure, such as
interactions).

Best,
 John

--------------------------------
John Fox
Senator William McMaster
  Professor of Social Statistics
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
http://socserv.mcmaster.ca/jfox
#
Dear Prof Fox,
I tried anova but got the following error message:

mat <- matrix(rnorm(700), ncol=5, dimnames=list( paste("f", c(1:140), sep="_"), c("A", "B", "C", "D", "E")))
summary(Anova(lm(cbind(A, B, C, D, E) ~ factor(rownames(mat)), data=as.data.frame(mat))))

Error in summary(Anova(lm(cbind(A, B, C, D, E) ~ factor(rownames(mat)),? : 
? error in evaluating the argument 'object' in selecting a method for function 'summary': Error in linearHypothesis.mlm(mod, hyp.matrix.2, SSPE = SSPE, V = V, ...) : 
? The error SSP matrix is apparently of deficient rank = 0 < 5

I looked in previous forum and it seems like i have only option of performing the univariate test here. 

Therefore I used the following, but it still results in an error message:
Anova(lm(cbind(A, B, C, D, E) ~ factor(rownames(mat)), data=as.data.frame(mat)), univariate=TRUE, multivariate=F)
Error in linearHypothesis.mlm(mod, hyp.matrix.2, SSPE = SSPE, V = V, ...) : 
? The error SSP matrix is apparently of deficient rank = 0 < 5

Any suggestions ?

Thanks
Vickie



I think I am still missing some important clues here. Is it because the feww
#
Dear Vickie,

I'm afraid that the test problem that you've constructed makes no sense, and
doesn't correspond to the problem that you initially described, in which a
matrix of presumably 5 responses for presumably 140 observations is
regressed on 6 predictors. You regressed your randomly generated matrix of 5
responses and 140 observations on a factor constructed from the distinct 140
observation names. That factor has 140 levels, and so the model uses 140 df,
all the df in the data. It's therefore not surprising that the error SSP
matrix has 0 df, which is exactly what Anova.mlm (actually,
linearHypothesis.mlm, which it calls) tells you.

The remark that you found about univariate tests that you apparently found
on-line concerns repeated-measures designs and is not relevant to your data.
And you can't do a univariate ANOVA when there's 0 df for error in any
event.

Here's a proper simulation of the kind of data that I think you have:
chmax, data=Data)
Type II MANOVA Tests: Pillai test statistic
      Df test stat approx F num Df den Df    Pr(>F)    
syct   1   0.41622   18.395      5    129  9.31e-14 ***
mmin   1   0.48288   24.091      5    129 < 2.2e-16 ***
mmax   1   0.62100   42.273      5    129 < 2.2e-16 ***
cach   1   0.61711   41.583      5    129 < 2.2e-16 ***
chmin  1   0.72547   68.180      5    129 < 2.2e-16 ***
chmax  1   0.54825   31.311      5    129 < 2.2e-16 ***
---
Signif. codes:  0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1

Best,
 John
#
Thanks for nice explanation. 
Unfortunately, matrix in my question is exactly similar to the one I posted earlier : 

mat <- matrix(rnorm(700), ncol=5, dimnames=list( paste("f", c(1:140),sep="_"), c("A", "B", "C", "D", "E"))) 


Question here is which of the 140 characteristics (i.e. f_1...f_140) distinguish the most between the five plant
species.

Is it true that this matrix can't be regressed with factor responses (species) ? If so, what alternatives can be used ?

?
-? Vickie


----------------------------------------

        

            

        
        

        

        

            
#
Dear Vickie,

No one will be able to wave a magic wand over your data to allow you to usefully estimate linear models with 0 df for error, and you certainly can't perform statistical tests. As Peter Dalgaard pointed out, the same confusion was reflected in your subsequent question about Hotelling's T^2. Hotelling T^2 is equivalent to MANOVA when there are two groups.

Best,
 John

On Thu, 9 Feb 2012 09:38:51 +0100
Vickie S <isvik at live.com> wrote:
------------------------------------------------
John Fox
Sen. William McMaster Prof. of Social Statistics
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
http://socserv.mcmaster.ca/jfox/
#
Anywez, I have figured out a solution. Whether it is a magic wand or something else, that I don't know but I wish it would work.

Thx for the critical stand.

-- Vickie



----------------------------------------