Package‘Hotelling’
February19,2015
Version1.0-2
Date2013-11-06
Title Hotelling's T-squared test and variants
Author James M.Curran<j.curran@>
Maintainer James M.Curran<j.curran@>
Description A t of R functions and data ts which implements Hotelling's T^2test,and some vari-ants of it.Functions are also included for Aitchison's additive log ratio and centred log ra-
tio transformations
Depends corpcor
Licen GPL(>=2)
笔记本电脑品牌排行榜
URL www.stat./showperson?firstname=James&surname=Curran NeedsCompilation no
疏通下水Repository CRAN
Date/Publication2013-11-0607:11:01
R topics documented:
alr (2)
bottle.df (3)
clr (3)
container.df (4)
hotelling.stat (5)
st (8)
情感大师st (9)
Index10南昆山森林公园
1
2alr alr Additive log ratio transformation
Description
Aitchison’s additive log ratio tranformation for compositional data
Usage
alr(form,data,group=NULL)
Arguments
form a formula which specifies the denominator variable as the respon
data a data frame in which the data is stored
group if not NULL then a character string specifying the name of the grouping variable Details
This function will give a warning if zeros are prent becau the transformed data will have-Infs. Value
a data frame with the ALR transformation applied to data.Each row in the data frame is standard-
ized with respect to a specific variable by dividing by that variable.The logarithms of the resulting ratios are returned.If a grouping variable is specified,then this is prerved.
Author(s)
James M.Curran
References嘀嗒简谱
Aitchison,J.(1986).“The Statistical Analysis of Compositional Data”,Chapman and Hall,reprinted in2003with additional material by The Blackburn Press
See Also
clr
Examples
data(bottle.df)
##transform with respect to mangane
alr(Mn~.,bottle.df,"Number")
##transform the data with respect to barium,but removing the
bottle.df3 ##grouping in column1
alr(Ba~.,bottle.df[,-1])
bottle.df Bottle data
Description
This data contains the elemental concentration offive different elements(Mangane,Barium, Stronti
ps颜色填充
um,Zirconium,and Titanium)in samples of glass taken from six different Heineken beer bottles.20measurements were taken from each bottle.
Usage
金瓶双艳下载data(bottle.df)
References
R.L.Bennett.Aspects of the analysis and interpretation of glass trace evidence.Master’s thesis, Department of Chemistry,University of Waikato,2002.
clr Centered log ratio transformation
Description
Aitchison’s centered log ratio tranformation for compositional data
Usage
clr(data,group=NULL)
Arguments
data a data frame in which the data is stored
group if not NULL then a character string specifying the name of the grouping variable Details
This function will give a warning if zeros are prent becau the transformed data will have-Infs. Value
a data frame with the CLR transformation applied to data.Each row in the data frame is standardized
by dividing by the geometric mean of that row.The logarithms of the resulting ratios are returned.
If a grouping variable is specified,then this is prerved.
4container.df Author(s)
James M.Curran
References
Aitchison,J.(1986).“The Statistical Analysis of Compositional Data”,Chapman and Hall,reprinted in2003with additional material by The Blackburn Press
See Also
alr
Examples
data(bottle.df)
##transform prerving grouping
clr(bottle.df,"Number")
##transform the data but remove the
##grouping in column1
clr(bottle.df[,-1])
container.df Container data
Description
This data contains the elemental concentration of nine different elements(Titanium,Aluminium, Iron,Mangane,Magnesium,Calcium,Barium,Strontium,and Zirconium)in specimens of glass taken from two different containers.Ten measurements were taken from each container.
Usage
data(container.df)
References太阳升起来
Jo R.Almirall.Discrimination of glass samples by solution bad ICP-OES PhD thesis,Depart-ment of Chemistry,Florida International University,1998.
hotelling.stat5 hotelling.stat Calculate Hotelling’s two sample T-squared test statistic
Description
Calculate Hotelling’s T-squared test statistic for the difference in two multivariate means.
Usage
hotelling.stat(x,y,shrinkage=FALSE)
hotel.stat(x,y,shrinkage=FALSE)
Arguments
x a nx by p matrix containing the data points from sample1
y a ny by p matrix containg the data points from sample2
shrinkage t to TRUE if the covariance matrices are to be estimated using Schaefer and Strimmer’s James-Stein shrinkage estimator
Details
Note,the sample size requirements are that nx+ny>p-1.The procedure will stop if this is not met and the shrinkage estimator is not being ud.The shrinkage estimator has not been rigorously tested for this application(small p,smaller n).
Value
A list containing the following components:
statistic Hotelling’s(unscaled)T-squared statistic
m The scaling factor-this can be ud by by multiplying it with the test statistic, or dividing the critical F value
df a vector of length containing the numerator and denominator degrees of freedom nx The sample size of sample1
ny The sample size of sample2
p The number of variables to be ud in the comparison
Author(s)
James M.Curran