Method: Statsample::StratifiedSample.standard_error_ksd_wr

Defined in:
lib/statsample/multiset.rb

.standard_error_ksd_wr(es) ⇒ Object



107
108
109
110
111
112
113
114
# File 'lib/statsample/multiset.rb', line 107

def standard_error_ksd_wr(es)
  n_total=0
  sum=es.inject(0){|a,h|
      n_total+=h['N']
      a+((h['N']**2 * h['s']**2) / h['n'].to_f)
  }
  (1.to_f / n_total)*Math::sqrt(sum)
end