lrt.statistic | R Documentation |
The traditional likelihood ratio test statistic for the one-sample hypothesis of covariance matrix.
lrt.statistic(x, test = "identity")
x |
data matrix with rows representing samples and columns representing variables |
test |
The type of test being performed - "identity"(default) or "sphericity". |
A list with two values
The test statistic value
The p-value
T. W. Anderson. An introduction to multivariate statistical analysis. Wiley Series in Probability and Statistics, 3rd edition, 2003.
library(mvtnorm)
# Test for identity
x = rmvnorm(n = 20, mean = numeric(100), sigma = diag(100))
lrt.statistic(x, test = "identity")
# Test for sphericity
y = rmvnorm(n = 10, mean = runif(100, 1, 3), sigma = diag(rgamma(100, 10, 3)))
lrt.statistic(y, test = "sphericity")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.