ozdemirburak / sancus
binomial confidence intervals
Installs: 1 034
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 1
Open Issues: 0
Requires
- php: >=5.3.0
Requires (Dev)
- phpunit/phpunit: ~4.0|~5.0
This package is not auto-updated.
Last update: 2020-04-15 11:43:47 UTC
README
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.