Products & Services Solutions Academia Support User Community Company

Learn more about Statistics Toolbox   

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.6618

See Also

princomp, pcacov, pcares

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS