@stdlib/stats-base-ztest-two-sample-results-to-json
v0.1.1
Published
Serialize a two-sample Z-test results object as a JSON object.
Readme
res2json
Serialize a two-sample Z-test results object as a JSON object.
Installation
npm install @stdlib/stats-base-ztest-two-sample-results-to-jsonUsage
var res2json = require( '@stdlib/stats-base-ztest-two-sample-results-to-json' );res2json( results )
Serializes a two-sample Z-test results object as a JSON object.
var Float64Results = require( '@stdlib/stats-base-ztest-two-sample-results-float64' );
var results = new Float64Results();
// ...
var o = res2json( results );
// returns {...}The function supports the following parameters:
- results: two-sample Z-test results object.
Examples
var Float64Results = require( '@stdlib/stats-base-ztest-two-sample-results-float64' );
var resolveEnum = require( '@stdlib/stats-base-ztest-alternative-resolve-enum' );
var Float64Array = require( '@stdlib/array-float64' );
var res2json = require( '@stdlib/stats-base-ztest-two-sample-results-to-json' );
var results = new Float64Results();
results.rejected = true;
results.alpha = 0.05;
results.pValue = 0.0132;
results.statistic = 2.4773;
results.nullValue = 0.0;
results.xmean = 3.7561;
results.ymean = 3.0129;
results.ci = new Float64Array( [ 0.1552, 1.3311 ] );
results.alternative = resolveEnum( 'two-sided' );
var o = res2json( results );
console.log( o );Notice
This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
Community
License
See LICENSE.
Copyright
Copyright © 2016-2026. The Stdlib Authors.
