lib/statsample/reliability.rb in statsample-1.4.0 vs lib/statsample/reliability.rb in statsample-1.4.1
- old
+ new
@@ -3,11 +3,10 @@
class << self
# Calculate Chonbach's alpha for a given dataset.
# only uses tuples without missing data
def cronbach_alpha(ods)
ds=ods.dup_only_valid
- return nil if ds.vectors.any? {|k,v| v.variance==0}
n_items=ds.fields.size
return nil if n_items<=1
s2_items=ds.vectors.inject(0) {|ac,v|
ac+v[1].variance }
total=ds.vector_sum
@@ -148,6 +147,6 @@
end # Statsample
require 'statsample/reliability/icc.rb'
require 'statsample/reliability/scaleanalysis.rb'
require 'statsample/reliability/skillscaleanalysis.rb'
-require 'statsample/reliability/multiscaleanalysis.rb'
\ No newline at end of file
+require 'statsample/reliability/multiscaleanalysis.rb'