Dear Paolo, 

when you use anova.lm(lm..., you perform a univariate test, while
anova(lm... perform the multivariate one. In your case, when you write
anova.lm(lm, even if your response is a matrix, only the first column will
be considered in the formula (you can check this in using only the first
column of your matrix). This explains why you get different p-values and
why you have a F stat in one and a multivariate stat in the other. If you
want to perform the summary something on your multivariate model, you must
write summary(manova...and not summary(lm...
Note that summary( and anova( do different things on a linear model since
the first test the parameters while the second test the effects.

HTH

Julien CLAUDE




On Mon, 24 Oct 2011 16:55:45 +0200 (CEST), ppi...@uniroma3.it wrote:
> Dear all,
> 
> I write you in order to ask some help in interpreting
> global multivariate tests using pics of a model
> including multivariate response and an univariate
> predictor.
> 
> I APOLOGIZE IN ADVANCE IF MY QUESTION WILL RESULT
> TRIVIAL.
> 
> I found substantial differences using summary.lm(),
> anova.lm() and anova() under the multivariate model,
> while for the univariate one they do not differ.
> Moreover, in summary.lm() the p-value that equates
> that of anova.lm() is NOT that at the end of output,
> but that close to the coefficient that is NOT the
> p-value of that coefficient. This can be checked in
> the univariate  output using summary(). Probably it is
> a bug of summary.lm()
> 
> Using my REAL data I found no significance under
> anova.lm() and summary.lm() and a STRONG significance
> using anova()
> 
> I attach here below a piece of code that is a
> simulation and consequently the three tests can return
> coherent results in term of significance but anova()
> always differs. Depending on chance (it is a
> simulation) anova() could differ in significance also,
> like with my real data.
> Univariate case is not affected by this.
> Thanks in advance for any advice
> best
> Paolo
> 
> 
> tr <- rcoal(30)
> Y <-
> as.matrix(cbind(rTraitCont(tr),rTraitCont(tr),rTraitCont(tr)))
>  ### a multivariate response
> x <- rTraitCont(tr)
> 
> ####### I compute pics for every variable in Y
> picss<-NULL
> 
> for(i in 1:ncol(Y))
>       {
>       picss<-cbind(picss,pic(as.matrix(Y[,i]),tr))
> 
> }
> 
> picss<-as.matrix(picss)
> 
> 
> #######  MULTIVARIATE: anova() differs.......
> summary.lm(lm(picss~pic(x,tr)-1))
> anova.lm(lm(picss~pic(x,tr)-1))
> anova(lm(picss~pic(x,tr)-1))
> 
> #### UNIVARIATE: NO DIFFERENCES
> summary.lm(lm(picss[,1]~pic(x,tr)-1))
> anova.lm(lm(picss[,1]~pic(x,tr)-1))
> anova(lm(picss[,1]~pic(x,tr)-1))
> 
> _______________________________________________
> R-sig-phylo mailing list
> R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo

_______________________________________________
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo

Reply via email to