Skip to content
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

[stats/computeStats] min/max should match the dataset when there are no outliers #851

Closed
williaster opened this issue Oct 6, 2020 · 0 comments · Fixed by #853
Closed

Comments

@williaster
Copy link
Collaborator

williaster commented Oct 6, 2020

Noted in #841:

When there are no outliers, min/max should be the Math.min(data) and Math.max(data) of the passed data. Currently min/max are always computed as the low (Q1 - 1.5 * IQR) & high (Q3 + 1.5 * IQR) values which are used for calculating the outliers. These are the min/max when showing outliers, but shouldn't be used when there are no outliers.

For example:

data = [10000, 2400, 10000, 10000]
computeStats(data).boxPlot;
{
  "min": 500,
  "firstQuartile": 6200,
  "median": 10000,
  "thirdQuartile": 10000,
  "max": 15700,
  "outliers": []
}

The expected output should be

{
  "min": 2400,
  "firstQuartile": 6200,
  "median": 10000,
  "thirdQuartile": 10000,
  "max": 10000,
  "outliers": []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant