class Statsample::Test::BartlettSphericity
Bartlett's test of Sphericity.¶ ↑
Test the hyphotesis that the sample correlation matrix comes from a multivariate normal population where variables are independent. In other words, the population correlation matrix is the identity matrix.
Reference¶ ↑
-
Dziuban, C., & Shirkey E. (1974). When is a correlation matrix appropriate for factor analysis? Some decision rules. Psychological Bulletin, 81(6), 358-361.
Bartlett's test of Sphericity.¶ ↑
Test the hyphotesis that the sample correlation matrix comes from a multivariate normal population where variables are independent. In other words, the population correlation matrix is the identity matrix.
Reference¶ ↑
-
Dziuban, C., & Shirkey E. (1974). When is a correlation matrix appropriate for factor analysis? Some decision rules. Psychological Bulletin, 81(6), 358-361.
Attributes
Public Class Methods
Args
-
matrix: correlation matrix
-
ncases: number of cases
# File lib/statsample/test/bartlettsphericity.rb, line 21 def initialize(matrix,ncases) @matrix=matrix @ncases=ncases @nvars=@matrix.row_size @name=_("Bartlett's test of sphericity") compute end
Public Instance Methods
Uses SPSS formula. On Dziuban & Shirkey, the minus between the first and second statement is a *!!!
# File lib/statsample/test/bartlettsphericity.rb, line 32 def compute @value=-((@ncases-1)-(2*@nvars+5).quo(6))*Math::log(@matrix.determinant) @df=(@nvars*(@nvars-1)).quo(2) end
# File lib/statsample/test/bartlettsphericity.rb, line 36 def probability 1-Distribution::ChiSquare.cdf(@value,@df) end