Reliability ICC analysis with statsample

In [2]:
require 'statsample'

Statsample::Analysis.store(Statsample::Reliability::ICC) do
  Daru.lazy_update = true
  size=1000
  a = Daru::Vector.new_with_size(size) {rand(10)}
  
  # The `recode` method acts similarly to `map`, the difference
  # being that `recode` returns a Daru::Vector using the value
  # returned by each run of the block
  b = a.recode{|i|i+rand(4)-2}
  c = a.recode{|i|i+rand(4)-2}
  d = a.recode{|i|i+rand(4)-2}
  @ds = Daru::DataFrame.new({:a => a,:b => b,:c => c,:d => d})
  @icc=Statsample::Reliability::ICC.new(@ds)
  summary(@icc)
  @icc.type=:icc_3_1
  summary(@icc)
  @icc.type=:icc_a_k
  summary(@icc)
  
  Daru.lazy_update = false
end

Statsample::Analysis.run_batch
Analysis 2015-06-03 18:13:36 +0530
= Statsample::Reliability::ICC
  == Intra-class correlation
    McGraw & Wong ICC(A,K)
    ICC: 0.9695
    F Test : F(999.00, 578.23) = 34.9504 , p = 0.0000
    CI (95.00): [0.9646 - 0.9735]
  == Intra-class correlation
    McGraw & Wong ICC(A,K)
    ICC: 0.9695
    F Test : F(999.00, 578.23) = 34.9504 , p = 0.0000
    CI (95.00): [0.9646 - 0.9735]
  == Intra-class correlation
    McGraw & Wong ICC(A,K)
    ICC: 0.9695
    F Test : F(999.00, 578.23) = 34.9504 , p = 0.0000
    CI (95.00): [0.9646 - 0.9735]