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

Interquartile Range - manual computation vs iqr function #572

Closed
ksangabriel opened this issue Mar 28, 2020 · 1 comment
Closed

Interquartile Range - manual computation vs iqr function #572

ksangabriel opened this issue Mar 28, 2020 · 1 comment

Comments

@ksangabriel
Copy link

ksangabriel commented Mar 28, 2020

Hi Team,

I was trying out the iqr() but the value it returns is wrong, I think.

# Sorted
samples = 98, 90, 70, 18, 92, 92, 55, 83, 45, 95, 88, 76, 100

# I IQR value of 22.0
println(iqr(samples))

When manually computing for IQR, I get 31.0.

I used this online calculator to compute for IQR, it shows 31.0.

I tried these too:

@nalimilan
Copy link
Member

There are many definitions of quantiles, which vary slightly in cases where the quartile falls between two observations. See https://en.wikipedia.org/wiki/Quantile#Estimating_quantiles_from_a_sample. The calculators you used probably take a different definition. We use the same definition as R, so you can check against these if you have doubts, but I'm pretty confident we match their results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants