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 mean 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.
Mean calculation uses the formula,
M = Sum(F*MC)/N
where:
F = class frequency
MC = class mark
N = sample size [=sum(F)]
Syntax: function y = gmean(x)
Inputs:
x - data matrix (Size of matrix must be n-by-2; absolut frequency=column 1, class mark=column 2)
Outputs:
y - mean of the values in x
Cita come
Antonio Trujillo-Ortiz (2024). gmean (https://www.mathworks.com/matlabcentral/fileexchange/38280-gmean), MATLAB Central File Exchange. Recuperato .
Compatibilità della release di MATLAB
Compatibilità della piattaforma
Windows macOS LinuxCategorie
- AI, Data Science, and Statistics > Statistics and Machine Learning Toolbox > Descriptive Statistics and Visualization >
Tag
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Scopri Live Editor
Crea script con codice, output e testo formattato in un unico documento eseguibile.