| Statistics Toolbox | Search  Help Desk |
| barttest | Examples See Also |
Bartlett's test for dimensionality.
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 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.
Example
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.6618
1.0000
See Also
princomp,pcacov,pcares