This package is abandoned and no longer maintained. No replacement package was suggested.

binomial confidence intervals

1.3.0 2017-03-10 22:04 UTC

This package is not auto-updated.

Last update: 2020-04-15 11:43:47 UTC


README

Latest Version on Packagist Software License Build Status Total Downloads

Binomial proportion confidence intervals. Supported methods are Agresti-Coull, Wald and Wilson Score.

Install

Via Composer

$ composer require ozdemirburak/sancus

Usage

$interval = new OzdemirBurak\Sancus\Intervals\AgrestiCoullInterval($positive = 25, $negative = 25, $confidence = 0.95);
print_r($interval->getInterval()); // Array([0] => 0.36644514398812, [1] => 0.63355485601188)
echo $interval->getLowerBound(); // prints 0.36644514398812

$interval = new OzdemirBurak\Sancus\Intervals\WaldInterval(10, 50);
print_r($interval->getInterval()); // Array([0] => 0.072367856116984, [1] => 0.26096547721635)
echo $interval->getUpperBound(); // prints 0.26096547721635

$interval = new OzdemirBurak\Sancus\Intervals\WilsonInterval(75, 25, 0.90);
print_r($interval->getInterval()); // Array([0] => 0.67282656258608, [1] => 0.81400207671582)
echo $interval->getScore(); // WilsonInterval only, same as $interval->getLowerBound(), prints 0.67282656258608

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Credits

License

The MIT License (MIT). Please see License File for more information.