[R] Hotelling Test

Peter Dalgaard p.dalgaard at biostat.ku.dk
Wed Sep 7 18:35:17 CEST 2005


Peter Dalgaard <p.dalgaard at biostat.ku.dk> writes:

> "Francisco J. Zagmutt" <gerifalte28 at hotmail.com> writes:
> 
> > Check some of the threads at RSiteSearch("Hotelling")
> 
> Or use anova(lm(X~g), test="Hotelling"), where X is the matrix of
> responses and g is the grouping factor.

Oops, sorry. That is in r-devel only. For R 2.1.1 you need an explicit
comparison of models:

anova(lm(X~g), lm(X~1), test="Hotelling")

For the one-sample test, you probably need to sweep() out the
H0 column mean vector and compare X~1 to X~-1 .
  
> > Cheers
> > 
> > Francisco
> > 
> > >From: Bill Donner <bdonner2 at yahoo.com>
> > >To: R-help at stat.math.ethz.ch
> > >Subject: [R] Hotelling Test
> > >Date: Wed, 7 Sep 2005 06:48:06 -0700 (PDT)
> > >
> > >Hello R-users,
> > >
> > >I've been looking for a function performing one and two sample Hotelling
> > >test for testing equality of mean vectors. Has anyone implemented such a
> > >function in R?
> > >
> > >
> > >thanks a lot,
> > >
> > >Bill
> > >
> > >==============
> > >Bill Donner
> > >Statistician
> > >
> > >______________________________________________
> > >R-help at stat.math.ethz.ch mailing list
> > >https://stat.ethz.ch/mailman/listinfo/r-help
> > >PLEASE do read the posting guide! 
> > >http://www.R-project.org/posting-guide.html
> > 
> > ______________________________________________
> > R-help at stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> > 
> 
> -- 
>    O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
>   c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
>  (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
> ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> 

-- 
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907




More information about the R-help mailing list