Reliability ICC analysis with statsample

In [1]:
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 2016-03-26 10:21:47 +0000
= Statsample::Reliability::ICC
  == Intra-class correlation
    McGraw & Wong ICC(A,K)
    ICC: 0.9712
    F Test : F(999.00, 534.39) = 37.1753 , p = 0.0000
    CI (95.00): [0.9665 - 0.9751]
  == Intra-class correlation
    McGraw & Wong ICC(A,K)
    ICC: 0.9712
    F Test : F(999.00, 534.39) = 37.1753 , p = 0.0000
    CI (95.00): [0.9665 - 0.9751]
  == Intra-class correlation
    McGraw & Wong ICC(A,K)
    ICC: 0.9712
    F Test : F(999.00, 534.39) = 37.1753 , p = 0.0000
    CI (95.00): [0.9665 - 0.9751]