Sha256: b6562241ea8c3ba4483a1e497a6b933a7100655371984f8a9fbcba02d5a6297f

Contents?: true

Size: 809 Bytes

Versions: 12

Compression:

Stored size: 809 Bytes

Contents

$:.unshift(File.dirname(__FILE__)+'/../lib/')
require 'statsample'
require 'test/unit'
class StatsampleLogitTestCase < Test::Unit::TestCase
    def test_logit_1
        crime=File.dirname(__FILE__)+'/../data/test_binomial.csv'
        ds=Statsample::CSV.read(crime)
        lr=Statsample::Regression::Binomial::Logit.new(ds,'y')
        assert_in_delta(-38.8669,lr.log_likehood,0.001)
        assert_in_delta(-5.3658,lr.constant,0.001)
        
        exp_coeffs={"a"=>0.3270,"b"=>0.8147, "c"=>-0.4031}
        exp_coeffs.each{|k,v|
            assert_in_delta(v,lr.coeffs[k],0.001)
        }
        exp_errors={'a'=>0.4390,'b'=>0.4270,'c'=>0.3819}
        exp_errors.each{|k,v|
            assert_in_delta(v,lr.coeffs_se[k],0.001)
        }
        assert_equal(7,lr.iterations)               
    end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
statsample-0.7.0 test/test_logit.rb
statsample-0.6.7 test/test_logit.rb
statsample-0.6.5 test/test_logit.rb
statsample-0.6.4 test/test_logit.rb
statsample-0.6.3 test/test_logit.rb
statsample-0.6.2 test/test_logit.rb
statsample-0.6.1 test/test_logit.rb
statsample-0.6.0 test/test_logit.rb
statsample-0.5.1 test/test_logit.rb
statsample-0.5.0 test/test_logit.rb
statsample-0.4.1 test/test_logit.rb
statsample-0.4.0 test/test_logit.rb