Method: Statsample::Reliability::ScaleAnalysis#item_characteristic_curve
- Defined in:
- lib/statsample/reliability/scaleanalysis.rb
#item_characteristic_curve ⇒ Object
Returns a hash with structure
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/statsample/reliability/scaleanalysis.rb', line 63 def item_characteristic_curve i=0 out={} total={} @ds.each do |row| tot=@total[i] @ds.vectors.each do |f| out[f]||= {} total[f]||={} out[f][tot]||= 0 total[f][tot]||=0 out[f][tot]+= row[f] total[f][tot]+=1 end i+=1 end total.each do |f,var| var.each do |tot,v| out[f][tot]=out[f][tot].quo(total[f][tot]) end end out end |