Skip to content

docs: improve README examples of stats/base/dists/studentized-range #2183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,25 @@ The namespace contains the following distribution functions:
<!-- eslint no-undef: "error" -->

```javascript
var objectKeys = require( '@stdlib/utils/keys' );
var tukey = require( '@stdlib/stats/base/dists/studentized-range' );

console.log( objectKeys( tukey ) );
/*
* Let's consider an example where we are analyzing the test scores of students in a class.
* We're interested in using the Studentized Range Distribution to analyze the range of scores.
* The distribution has parameters: r (number of means), v (degrees of freedom), and nranges (number of ranges).
*/

var r = 5.0;
var v = 20.0;
var nranges = 3.0;

// CDF can be used to calculate the cumulative distribution function at a specific value:
var out = tukey.cdf( 2.0, r, v, nranges );
// returns ~0.074

// Quantile can also be used to calculate the quantile function at a specific probability:
out = tukey.quantile( 0.9, r, v, nranges );
// returns ~4.433
```

</section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,22 @@

'use strict';

var objectKeys = require( '@stdlib/utils/keys' );
var tukey = require( './../lib' );

console.log( objectKeys( tukey ) );
/*
* Let's consider an example where we are analyzing the test scores of students in a class.
* We're interested in using the Studentized Range Distribution to analyze the range of scores.
* The distribution has parameters: r (number of means), v (degrees of freedom), and nranges (number of ranges).

Check warning on line 26 in lib/node_modules/@stdlib/stats/base/dists/studentized-range/examples/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unknown word: "nranges"
*/

var r = 5.0;
var v = 20.0;
var nranges = 3.0;

// CDF can be used to calculate the cumulative distribution function at a specific value:
console.log( tukey.cdf( 2.0, r, v, nranges ) );
// => ~0.074

// Quantile can also be used to calculate the quantile function at a specific probability:
console.log( tukey.quantile( 0.9, r, v, nranges ) );
// => ~4.433
Loading