BoxM.F {smsets} | R Documentation |
F approximation of Box's M test
Description
An R function which implements an F approximation for testing the homogeneity of covariance matrices by Box's M. This is an alternative approach to the chi square approximation which requires group sample-sizes to be at least 20.
Usage
BoxM.F(x, group)
Arguments
x |
A data frame with |
group |
The classification factor defining m samples or groups.
It must be one of the columns in |
Details
For m
samples, the M
statistic is given by the equation
M = \frac{\prod_{j=1}^{m} |\mathbf{C}_j|^{(n_{j}-1)/2}}{|\mathbf{C}|^{(n-m)/2}}
where
n_{j}
is the sample size of the j
-th sample,
|\mathbf{C}_j|
is the determinant of the covariance matrix for the
j
th sample,
|\mathbf{C}|
is the determinant of the pooled covariance matrix,
n
is the total number of observations.
Large values of M
provide evidence that the samples are not from
populations with the same covariance matrix. In addition to the observed
M-value itself, the F-approximation involves the sample sizes and the
number of variables analyzed. See the reference for details. Box's test is
sensitive to deviations from normality in the distribution of the variables.
Value
Returns an object of class "BoxM.F"
, a list containing the
following components:
name | A character string describing the function. |
Cov.Mat | A list containing the m sample covariance matrices |
Cov.pooled | The pooled covariance matrix |
BoxM.stat | The approximate F-statistic |
F.BoxM | The calculated F-statistic |
df.v1 | Numerator degrees of freedom for the F statistic |
df.v2 | Denominator degrees of freedom for the F statistic |
Pvalue | P-value for the F statistic |
group | a character string specifying the name of the classification factor defining groups. |
levels.group | a vector of length m, showing the levels
in factor group . |
data.name | a character string giving the name of the data. |
variables | a character string vector containing the variable names. |
data | the data frame analyzed. |
Author(s)
Jorge Navarro Alberto, ganava4@gmail.com
References
Manly, B.F.J., Navarro Alberto, J.A. and Gerow, K. (2024) Multivariate Statistical Methods. A Primer. 5th Edn. Chapman and Hall/CRC.
Examples
data(skulls)
resBoxM.F <- BoxM.F(skulls, Period)
# Brief output
resBoxM.F