You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
In some scientific works, once the data have been gathered from a population of interest, it is often difficult to get a sense of what the data indicate when they are presented in an unorganized fashion.
Assembling the raw data into a meaningful form, such as a frequency distribution, makes the data easier to understand and interpret. It is in the context of frequency distributions that the importance of conveying in a succinct way numerical information contained in the data is encountered.
So, grouped data is data that has been organized into groups known as classes. The raw dataset can be organized by constructing a table showing the frequency distribution of the variable (whose values are given in the raw dataset). Such a frequency table is often referred to as grouped data.
Here, we developed a m-code to calculate the percentile(s) of a grouped data. One can input the returns or modified vectors n and xout containing the frequency counts and the bin locations of the hist m-function, in a column form matrix.
Percentile calculation uses the straight forward formula,
P = L + I*(N*P/100 - C)/F
where:
L = lower limit of the interval containing the percentile
I = width of the interval containing the percentile
N = total number of data
P = interested percentile
C = cumulative frequency corresponding to the previous percentile class
F = number of cases in the interval containing the percentile
Syntax: function y = gprctile(x,p)
Inputs:
x - data matrix (Size of matrix must be n-by-2; absolut frequency=column 1, class mark=column 2)
p - is a scalar or a vector of percent values
Outputs:
y - percentile(s) of the values in x
Cite As
Antonio Trujillo-Ortiz (2026). gprctile (https://www.mathworks.com/matlabcentral/fileexchange/38228-gprctile), MATLAB Central File Exchange. Retrieved .
General Information
- Version 1.1.0.0 (2.99 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
