get_hotellings {disprofas} | R Documentation |
Hotelling's statistics (for two independent (small) samples)
Description
The function get_hotellings()
estimates the parameters for Hotelling's
two-sample statistic for small samples. Note that the
function
get_hotellings()
is deprecated. Upon the introduction of
the new function get_T2_one()
it was renamed to get_T2_two()
.
Please use the new function get_T2_two()
instead of the obsolete
function get_hotellings()
.
Usage
get_hotellings(m1, m2, signif)
Arguments
m1 |
A matrix with the data of the reference group, e.g. a matrix representing dissolution profiles, i.e. with rows for the different dosage units and columns for the different time points, or a matrix for the different model parameters (columns) of different dosage units (rows). |
m2 |
A matrix with the same dimensions as matrix |
signif |
A positive numeric value between |
Details
The two-sample Hotelling's test statistic is given by
where and
are the vectors of the
sample means of the test (
) and reference (
) group, e.g.
vectors of the average dissolution per time point or of the average model
parameters,
and
are the numbers of observations of the
reference and the test group, respectively (i.e. the number of rows in
matrices
m1
and m2
handed over to the get_T2_two()
function), and is the pooled
variance-covariance matrix which is calculated by
where and
are the estimated
variance-covariance matrices which are calculated from the matrices of the
two groups being compared, i.e.
m1
and m2
. The matrix
is the inverted
variance-covariance matrix. As the number of columns of matrices
m1
and m2
increases, and especially as the correlation between the
columns increases, the risk increases that the pooled variance-covariance
matrix is ill-conditioned or even singular
and thus cannot be inverted. The term
is the Mahalanobis distance which is used to measure the difference between
two multivariate means. For large samples, is approximately
chi-square distributed with
degrees of freedom, where
is
the number of variables, i.e. the number of dissolution profile time points
or the number of model parameters. In terms of the Mahalanobis distance,
Hotelling's
statistic can be expressed has
To transform the Hotelling's statistic into an
-statistic,
a conversion factor is necessary, i.e.
With this transformation, the following test statistic can be applied:
Under the null hypothesis, , this
-statistic is
-distributed with
and
degrees of freedom.
is
rejected at significance level
if the
-value exceeds
the critical value from the
-table evaluated at
, i.e.
. The null hypothesis is satisfied
if, and only if, the population means are identical for all variables. The
alternative is that at least one pair of these means is different.
The following assumptions concerning the data are made:
The data from population
is a sample from a population with mean vector
. In other words, it is assumed that there are no sub-populations.
The data from both populations have common variance-covariance matrix
.
The elements from both populations are independently sampled, i.e. the data values are independent.
Both populations are multivariate normally distributed.
Confidence intervals:
Confidence intervals for the mean differences at each time point or
confidence intervals for the mean differences between the parameter
estimates of the reference and the test group are calculated by aid of the
formula
where is the vector of the diagonal
elements of the pooled variance-covariance matrix
. With
confidence,
this interval covers the respective linear combination of the differences
between the means of the two sample groups. If not the linear combination
of the variables is of interest but rather the individual variables, then
the Bonferroni corrected confidence intervals should be used instead which
are given by the expression
Value
A list with the following elements is returned:
Parameters |
Parameters determined for the estimation of Hotelling's
|
S.pool |
Pooled variance-covariance matrix. |
covs |
A list with the elements |
means |
A list with the elements |
CI |
A list with the elements |
The Parameters
element contains the following information:
dm |
Mahalanobis distance of the samples. |
df1 |
Degrees of freedom (number of variables or time points). |
df2 |
Degrees of freedom (number of rows - number of variables - 1). |
alpha |
Provided significance level. |
K |
Scaling factor for |
k |
Scaling factor for the squared Mahalanobis distance to obtain
the |
T2 |
Hotelling's |
F |
Observed |
F.crit |
Critical |
t.crit |
Critical |
p.F |
|
References
Hotelling, H. The generalisation of Student's ratio. Ann Math Stat. 1931; 2(3): 360-378.
Hotelling, H. (1947) Multivariate quality control illustrated by air testing of sample bombsights. In: Eisenhart, C., Hastay, M.W., and Wallis, W.A., Eds., Techniques of Statistical Analysis, McGraw Hill, New York, 111-184.
See Also
get_T2_one
, get_sim_lim
,
mimcr
.
Examples
# Estimation of the parameters for Hotelling's two-sample T2 statistic
# (for small samples)
## Not run:
res <-
get_hotellings(m1 = as.matrix(dip1[dip1$type == "R", c("t.15", "t.90")]),
m2 = as.matrix(dip1[dip1$type == "T", c("t.15", "t.90")]),
signif = 0.1)
res$S.pool
res$Parameters
## End(Not run)
# Expected results in res$S.pool
# t.15 t.90
# t.15 3.395808 1.029870
# t.90 1.029870 4.434833
# Expected results in res$Parameters
# DM df1 df2 signif K
# 1.044045e+01 2.000000e+00 9.000000e+00 1.000000e-01 1.350000e+00
# k T2 F F.crit p.F
# 3.000000e+00 3.270089e+02 1.471540e+02 3.006452e+00 1.335407e-07