4.76923

4.8 | 14 ratings Rate this file 67 Downloads (last 30 days) File Size: 2.69 KB File ID: #5877

Quartile & Percentile Calculation

by Chris D. Larson

 

14 Sep 2004 (Updated 17 Sep 2004)

Demonstrates a method for computing percentiles and other basic statistics.

| Watch this File

File Information
Description

Included in the first line of the script is a sample data set. The script will compute basic statistics on this data set:

mean
1-sigma (standard deviation)
median
first quartile (25th percentile)
second quartile (50th percentile)
third quartile (75th percentile)
kth percentile
IQR
SID

Acknowledgements
This submission has inspired the following:
medoultierfilt, Box Plot with Whiskers Plotted at Fixed Percentiles
MATLAB release MATLAB 7 (R14)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (15)
23 Mar 2005 Anthony Nigara

Very helpful, I'm surprised that this isn't an included Matlab function!?

02 Aug 2005 J Choi

must-have function for any statistical data process

29 Sep 2005 Nikhil Padhye

Very useful indeed, but watch for a small error in the Q3 outlier calculation: you will need to replace Q(1)+3*IQR by Q(3)+3*IQR.

05 Nov 2005 Jimmy Yi

Very helpful and neat!

28 Sep 2006 Gabriela Molina  
02 Feb 2007 Max Feltham

clear and easy to use

24 Jul 2007 Hossein Kazemi

Why does the file returns an error when x=randn(100,1)? There is no error if the length is different from 100!

10 Aug 2007 Ed Cruz  
21 Sep 2007 alex christ

I thinks its really great but when i play with x array and i use a negative value it detects an outlier but doesnt say which one! If though use a positive value it detects the outlier plus says which value is the outlier!
Why is the negative value not recognized?

21 Sep 2007 alex christ

If you remove the ; from line 39 at the end of outliersQ1 = y(iy) then even if you use a negative value you will see it detected n pointed out! :)
Great File n Should Be used as Build In for sure!

23 Jan 2008 Jeff Morin  
25 Jun 2008 Rainer Glas  
31 Jul 2008 Tony Fisher

Well done: simple but to the point. Thank you (I use this in software that I give to users who don't have the MatLab Statistics tbx)
Best wishes Tony Fisher

21 Jan 2011 mathworks2011

excellent

13 May 2011 Ela Fire

Excellent work ! Matlab should implement in this in future

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
statistics Chris D. Larson 22 Oct 2008 07:31:29
probability Chris D. Larson 22 Oct 2008 07:31:29
statistics quartile percentile Chris D. Larson 22 Oct 2008 07:31:29
probability John 20 Apr 2009 21:41:08
probability Samuel 07 Dec 2009 06:56:25
statistics quartile percentile Samuel 07 Dec 2009 06:56:30
statistics quartile percentile Bayo 15 Feb 2010 05:01:56
statistics quartile percentile Jason K 11 Aug 2010 17:22:51
statistics quartile percentile Philip 01 Nov 2010 10:30:55
statistics Philip 01 Nov 2010 10:30:58
probability Philip 01 Nov 2010 10:31:02

Contact us at files@mathworks.com