@stdlib/stats-base-ztest-two-sample-results-factory
v0.0.1
Published
Return a constructor for creating a two-sample Z-test results object.
Readme
resultsFactory
Create a new constructor for creating a two-sample Z-test results object.
Installation
npm install @stdlib/stats-base-ztest-two-sample-results-factoryUsage
var resultsFactory = require( '@stdlib/stats-base-ztest-two-sample-results-factory' );resultsFactory( dtype )
Returns a new constructor for creating a two-sample Z-test results object.
var Results = resultsFactory( 'float64' );
// returns <Function>
var r = new Results();
// returns <Results>The function supports the following parameters:
- dtype: floating-point data type for storing floating-point results. Must be either
'float64'or'float32'.
Notes
- A results object is a
structproviding a fixed-width composite data structure for storing two-sample Z-test results and providing an ABI-stable data layout for JavaScript-C interoperation.
Examples
var Float64Array = require( '@stdlib/array-float64' );
var Float32Array = require( '@stdlib/array-float32' );
var resultsFactory = require( '@stdlib/stats-base-ztest-two-sample-results-factory' );
var Results = resultsFactory( 'float64' );
var results = new Results({
'rejected': true,
'alpha': 0.05,
'pValue': 0.0132,
'statistic': 2.4773,
'nullValue': 0.0,
'xmean': 3.7561,
'ymean': 3.0129,
'ci': new Float64Array( [ 0.1552, 1.3311 ] ),
'alternative': 'two-sided'
});
var str = results.toString({
'format': 'linear'
});
console.log( str );
Results = resultsFactory( 'float32' );
results = new Results({
'rejected': true,
'alpha': 0.05,
'pValue': 0.0132,
'statistic': 2.4773,
'nullValue': 0.0,
'xmean': 3.7561,
'ymean': 3.0129,
'ci': new Float32Array( [ 0.1552, 1.3311 ] ),
'alternative': 'two-sided'
});
str = results.toString({
'format': 'linear'
});
console.log( str );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.
