barttest - Bartlett's test
Syntax
ndim = barttest(X,alpha)
[ndim,prob,chisquare] = barttest(X,alpha)
Description
ndim = barttest(X,alpha) returns
the number of dimensions necessary to explain the nonrandom variation
in the data matrix X, using the significance probability alpha.
The dimension is determined by a series of hypothesis tests. The test
for ndim=1 tests the hypothesis that the variances
of the data values along each principal component are equal, the test
for ndim=2 tests the hypothesis that the variances
along the second through last components are equal, and so on.
[ndim,prob,chisquare] = barttest(X,alpha) returns
the number of dimensions, the significance values for the hypothesis
tests, and the χ2 values associated
with the tests.
Examples
X = mvnrnd([0 0],[1 0.99; 0.99 1],20);
X(:,3:4) = mvnrnd([0 0],[1 0.99; 0.99 1],20);
X(:,5:6) = mvnrnd([0 0],[1 0.99; 0.99 1],20);
[ndim, prob] = barttest(X,0.05)
ndim =
3
prob =
0
0
0
0.5081
0.6618See Also
princomp, pcacov, pcares
 | BandWidth property (ProbDistKernel) | | bbdesign |  |
Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
Get the Interactive Kit